Token导航 LogoToken导航TokenDH.com
Traderspost MCP logo
金融服务stdio官方级别未说明来源级核验

Traderspost MCP

MCP Server

一个为Claude提供TradersPost交易信号管理的MCP服务器,支持信号发送、策略配置查询、交易历史查询和持仓监控。

工具数

11

提示词数

0

GitHub Stars

0

资源数

0
PythonClaude金融数据Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

AdairBear

提供方

AdairBear

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

TradersPost MCP服务器

MCP(模型上下文协议) 允许Claude直接访问的服务器 TradersPost webhook交易。

发送交易信号、检查策略配置、查询交易历史和监控头寸——所有这些都不需要离开克劳德代码或克劳德桌面。

为什么存在: TradersPost没有公开完整的REST管理API。此MCP服务器封装了他们的webhook系统,并可选地封装了本地 prop_futures_relay 安装为Claude提供了一个完整的交易管理界面。

______________________________________________________________________

它做什么

11个涵盖完整交易流程的MCP工具:

类别工具
战略管理tp_list_strategies, tp_get_strategy, tp_toggle_strategy
信号提交tp_send_signal
交易历史(SQLite)tp_get_recent_trades, tp_get_fills, tp_get_trade_stats
职位状态tp_get_positions, tp_get_daily_pnl
健康监测tp_get_relay_health, tp_get_strategy_health

加上两个MCP资源:

  • traderspost://signal-format --webhook有效负载参考
  • traderspost://active-accounts --帐户配置摘要

______________________________________________________________________

模式

继电器模式(推荐)

RELAY_DIR 在当地 prop_futures_relay 安装。服务器读取 account_config.yaml,声明JSON文件,以及 trading_system.db 为了实现完整的功能。

独立模式

TP_WEBHOOK_ env变量直接。信号发送工作;策略管理和交易历史工具返回空结果。

______________________________________________________________________

安装

要求: Python 3.10+

git clone https://github.com/AdairBear/traderspost-mcp.git
cd traderspost-mcp
pip install -r requirements.txt

或者直接安装依赖项:

pip install "mcp[cli]" httpx pyyaml python-dotenv

______________________________________________________________________

配置

克劳德代码(.claude/settings.json)

中继模式 --使用本地prop_futures_relay安装:

{
  "mcpServers": {
    "traderspost": {
      "command": "python",
      "args": ["/path/to/traderspost-mcp/traderspost_mcp.py"],
      "env": {
        "RELAY_DIR": "/path/to/prop_futures_relay"
      }
    }
  }
}

独立模式 --仅限webhook URL:

{
  "mcpServers": {
    "traderspost": {
      "command": "python",
      "args": ["/path/to/traderspost-mcp/traderspost_mcp.py"],
      "env": {
        "TP_WEBHOOK_MY_STRATEGY": "https://traderspost.io/trading/webhook/...",
        "RELAY_URL": "https://relay.yourdomain.app"
      }
    }
  }
}

克劳德桌面(~/Library/Application Support/Claude/claude_desktop_config.json)

{
  "mcpServers": {
    "traderspost": {
      "command": "python",
      "args": ["/path/to/traderspost-mcp/traderspost_mcp.py"],
      "env": {
        "RELAY_DIR": "/path/to/prop_futures_relay"
      }
    }
  }
}

环境变量

