cftc-cot-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cftc-cot-mcp
An MCP server that exposes CFTC Commitments of Traders (COT) positioning as clean, agent-callable tools. Point any MCP client — Claude, a LangGraph app, an OpenAI Agents SDK app — at it and ask about managed-money positioning with no glue code.
Tools
Tool | Returns |
| Most recent weekly report: managed-money long/short/net, open interest, market, date. |
| A |
| Derived read over a lookback window: net, week-over-week change, min/max, percentile rank, z-score, extreme flag. |
Related MCP server: financial-trading-risk-aiops-assistant
Architecture
flowchart LR
H[MCP client / agent] -- stdio --> S[cftc-cot server]
S -- read-only --> D[(SQLite: COT table)]Stateless server: a read-only SQLite connection per call, DB path and table name from the environment, JSON out. Nothing is ever written.
Design decisions
Read-only by construction. The connection opens
mode=ro, so a tool cannot alter the source — a guarantee, not a convention.Config, not hardcoding.
COT_DB_PATHandCOT_TABLEcome from the environment; no deployment path lives in the code.Inputs validated and clamped. Dates are format-checked;
last_nandlookbackare bounded, so a bad argument can't scan the whole table.Table name whitelisted against
[A-Za-z_][A-Za-z0-9_]*before use.
Failure model
Failure | Behavior |
DB file missing |
|
Malformed date argument |
|
Invalid table name in config | Server refuses to start |
Empty table |
|
Quick start
git clone https://github.com/ajstehle2001/cftc-cot-mcp.git
cd cftc-cot-mcp
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # edit .env with your DB path
python test_client.py # spawns the server and exercises all 3 toolsUse it from an MCP client
{
"mcpServers": {
"cftc-cot": {
"command": "/abs/path/.venv/bin/python",
"args": ["/abs/path/server.py"],
"env": {
"COT_DB_PATH": "/abs/path/to/cot.db",
"COT_TABLE": "cot_history_combined"
}
}
}
}Data
COT is public data published weekly by the US CFTC. Expected columns:
report_date, mm_long, mm_short, mm_net, open_interest, market, fetched_at.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
CFTC Commitments of Traders data for every CFTC futures market: positions, history, COT index.
Read-only MCP access to nightly pairs trading cointegration statistics for compatible AI clients.
Weekly US CFTC Commitments of Traders legacy and disaggregated futures positioning over MCP.
51
Related MCP Servers
- AlicenseCqualityCmaintenanceEnables querying real-time and historical financial market data for stocks, options, forex, and crypto, including quotes, trades, technical indicators, and reference data through a set of MCP tools.713MIT
- AlicenseNot gradedqualityCmaintenanceProvides read-only MCP tools for market snapshots, position risk, order reconciliation, and daily report previews with deterministic financial calculations, evidence chains, and audit trails.MIT
- AlicenseBqualityBmaintenanceGive AI agents 17 read-only tools for dated exit-cost, depth and liquidity-tier research. Estimates, not executable quotes.16MIT
- AlicenseBqualityBmaintenanceEnables AI agents and trading desks to query institutional quantitative market telemetry, 100-bin auction profiles, order-book crowd sentiment, conformal volatility cones, macro session radar, and prop-risk metrics across 130+ global assets. It also renders interactive market-intelligence micro-app frames inside MCP-compatible chat clients.557 npm28 PyPIApache 2.0