/ الدليل / الملعب / mcp-server-12306
● مجتمع drfccv ⚡ فوري

mcp-server-12306

بواسطة drfccv · drfccv/mcp-server-12306

High-performance Python MCP server for 12306 — real-time tickets, prices, station search, train routes, and transfer planning.

mcp-server-12306 is a FastAPI-based MCP server providing real-time data from China's 12306 railway system. It offers 7 tools for ticket queries, price lookups, station search (Chinese/pinyin/abbreviation), train route stops, transfer planning, and time utilities. Supports both stdio (Claude Desktop) and Streamable HTTP modes, with Docker deployment and sub-second response times.

لماذا تستخدمه

الميزات الأساسية

عرض مباشر

كيف يبدو في الممارسة

mcp-server-12306-2.replay ▶ جاهز
0/0

التثبيت

اختر العميل

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mcp-server-12306-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/drfccv/mcp-server-12306"
      ]
    }
  }
}

افتح Claude Desktop → Settings → Developer → Edit Config. أعد التشغيل بعد الحفظ.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mcp-server-12306-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/drfccv/mcp-server-12306"
      ]
    }
  }
}

يستخدم Cursor نفس مخطط mcpServers مثل Claude Desktop. إعدادات المشروع أولى من الإعدادات العامة.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mcp-server-12306-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/drfccv/mcp-server-12306"
      ]
    }
  }
}

انقر على أيقونة MCP Servers في شريط Cline الجانبي، ثم "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mcp-server-12306-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/drfccv/mcp-server-12306"
      ]
    }
  }
}

نفس الصيغة مثل Claude Desktop. أعد تشغيل Windsurf لتطبيق التغييرات.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mcp-server-12306-2",
      "command": "TODO",
      "args": [
        "See README: https://github.com/drfccv/mcp-server-12306"
      ]
    }
  ]
}

يستخدم Continue مصفوفة من كائنات الخادم بدلاً من خريطة.

~/.config/zed/settings.json
{
  "context_servers": {
    "mcp-server-12306-2": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/drfccv/mcp-server-12306"
        ]
      }
    }
  }
}

أضف إلى context_servers. يعيد Zed التحميل تلقائيًا عند الحفظ.

claude mcp add mcp-server-12306-2 -- TODO 'See README: https://github.com/drfccv/mcp-server-12306'

أمر من سطر واحد. تحقق باستخدام claude mcp list. احذف باستخدام claude mcp remove.

حالات الاستخدام

استخدامات عملية: mcp-server-12306

How to compare train ticket prices for a journey with mcp-server-12306

👤 Budget-conscious travelers in China ⏱ ~5 min beginner

متى تستخدمه: You want to find the cheapest option for your train journey.

المتطلبات الأساسية
  • mcp-server-12306 running — uvx mcp-server-12306 or Docker: docker run -p 8000:8000 drfccv/mcp-server-12306:latest
الخطوات
  1. Search tickets with prices
    Query tickets from Beijing to Guangzhou for tomorrow. Show all available trains with prices for each seat class.✓ تم النسخ
    → Table of trains with departure times, durations, and prices per seat class
  2. Get detailed pricing
    Show me the detailed pricing for train G79, including all seat types.✓ تم النسخ
    → Complete fare breakdown for the specific train

النتيجة: Clear price comparison to choose the best value train.

المزالق
  • Prices may vary by date and availability — Check availability alongside prices — cheap seats sell out first

Plan a multi-city train trip across China

👤 Tourists planning a scenic route through multiple Chinese cities ⏱ ~15 min beginner

متى تستخدمه: You want to visit several cities and need to plan the train connections.

المتطلبات الأساسية
  • mcp-server-12306 running — uvx mcp-server-12306
الخطوات
  1. Search stations
    Search for the main train stations in Shanghai, Hangzhou, and Suzhou. Show me the station codes.✓ تم النسخ
    → Station names and codes for each city
  2. Plan the route
    Find the fastest train connections for: Shanghai → Hangzhou → Suzhou → back to Shanghai, spending one day in each city. Show departure times and durations.✓ تم النسخ
    → Complete itinerary with train numbers and times

النتيجة: A multi-city itinerary with all train connections planned.

المزالق
  • Small cities may only have one station — Use the station search to confirm available stations before planning

التركيبات

اجمعها مع خوادم MCP أخرى لتحقيق نتائج x10

mcp-server-12306-2 + fetch

Check weather at your destination alongside train schedules

Find trains from Beijing to Chengdu this weekend and check the weather forecast for Chengdu.✓ تم النسخ

الأدوات

ما يوفره هذا الـ MCP

الأداةالمدخلاتمتى تستدعيهاالتكلفة
query_tickets from: str, to: str, date: str Search for available train tickets 1 API call
query_ticket_price train_no: str, from: str, to: str, date: str Get detailed pricing for a specific train 1 API call
search_stations keyword: str Search stations by name, pinyin, or abbreviation 1 API call
get_station_info station_code: str Get detailed station metadata 1 API call
query_transfer from: str, to: str, date: str Find optimal transfer routes 1 API call
get_train_route_stations train_no: str Get all stops along a train route 1 API call
get_current_time none Get current time for relative date calculations 0

التكلفة والحدود

تكلفة التشغيل

حصة API
Subject to 12306 public API rate limits
الرموز لكل استدعاء
200–800 tokens per query
التكلفة المالية
Free — uses public 12306 API
نصيحة
Use station search to confirm names before querying tickets to avoid wasted calls.

الأمان

الصلاحيات والأسرار ونطاق الأثر

تخزين بيانات الاعتماد: No credentials required
نقل البيانات الخارجي: All calls to 12306.cn official API

استكشاف الأخطاء

الأخطاء الشائعة وحلولها

No tickets found

12306 sells tickets 15 days in advance. Verify your date is within the booking window.

تحقق: Try today's date to confirm connectivity
Station not recognized

Use search_stations first with pinyin or Chinese to find the exact station name.

تحقق: search_stations with a broader keyword
Timeout during peak hours

12306 API is slow during peak ticket sales (holidays, Spring Festival). Retry after a few minutes.

تحقق: Test with a simple station search

البدائل

mcp-server-12306 مقابل البدائل

البديلمتى تستخدمهاالمقايضة
12306-mcpYou prefer a JavaScript/npx-based server with simpler setupSimpler install but fewer features (no price queries or HTTP streaming)

المزيد

الموارد

📖 اقرأ ملف README الرسمي على GitHub

🐙 تصفح القضايا المفتوحة

🔍 تصفح أكثر من 400 خادم MCP و Skills