变量必填描述
RELAY_DIR本地路径 prop_futures_relay 安装。启用策略配置、状态文件和SQLite访问。
TP_WEBHOOK_*是(按策略)TradersPost webhook URL。在中继模式下,策略 webhook_ref 字段命名这些。在独立模式下,使用 TP_WEBHOOK_.
RELAY_URL跑步接力的基本URL(例如。 https://relay.yourdomain.app).需要健康检查工具。

复制 .env.example.env 并填写您的值:

cp .env.example .env

服务器自动加载 .envRELAY_DIR 首先,然后从它自己的目录中。

______________________________________________________________________

工具参考

tp_list_strategies

列出所有已配置的策略及其状态、股票代码、帐户和webhook配置。

Returns: JSON with strategy list, account summary, and aliases.
Note: webhook URLs are never exposed — only whether they're configured.

tp_get_strategy

获取特定策略的完整配置,包括帐户规则和会话窗口。

Args:
  strategy (str): Strategy key, e.g. "sil_crusher_tradovate_44942793"

tp_toggle_strategy

在中启用或禁用策略 account_config.yaml.

Args:
  strategy (str): Full strategy key
  enabled (bool): True to enable, False to disable

Note: Modifies local config only — restart or redeploy the relay for changes to take effect.

tp_send_signal ⚠️

向TradersPost发送交易信号。 总是使用 test=True 第一。

Args:
  strategy (str): Strategy key (or standalone env var suffix)
  ticker (str):   Instrument — "MNQ", "SIL", "MGC", "ES", etc.
  action (str):   "buy", "sell", "exit", or "cancel"
  quantity (int): Number of contracts (default: 1)
  sentiment (str, optional): "bullish", "bearish", or "flat"
  order_type (str, optional): "market", "limit", or "stop"
  take_profit (float, optional): Take profit price level
  stop_loss (float, optional): Stop loss price level
  test (bool): True = dry-run (no execution). Default: False

tp_get_recent_trades

从SQLite查询最近的交易信号和TradersPost HTTP响应。

Args:
  limit (int): Max records 1-100, default 20
  strategy (str, optional): Filter by strategy
  account_id (str, optional): Filter by account
  days (int, optional): Lookback window in days

tp_get_fills

从填充表中查询实际填充数据(执行价格、滑点)。

Args: Same as tp_get_recent_trades

tp_get_trade_stats

汇总统计数据:信号成功率、滑点汇总、按策略细分。

Args:
  strategy (str, optional): Filter by strategy
  account_id (str, optional): Filter by account
  days (int): Lookback period, default 30

tp_get_positions

从中继状态JSON文件中获取当前位置状态,或回退到中继API。

Returns: Per-strategy state: FLAT / IN_POSITION / PENDING_ENTRY / PENDING_EXIT / HALTED

tp_get_daily_pnl

从继电器的每日损失跟踪器中获取今天的估计损益。

Returns: Per-account estimated P&L and remaining loss budget.
Note: Estimated from signals, not confirmed broker fills.

tp_get_relay_health

通过检查继电器健康状况 /health 终点。

Requires: RELAY_URL env var
Returns: Relay version, uptime, component status

tp_get_strategy_health

从运行中的继电器获取每个策略的状态(信号计数、最后信号时间、停止)。

Requires: RELAY_URL env var
Returns: Per-strategy status from /health/strategies

______________________________________________________________________

用法示例

检查配置内容

"Show me all configured strategies and which ones have webhooks set up"
→ Claude calls tp_list_strategies()

空转信号

"Send a test buy signal for SIL, 1 contract, to the sil_crusher_tradovate_44942793 strategy"
→ Claude calls tp_send_signal(strategy="sil_crusher_tradovate_44942793", ticker="SIL",
    action="buy", quantity=1, test=True)

监测性能

"How many signals has sil_crusher sent this week and what's the success rate?"
→ Claude calls tp_get_trade_stats(strategy="sil_crusher_tradovate_44942793", days=7)

紧急禁用

"Disable the MNQ strategy immediately"
→ Claude calls tp_toggle_strategy(strategy="coord_mnq_gmr_tradovate_44942793", enabled=False)

检查位置和P&L

"What positions are currently open and what's today's P&L?"
→ Claude calls tp_get_positions() and tp_get_daily_pnl()

______________________________________________________________________

安全须知

  • Webhook URL是从环境变量中读取的 从不 出现在工具响应或日志中
  • tp_send_signal 已标记 destructiveHint: true --克劳德在打电话之前会确认的
  • test=True 返回TradersPost交易计划,不执行任何订单——先使用它
  • tp_toggle_strategy 仅修改本地配置——运行中的中继在重新部署之前不受影响

______________________________________________________________________

建筑

Claude (MCP client)
    ↓ stdio
traderspost_mcp.py (MCP server)
    ├── account_config.yaml   (strategy config — RELAY_DIR mode)
    ├── data/state/*.json     (position state — RELAY_DIR mode)
    ├── trading_system.db     (trade history — RELAY_DIR mode)
    ├── TP_WEBHOOK_* env vars (webhook URLs — always)
    └── RELAY_URL/health      (live relay status — optional)
         ↓ httpx POST
    TradersPost webhook
         ↓
    Broker (Tradovate, etc.)

______________________________________________________________________

需求

  • Python 3.10+
  • mcp[cli] >=1.0(快速MCP)
  • httpx >= 0.24
  • pyyaml >= 6.0
  • python-dotenv >=1.0(可选,用于.env自动加载)

______________________________________________________________________

许可证

麻省理工学院——见 许可证.

目录标签

目录标签

PythonClaude金融数据交易信号本地部署策略管理交易历史持仓监控金融工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

11

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP