Get the FREE Ultimate OpenClaw Setup Guide →

tongchenglvxing

非官方的同程旅行网的火车票MCP Server,目前仅支持火车票车次查询

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio wuchubuzai2018-tongchenglvxing-mcp-server npx -y @wuchubuzai/tongchenglvxing-mcp-server

How to use

This MCP server provides two main tools for interacting with Tongcheng Lvxing's train ticket data. Tool 1 lets you query the list of train services for a given ticket route, enabling you to retrieve available train numbers and timing information. Tool 2 exposes a current time query utility, which can be useful for synchronization and time-based logic in client applications. The server is built with the MCP Typescript SDK and is designed to be used from MCP clients via Node.js (NPX) integration. To use it, deploy the MCP server package and configure your MCP client to load the server as a modular MCP service.

Typical usage involves loading the server through NPX in your MCP client configuration (as shown in the installation notes). Once loaded, you can call the provided MCP endpoints for: (1) train service lists for a route on a given date, and (2) the current server time. The Node.js-based approach is currently supported, with Java support planned for the future.

How to install

Prerequisites:

  • Node.js and npm installed on your machine
  • Basic familiarity with MCP client configuration
  1. Install Node.js if you haven't already: download from https://nodejs.org/ and verify with:
node -v
npm -v
  1. Install dependencies and build locally (if you are developing the MCP server):
git clone https://github.com/wuchubuzai2018/tongchenglvxing-mcp-server.git
cd tongchenglvxing-mcp-server
npm install
npm run build
  1. Use NPX to load the MCP server in your MCP client (published package):
{
  "mcpServers": {
    "tongchenglvxing-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@wuchubuzai/tongchenglvxing-mcp-server"
      ]
    }
  }
}
  1. Alternatively, run in development mode by pointing NPX at your built dist/index.js (local path):
{
  "mcpServers": {
    "tongchenglvxing-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "/path/to/your/dist/index.js"
      ]
    }
  }
}
  1. Start your MCP client and verify the server is reachable through the configured MCP endpoints.

Additional notes

Tips and notes:

  • The server currently supports two MCP tool methods: train ticket list retrieval and current time query.
  • The published MCP package to use with NPX is @wuchubuzai/tongchenglvxing-mcp-server; you can also run a local build if you are developing against the TypeScript sources.
  • Ensure your MCP client is configured to load external MCP servers and that network access to the package registry is allowed.
  • If you encounter issues with Agent/User-Agent headers during HTTP requests, check for updates in the MCP SDK and ensure your environment variables are properly set if the server relies on them (e.g., timeouts, retries).
  • When upgrading, review the release notes for changes to endpoints or input formats.

Related MCP Servers

Sponsor this space

Reach thousands of developers