SuperAPI AI Directory

capitalcom-mcp-server

Unofficial Capital.com Open API integration: market data and guarded trading with preview-and-confirm trades, allowlists and demo-first defaults.

Open website

About this tool

capitalcom-mcp-server is a self-hosted Model Context Protocol (MCP) server that wraps the Capital.com Open API, written in Python based on FastMCP. The project is positioned as "secure, guarded LLM trading"—through mechanisms such as two-phase execution, allow lists, and demo-account-first, it provides trading capabilities in the form of 42 tools to various MCP clients, supporting stdio or HTTP transport, built on the tested capitalcom-cli brokerage engine (SDK). The project is explicitly marked as unofficial, for educational purposes, not affiliated with Capital.com, trading carries risk and does not constitute financial advice, and it is licensed under Apache-2.0.

Purpose and applicable scenarios: This project is aimed at users who want to access Capital.com market data and conduct controlled trading through MCP clients (such as Claude Desktop, Claude Code, Cursor, VS Code Copilot, Windsurf, ChatGPT, etc.). It emphasizes secure defaults: trading is disabled by default, all trades are two-phase (preview → confirm → execute), and it requires allow lists and quantity/frequency limits, and recommends starting on a demo account.

Main capabilities: The server exposes 42 tools, 4 resources, and 7 guided prompts. Except for the two read-only adapters for ChatGPT Deep Research (search, fetch), all tool names are prefixed with cap_. Coverage includes sessions and accounts, trading (read → preview → execute → manage), streaming data (WebSocket, requires CAP_WS_ENABLED=true), and ChatGPT Deep Research adapters. Prompts are reusable workflows that clients can launch by name; they only output step-by-step guidance to orchestrate the above tools and do not initiate trades themselves.

Security and trading controls: Trading is disabled unless CAP_ALLOW_TRADING=true and the EPIC is in CAP_ALLOWED_EPICS (or ALL). Two-phase execution, and change-type tools require confirm=true. Quantity, open position, and daily order caps are in place; CAP_DRY_RUN=true blocks allexecution. Of particular note is that the TIMEOUT confirmation result is ambiguous—reconciliation should be performed rather than blindly retrying.

Installation and usage: No cloning is required; uvx runs in an isolated temporary environment and always fetches the latest tested version; pipx can also be used to install a persistent command. For production or real-money use, it is recommended to pin an exact version (for example, uvx capitalcom-mcp==0.3.4 run …) and upgrade carefully after reading the CHANGELOG. First use requires obtaining API keys in the Capital.com app (Settings → API integrations) (it is recommended to create demo keys first), then running the wizard to generate a credentials file (written to ~/.config/capital-mcp/.env, permissions 0600); the wizard prints the exact client configuration snippet. You can also point CAP_API_KEY_CMD / CAP_IDENTIFIER_CMD / CAP_API_PASSWORD_CMD to commands that print secrets (such as op read, pass); secrets are fetched at startup and are not written to disk or client configuration.

Client configuration: Each client uses the same command / args / env structure. You can write "CAP_ENV_FILE": "<path output by init>" into the configuration to keep secrets out of client files, or put CAP_API_KEY / CAP_IDENTIFIER / CAP_API_PASSWORD directly in env. The documentation provides path examples for Claude Desktop (claude_desktop_config.json), Cursor (~/.cursor/mcp.json or .cursor/mcp.json), VS Code Copilot (.vscode/mcp.json, with the root key servers and type: "stdio"), Windsurf (~/.codeium/windsurf/mcp_config.json), etc. ChatGPT requires a remote server (stdio is not supported); after making it reachable via HTTPS, add it in Developer Mode (Settings → Connectors → Advanced) at /mcthe server URL ending in p; the ChatGPT Deep Research connector will call two read-only tools, search and fetch; full custom tools require Developer Mode.

Remote / VPS hosting: it can be run using streamable-HTTP instead of stdio, or via environment variables (CAP_MCP_TRANSPORT=http, CAP_MCP_HOST, CAP_MCP_PORT, suitable for systemd). Any public use should be placed behind a reverse proxy that terminates TLS.

Testing and contributing: end-to-end tests drive every tool through MCP against the demo API (read, watchlist, account switching, preview/execute/modify/close/cancel, streaming), will place real simulated orders and clean up after themselves, so a simulated .env with trading and streaming enabled should be used. The project welcomes community contributions and provides CONTRIBUTING.md, good first issues, a roadmap, and architecture and "adding a tool" examples in docs/extending.md.

Limitations and risks: the project is unofficial and not affiliated with Capital.com; trading involves risk and does not constitute financial advice; trading is disabled by default and must be explicitly enabled and satisfy the allowlist; there are limits on quantity, positions, and daily orders; CAP_DRY_RUN can prevent execution; TIMEOUT confirmation results require manual reconciliation rather than retrying. The materials do not provide a specific tool list, prompt names, complete examples for each client configuration, pricing information, or performance data.