Mapbox MCP Server
OFFICIAL SERVERGeocoding, place search, routing, isochrones and map images from Mapbox, plus offline geometry maths
Looks up China Railway 12306 train schedules, seat availability, fares, stops and transfers
By drfccv (individual) Python Local · stdio, Streamable HTTP Maps and travel
58 popularity score ★ 421 ↓ 1.3k/mo
Opens the app, which asks before it adds the server.
claude mcp add --transport http 12306 http://localhost:8000/mcp{
"mcpServers": {
"12306": {
"url": "http://localhost:8000/mcp"
}
}
}{
"servers": {
"12306": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}[mcp_servers.12306]
url = "http://localhost:8000/mcp"gemini mcp add --scope user --transport http 12306 http://localhost:8000/mcpOpens the app, which asks before it adds the server.
claude mcp add 12306 -- uvx mcp-server-12306{
"mcpServers": {
"12306": {
"command": "uvx",
"args": [
"mcp-server-12306"
]
}
}
}{
"mcpServers": {
"12306": {
"command": "uvx",
"args": [
"mcp-server-12306"
]
}
}
}{
"servers": {
"12306": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-server-12306"
]
}
}
}[mcp_servers.12306]
command = "uvx"
args = ["mcp-server-12306"]gemini mcp add --scope user 12306 uvx -- mcp-server-12306Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
git clone https://github.com/drfccv/mcp-server-12306.git
cd mcp-server-12306
uv syncclaude mcp add 12306 -- uv --directory '<ABSOLUTE_PATH_TO_CLONE>' run mcp-server-12306{
"mcpServers": {
"12306": {
"command": "uv",
"args": [
"--directory",
"<ABSOLUTE_PATH_TO_CLONE>",
"run",
"mcp-server-12306"
]
}
}
}{
"mcpServers": {
"12306": {
"command": "uv",
"args": [
"--directory",
"<ABSOLUTE_PATH_TO_CLONE>",
"run",
"mcp-server-12306"
]
}
}
}{
"servers": {
"12306": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"<ABSOLUTE_PATH_TO_CLONE>",
"run",
"mcp-server-12306"
]
}
}
}[mcp_servers.12306]
command = "uv"
args = ["--directory", "<ABSOLUTE_PATH_TO_CLONE>", "run", "mcp-server-12306"]gemini mcp add --scope user 12306 uv -- --directory '<ABSOLUTE_PATH_TO_CLONE>' run mcp-server-12306SERVER_HOST |
Optional: Address the HTTP mode listens on; 0.0.0.0 by default. |
|---|---|
SERVER_PORT |
Optional: Port the HTTP mode listens on; 8000 by default. |
LOG_LEVEL |
Optional: DEBUG, INFO, WARNING or ERROR; INFO by default. |
DEBUG |
Optional: Turns on debug mode; false by default. |
MCP Server 12306 connects an assistant to the public query endpoints of 12306, the ticketing system of China Railway. It can check which trains run between two stations on a given date and how many seats are left in each class, look up fares, find stations by Chinese name, pinyin, pinyin initials or three-letter code, list every stop of a train with arrival and departure times, and fetch the transfer itineraries 12306 itself suggests. A small time tool gives the current date in a chosen time zone so the assistant can work out dates like "next Friday".
It only queries; it does not log in, book or pay. The station list ships inside the package, so station searches work offline, while ticket, fare, route and transfer lookups call kyfw.12306.cn directly from your machine.
The package installs two programs: mcp-server-12306 talks over stdio for local clients, and mcp-12306 starts a Streamable HTTP server (port 8000 by default) that also exposes /health and /schema/tools. A Docker image runs the HTTP mode.
In the code at version 0.5.0.post20260930, every 12306 request is retried up to 3 times on network errors with an 8-second timeout, and the HTTP client is created with TLS certificate checking turned off (verify=False in services/ticket_service.py), something the README does not mention.
| Runtime | Python 3.10+ |
|---|
Python 3.10 to 3.13 (3.14 is excluded by the package) and uv for the uvx command, or pip/pipx. Network access to kyfw.12306.cn. No account or key. For the Docker image: Docker, then start it with port 8000 published and point the client at http://localhost:8000/mcp.
Queries only: no booking, payment, login or order lookups. Dates in the past are refused for ticket, train-number and route lookups. search-stations returns 10 results by default, at most 50 with limit. It depends on unofficial use of 12306's web endpoints, which can change or block requests without notice. Its own disclaimer says it is for study and research, forbids commercial use (despite the MIT licence file), and puts any account ban or legal risk on the user. The Docker image and mcp-12306 bind to 0.0.0.0 unless SERVER_HOST is set.
Suits someone planning train trips in mainland China who wants an assistant to compare trains, seat availability, fares and transfers in one conversation, run locally with no keys. It is not a booking tool; buying still happens in 12306 itself. Those who need commercial use should note the maker's no-commercial-use disclaimer, and anyone worried about TLS checks being off should run it on a trusted network.
query-ticketsquery-ticket-pricesearch-stationsquery-transferget-train-route-stationsget-train-no-by-train-codeget-current-time