mcpField
1
12306 Mcp

12306 Mcp

Local
github.com/xpfygMaps & Travel1Updated 79w ago

About 12306 Mcp

12306 Mcp is an MCP server for querying 12306 ticket information by origin, destination, and date.

Key features

  1. 01Query 12306 ticket information

Use cases

  1. 01Find trains for a specified date and route

MCP support

The MCP server exposes 12306 ticket searches to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

12306-MCP

基于 Model Context Protocol (MCP) 的12306购票搜索服务器。提供了简单的API接口,允许大模型利用接口搜索12306购票信息。

功能特点

  • 查询12306购票信息

待办事项

  • 完成12306其余接口(中转,过站查询等)

安装

git clone https://github.com/xpfyg/12306-mcp-service.git
cd 12306-mcp
go mod init 12306-mcp
go mod tidy

快速开始

  1. 运行服务器
go run main.go

API 示例

查询车票信息:

{
    "from_station": "杭州",
    "to_station": "武汉",
    "date": "2025-04-30"
}

响应示例:

[
  {
	"车次": "G1442",
	"出发站": "杭州西",
	"到达站": "武汉",
	"出发时间": "2025-04-26 06:07:00",
	"到达时间": "2025-04-26 10:23:00",
	"历时": "04:16",
	"余票信息": [{
			"座位类型": "商务座",
			"余票数量": 3,
			"价格": 1018
		},
		{
			"座位类型": "一等座",
			"余票数量": 10,
			"价格": 528
		},
		{
			"座位类型": "二等座",
			"余票数量": 21,
			"价格": 329
		}
	]
}
]

在Cursor中使用

要在Cursor IDE中使用此MCP服务:

  1. 确保12306-MCP服务已在本地运行
  2. 在Cursor设置中启用MCP功能
  3. 本地mcp.json添加:
    "12306-mcp": {
      "url": "http://127.0.0.1:8080/sse"
    }
  1. 连接后即可通过对话框使用以下查询示例:
    请帮我查询杭州到武汉明天的高铁票
    
  2. Cursor将通过MCP协议调用本服务获取实时车票信息

参考

许可证

MIT License

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.