TDX Local MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TDX Local MCP查询贵州茅台的最新股价和今日涨跌幅"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TDX Local MCP — 通达信本地终端 MCP 服务
直连运行中的通达信客户端(tqcenter / TPythClient.dll),将 36 个 tqcenter 公开 API 全量封装为 49 个 MCP 工具,并提供本地扩展:自动价格预警引擎与模拟交易通道。
功能概览
分组 | 数量 | 工具 |
连接状态 | 1 | tdx_status |
行情与报价 | 4 | tdx_kline / tdx_snapshot / tdx_divid_factors / tdx_money_flow |
基础信息 | 6 | tdx_stock_info / tdx_stock_list / tdx_trading_calendar / tdx_trading_dates / tdx_cb_info / tdx_ipo_info |
财务与专业数据 | 9 | tdx_financial_data(_by_date) / tdx_gpjy_value(_by_date) / tdx_bkjy_value(_by_date) / tdx_scjy_value(_by_date) / tdx_gp_one_data |
板块与自选股 | 8 | tdx_sector_list / tdx_user_sector / tdx_sector_stocks / tdx_create_sector / tdx_delete_sector / tdx_rename_sector / tdx_clear_sector / tdx_send_user_block |
数据维护与订阅 | 6 | tdx_download_file / tdx_refresh_cache / tdx_refresh_kline / tdx_hq_subscribed_list / tdx_subscribe_hq / tdx_unsubscribe_hq |
终端推送 | 4 | tdx_send_warn / tdx_send_message / tdx_send_file / tdx_send_bt_data |
模拟交易 | 6 | tdx_trade_account / tdx_query_asset / tdx_query_positions / tdx_query_orders / tdx_order_stock / tdx_cancel_order |
自动价格预警 | 5 | tdx_alert_add / tdx_alert_list / tdx_alert_remove / tdx_alert_history / tdx_alert_check_now |
完整接口签名与返回结构见 INTERFACE.md。
Related MCP server: akshare-mcp
前置条件
已安装支持 TQ 策略的通达信终端(金融终端/专业研究版/量化模拟版/期货通),安装目录如
D:\new_tdx_mockWindows Python(3.10+,建议 3.14)已安装依赖:
python -m pip install mcp pandas numpy终端已启动并登录(行情登录即可;交易工具需另登录交易)
快速开始(任意 MCP 客户端)
在 MCP 客户端配置中添加(路径按你的安装位置调整):
{
"mcpServers": {
"tdx-local": {
"command": "C:\\Python314\\python.exe",
"args": ["D:\\path\\to\\tdx-local-mcp\\run_server.py"],
"env": {
"TDX_ROOT": "D:\\new_tdx_mock",
"TDX_MCP_POLL_INTERVAL": "30"
}
}
}
}WSL 部署(openclaw)
WSL2 的 Linux Python 无法加载 Windows DLL(invalid ELF header),必须经 WSL interop 用 Windows Python 拉起:
{
"mcpServers": {
"tdx-local": {
"command": "/mnt/c/Python314/python.exe",
"args": ["D:/path/to/tdx-local-mcp/run_server.py"],
"env": {
"TDX_ROOT": "D:/new_tdx_mock",
"TDX_MCP_POLL_INTERVAL": "30"
}
}
}
}openclaw 插件部署(源码在 D 盘会被 777 world-writable 安全策略拦截,须复制到 WSL 原生目录):
bash deploy_openclaw.sh # 复制 4 个插件文件到 ~/.openclaw/extensions/tdx-local-mcp/
openclaw gateway restart # 重启网关加载环境变量
变量 | 默认值 | 说明 |
|
| 通达信安装目录(tqcenter.py 与 TPythClient.dll 所在) |
|
| 策略连接标识(多实例并存) |
|
| 预警引擎轮询间隔(秒,最小 5) |
| 项目根\alerts_rules.json | 预警规则持久化路径 |
| 项目根\alerts_log.jsonl | 预警触发历史路径 |
TDX_ROOT 必须指向终端实际运行目录——DLL 与终端经本机进程通信,路径不一致会连接失败。
数据规范
证券代码:
6位数字.市场后缀(600519.SH / 000001.SZ / 832566.BJ)价格单位元;成交量:快照=手、K线 Volume 列=股;成交额=万元
时间:YYYYMMDD 或 YYYYMMDDHHMMSS
复权:none / front / back(默认 front)
周期:1m/5m/10m/15m/30m/1h/1d/1w/1mon/45d/1q/1y;K线单次上限 24000 条
测试
python smoke_test.py # 冒烟:连接/K线/快照/板块/预警闭环/终端推送(14 项)
python mcp_client_test.py # MCP 协议端到端(8 项)
python consistency_check.py # 数据一致性(K线 vs .day 文件交叉比对)
python trade_test.py # 模拟交易全链路(须交易日交易时段)
wsl python3 wsl_e2e_test.py # WSL→Windows 跨系统 MCP 链路(在 WSL 中运行)官方 API 对齐
三层真源:官方文档(help.tdx.com.cn/quant/docs,语义基准)→ 本地 tqcenter.py(运行真源,参数透传以此为准)→ 49 个 MCP 工具(消费契约)。两源不一致处在工具 docstring 中以 ⚠️ 标注(本地版实测差异:快照最高最低键名为 Max/Min、get_trading_dates 需 market 参数、subscribe_hq 强制回调等)。
免责声明
本项目仅供学习研究。交易工具仅在通达信模拟交易环境验证;接入实盘风险自负,作者不承担任何资金损失责任。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server giving AI agents one-connection access to China A-share market intelligence: financials,
China A-share market data for research, backtesting and AI agents via MCP.
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceProvides AI clients access to TdxQuant/通达信 financial data and trading capabilities through MCP. Enables retrieval of market data, financial reports, sector information, and trading operations via stdio or HTTP/SSE connections.29-
- AlicenseBqualityCmaintenanceMCP server that wraps AKShare's 1000+ financial data functions, enabling LLMs to query Chinese stock, macro, futures, fund, bond, option, forex, and alternative data through standardized tools.143Apache 2.0
- AlicenseAqualityAmaintenanceEnables AI agents to operate a local financial terminal, including market data, backtesting, paper portfolio management, and news digest, through safe, gated tools over MCP.6MIT
- AlicenseNot gradedqualityAmaintenanceProvides read-only access to Chinese A-share stock market data such as quotes, K-lines, financials, capital flows, news, and research reports via a stdio MCP server for DeepSeek Harness and other MCP clients.GPL 3.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/adambbhe/TDX-local-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server