The Capital.com MCP Server connects your AI interface to your trading account. Market data, positions and trade previews are available in plain language, with your confirmation required for every trade. It's free, open source, and runs locally on your computer.
What you'll need
- A Capital.com account
- Your Capital.com API key
- Your custom API password
- 2FA enabled
Note: you can manage the above from inside your account settings.
Mobile is not currently supported.
How to connect
Tell your AI to use the setup skill (Recommended)
Works with Claude Code, Cursor, Windsurf and Codex. Your AI does the installing; you only create the key.
-
Ask your AI.
-
Copy the prompt for your tool:
Claude
Set up the Capital.com MCP server using https://github.com/capital-com-sv/capital-mcp/blob/main/INSTALL.md and make sure to use the mcpb fileCursor, Codex (OpenAI), Windsurf and other tools
Set up the Capital.com MCP server using https://github.com/capital-com-sv/capital-mcp/blob/main/INSTALL.md - Your AI installs the MCP server and tells you when it needs your API key.
-
-
Create your API key.
- Log in to Capital.com and make sure 2FA is enabled.
- Go to Settings → API integrations → Generate API key.
- Set a label and a custom API password. This is a new password just for the API, not your login password.
- Enter your 2FA code, then copy the key and the password. Both are shown only once. Keep them private.
- Enter them where your AI tells you to. Never paste your API key or password into the chat.
-
Try it.
- Ask:
Using Capital.com MCP, preview my accounts.
- Ask:
Use the Claude Desktop bundle (No terminal needed)
-
Download the MCP server.
- Go to github.com/capital-com-sv/capital-mcp.
- Select the green Code button → Download ZIP.
- Unzip the downloaded file.
-
Open the MCPB bundle.
- In the downloaded folder, double-click capital-mcp.mcpb, or drag it into Claude Desktop.
-
Create your API key.
- See the steps above.
-
Enter your credentials.
- Enter them in the install screen, select Install, and enable the MCP.
-
Try it.
- Fully quit and reopen Claude Desktop.
- Ask:
Using Capital.com MCP, preview my accounts.
Install from the Cursor Marketplace (Requires Docker)
Before you start, install Docker on your computer. You also need Cursor 3.4.0 or later.
- Open the Cursor Marketplace.
- Select Install.
-
Configure your API key and details.
- Enter your API key, API password and Capital.com login email when Cursor asks for them.
- Choose demo or live. Demo is the default.
- No API key yet? Follow Create your API key above.
-
Use Capital.com MCP.
- Ask:
Using Capital.com MCP, preview my accounts.
- Ask:
Any other MCP-compatible client: follow the setup guide on GitHub.
Watch the setup
FAQ
The MCP Server is software that runs in the background on your computer. It acts as a secure bridge between your AI interface and your Capital.com account.
Once connected, your AI interface can:
- Search available markets across forex, shares, commodities and indices
- Show your open positions, working orders and account balance
- Pull historical prices and other market data
- Preview and place trades – with your confirmation required every time
You remain fully responsible for any trading decisions made using the MCP Server. Always review trade previews carefully before confirming.
Every trade through the MCP Server follows 3 mandatory steps. The server enforces this – you can't skip ahead.
-
Preview
Ask your AI interface to preview a trade:
Preview buying 1.5 SILVER with stop at 24.50The AI interface returns a full trade proposal and a unique
preview_id. Read every detail before you proceed. -
Review
Before confirming, check:
- Is the instrument correct? (Codes are case-sensitive: SILVER not silver)
- Is the position size what you intended?
- Are the stop and limit levels correct?
- Does the risk look right for your account size?
If anything looks wrong, stop. Ask for a new preview with corrected parameters.
-
Confirm
Only send this if you're satisfied with the preview:
Execute position with preview_id abc123 confirm=trueA trade can't be placed without a valid
preview_id. Each ID can only be used once and expires after execution.
Complete this checklist first:
- The test prompt at the end of your setup returned your accounts
- You've successfully previewed and confirmed at least one trade in demo mode
- You understand what each field in the trade preview means
- You've changed
CAP_ENVto live intentionally, andCAP_ALLOW_TRADINGis set the way you want (it's true by default) - You've read Capital.com's Terms and Conditions and Electronic Trading Terms
To restrict which markets the server can trade, add instrument codes to CAP_ALLOWED_EPICS (for example: SILVER,GOLD,EURUSD). Set it to ALL (the default) to allow all markets on your account.
Check your account
Login to my accountList my accountsCheck my Capital.com connection health
Research markets
Search for bitcoin marketsShow me EURUSD market detailsGet 1-hour historical prices for GOLD
Review your portfolio
Show my open positionsList my working ordersReview my portfolio exposure
Place a trade (demo mode first)
Preview buying 1.5 SILVER with stop at 24.50Create a trade proposal for GOLD with 1% riskExecute position with preview_id abc-123 confirm=trueClose position DEAL_ID confirm=true
Run the health check first. Ask your AI interface: Check my Capital.com connection health. The response will usually tell you what's wrong.
| What you see | Most likely cause | Fix |
|---|---|---|
| "Authentication failed" or "Session expired" |
CAP_API_PASSWORD is set to your login password instead of the custom API password you created with your API key |
Use the password you created during API key generation, not your website login password |
| "Rate limit exceeded" | Too many requests sent quickly | Wait 30–60 seconds and try again |
| No response to any prompt | Config file not saved or AI interface not fully restarted | Fully quit and reopen your AI interface – don't just close the window |
| "401 Unauthorized" | API key expired or revoked | Go to Settings → API Integrations in Capital.com and generate a new key |
| "Environment mismatch" |
CAP_ENV set to live but credentials are for a demo account |
Update CAP_ENV in your config file to match your account type |
Still stuck? Submit a support request and include: which AI interface you're using, your operating system, and the full error message.
Some AI interfaces require a paid subscription to use MCP features. Claude Desktop, for example, requires a paid plan to enable MCP connectors. The Capital.com MCP Server itself is free.
No. The server works with a demo account and that's where we recommend you start.
No. These are separate. CAP_API_PASSWORD is a new password you create specifically when generating your API key. Using your login password here will cause authentication to fail.
No. Every trade requires a preview step followed by a separate confirmation message containing confirm=true. The server can't execute a trade without both. The preview ID is single-use and expires immediately after execution.
It's a safety switch, and it's set to true by default. When set to false, the server can show you market data and account information but can't place any trades. Set it to false if you want a read-only connection.
It limits which instruments the server can trade. ALL (the default) allows all markets on your account. Add a comma-separated list (for example: SILVER,GOLD,EURUSD) to restrict it. Leaving it empty is not the same as ALL: with trading enabled, the server won't start.
The server runs locally on your computer. Your credentials are stored in your local config file only and are never sent to third parties. All communication with Capital.com uses HTTPS encryption.
Yes. Repeat the setup on the second machine using the same API credentials.
The server connects to one account at a time. To switch, update the 4 CAP_ values in your config file and restart your AI interface.
If you set it up manually
Ask your AI interface: Check my Capital.com connection health. The most common causes are a formatting error in the JSON config, or the Python path pointing to system Python instead of the venv folder.
| What you see | Most likely cause | Fix |
|---|---|---|
zsh: event not found (Mac only) |
Your API password contains an exclamation mark (!) | Wrap the password value in single quotes in the config: 'yourPassword!Here'
|
| "Server not responding" / server won't start | Wrong Python path or server didn't install correctly | Open Terminal and run python -m capital_mcp.server directly – the error message will be readable |
| Fewer tools than expected showing | Server started but config has an error | Check: (1) all placeholders replaced with real values, (2) no missing " { } , characters, (3) Python path points to the venv folder, not system Python |
Disclaimer – Use of Capital.com Public API with Third-Party Tools
Third-Party Integration
This page describes how clients may connect the Capital.com Public API to third-party software, tools, or integrations, including those powered by artificial intelligence or large language models ('LLMs'). Any such third-party software, tool, or integration is independent of Capital.com and does not form part of Capital.com's services. Capital.com does not control, develop, endorse, or accept any liability for any third-party software, its functionality, outputs, or any outcomes arising from its use. Any use of third-party tools or integrations in connection with the Capital.com Public API is entirely at your own risk. You are responsible for reviewing the terms, privacy policies, and data-handling practices of any third-party tool you choose to use.
Use of the Public API
Your use of the Capital.com Public API is entirely at your own discretion and risk. Capital.com makes the Public API available for informational and trading purposes but does not recommend, endorse, or encourage any particular use, integration, or trading strategy. You are solely responsible for how you access and use the API, including the parameters of any orders submitted, the configuration of any connected tools or systems, and the interpretation of any data received. Capital.com accepts no liability for losses or unintended outcomes arising from your use of the API, whether accessed directly or through third-party tools. API availability, functionality, and specifications may be modified, rate-limited, suspended, or discontinued at any time without prior notice. Your use of the Public API is subject to Capital.com's Terms and Conditions and Electronic Trading Terms, which you should read carefully before using the API.
Execution-Only Service and No Investment Advice
Capital.com provides its services on an execution-only basis. Trading financial instruments involves significant risk of loss. Nothing on this page, in the Public API, or in any third-party software or integration constitutes investment advice, a personal recommendation, or a solicitation to buy or sell any financial instrument. This includes any output, signal, suggestion, or analysis generated by AI, LLM-based, or other automated tools. All trading decisions, including any automated or algorithmic activity, are made at your own risk and remain your sole responsibility. Capital.com does not control the outputs of third-party AI or LLM-based tools connected to the Public API and cannot guarantee that such tools will not generate content that could be construed as investment advice or a personal recommendation. Any such output is not provided by or on behalf of Capital.com and should not be relied upon as advice.
Risks of Automated and Algorithmic Trading
Use of the Public API in connection with automated or algorithmic trading tools carries additional risks, including but not limited to: rapid execution of orders without human review or intervention; system errors, software failures, or connectivity issues; execution at prices materially different from those expected; and unintended or erroneous orders resulting from misconfigured tools or parameters. Capital.com is not responsible for any losses arising from such risks or from the interaction between its systems and any third-party tools. Past performance and any outputs generated by automated tools are not indicative of future results.
Where AI or LLM-based tools are used to retrieve market data or pricing information, there may be a delay between the price communicated by the tool and the price at which any resulting order is executed. All orders placed through the Public API are executed as market orders. The execution price may therefore differ from any price displayed at the time of a request. Capital.com seeks to achieve best execution in accordance with its obligations; we do not accept liability for price differences arising from latency attributable to third-party tools or systems outside its control.
Prohibited Use
Use of the Public API and any connected tools must not be used to manipulate the Capital.com platform, exploit pricing or latency, engage in market abuse, or obtain any unfair advantage. Capital.com reserves the right to restrict, suspend, or terminate API access and/or your account where it reasonably considers that such misuse has occurred or is likely to occur. Clients must not permit any third party to exercise discretionary control over their account.
Your Responsibilities
You are responsible for ensuring that your use of the Capital.com platform, the Public API, and any third-party tools or integrations complies with Capital.com's Terms and Conditions, Electronic Trading Terms, and all applicable laws and regulations in your jurisdiction. You should carefully consider whether automated trading tools are appropriate for your circumstances, experience, and risk tolerance before using them. Capital.com strongly recommends that you test any automated tools or integrations thoroughly using a Demo account before connecting them to a live trading environment.