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
评论