Basic information
About 12306 Mcp Server
基于 Model Context Protocol (MCP) 的12306购票搜索服务器。提供了简单的API接口,允许大模型利用接口搜索12306购票信息。
12306 Mcp is a MCP server in the Other category listed in the AddMCP.net directory, published by xpfyg. Supported transport: stdio. Runtime: Go. The repository has 1 GitHub stars. Source code is hosted on github.com. Related topics: 12306, ticket.
Setup
claude mcp add 12306-mcp-service --transport http http://127.0.0.1:8080/sse
[mcp_servers.12306-mcp-service] url = "http://127.0.0.1:8080/sse"
{
"mcpServers": {
"12306-mcp-service": {
"url": "http://127.0.0.1:8080/sse"
}
}
}
{
"servers": {
"12306-mcp-service": {
"type": "http",
"url": "http://127.0.0.1:8080/sse"
}
}
}
12306 Mcp config
Add this server to your MCP-compatible client using the configuration below.
{
"12306-mcp": {
"url": "http://127.0.0.1:8080/sse"
}
}
12306 Mcp tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is 12306 Mcp?
12306 Mcp is a Model Context Protocol (MCP) server that provides a simple API interface for searching 12306 train ticket information. It allows large language models to query real-time ticket availability and pricing data from China's official railway ticketing platform.
How to use 12306 Mcp?
Clone the repository, run go mod init 12306-mcp, go mod tidy, then go run main.go to start the server. For use in Cursor IDE, add a "12306-mcp" entry to your local mcp.json with the URL http://127.0.0.1:8080/sse, then ask natural language queries like "查询杭州到武汉明天的高铁票".
Key features of 12306 Mcp
- Query 12306 ticket purchase information in real time
- Supports searching by departure station, arrival station, and date
- Returns train number, departure/arrival times, and duration
- Provides seat type availability and pricing details
- Integrates with Cursor IDE via MCP protocol
Use cases of 12306 Mcp
- Ask an AI assistant to check available trains between two cities on a specific date
- Compare ticket prices and seat availability across different trains
- Quickly retrieve train schedules without manually visiting the 12306 website
Frequently asked questions
1 What data does 12306 Mcp provide?
It returns real-time train schedules including train number, departure and arrival stations, departure/arrival times, journey duration, and seat-specific availability and prices (e.g., business class, first class, second class).
2 What are the runtime requirements?
The server requires Go to build and run. It is designed to work with MCP-compatible clients like Cursor IDE, connecting via SSE at http://127.0.0.1:8080/sse.
3 Does 12306 Mcp support transfer or intermediate station queries?
Not yet. The current version only supports direct station-to-station queries; transfer and pass-through station queries are listed as planned TODO items.
4 What authentication or credentials are needed?
The README does not mention any authentication — the server runs locally and connects to the public 12306 system without requiring user credentials.
5 What transport protocol does 12306 Mcp use?
It uses Server-Sent Events (SSE) transport. The client connects to the server's SSE endpoint to send queries and receive ticket data.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In