Capital.com MCP Server for Amazon Q and other LLMs
Project description
Capital.com MCP Server
This is a Model Context Protocol (MCP) server that exposes the Capital.com trading API as tools that can be used by Amazon Q, Claude Desktop, and other LLMs that support the MCP protocol.
Available Tools
The following tools are exposed by the MCP server:
authenticate: Authenticate with Capital.com APIget_account_info: Get account informationsearch_markets: Search for markets (e.g., EURUSD, AAPL)get_prices: Get prices for a specific instrumentget_positions: Get all open positionscreate_position: Create a new trading positionclose_position: Close an open positionupdate_position: Update an existing position (stop loss, take profit)get_watchlists: Get all watchlists
Configuration
Required Environment Variables
The MCP server requires the following environment variables:
CAPITAL_BASE_URL: The Capital.com API base URL (e.g.,https://demo-api-capital.backend-capital.com)CAPITAL_API_KEY: Your Capital.com API keyCAPITAL_PASSWORD: Your Capital.com passwordCAPITAL_IDENTIFIER: Your Capital.com email/identifier
Optional Environment Variables
CAPITAL_MCP_DEBUG: Set to1to enable debug loggingFASTMCP_LOG_LEVEL: Set toDEBUG,INFO,WARNING,ERROR, orCRITICALto control logging level
Running Manually
You can run the MCP server manually with various options:
capital-com-mcp --help
Available options:
--sse: Use SSE transport--port PORT: Port to run the server on (default: 8080)--debug: Enable debug logging--log-dir LOG_DIR: Directory to store log files
Example Usage
Searching for Markets
You: Search for Apple stock on Capital.com
AI: I'll search for Apple stock on Capital.com for you.
[Uses capital-com-mcp-server___search_markets tool]
I found Apple Inc. (AAPL) on Capital.com. Here are the details:
- Epic: AAPL
- Market name: Apple Inc.
- Current bid price: $184.25
- Current ask price: $184.30
- Market status: OPEN
Getting Account Information
You: What's my account balance on Capital.com?
AI: Let me check your Capital.com account information.
[Uses capital-com-mcp-server___get_account_info tool]
Your Capital.com account information:
- Account ID: ABC123456
- Account type: Demo
- Currency: USD
- Balance: $10,000.00
- Available funds: $9,500.00
- Margin used: $500.00
Creating a Position
You: Buy 10 shares of Apple stock
AI: I'll create a buy position for Apple stock on Capital.com.
[Uses capital-com-mcp-server___create_position tool]
Successfully created a BUY position for Apple Inc. (AAPL):
- Deal ID: DEF789012
- Size: 10 shares
- Opening price: $184.30
- Position status: OPEN
Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file capital_com_mcp_server-0.1.7.tar.gz.
File metadata
- Download URL: capital_com_mcp_server-0.1.7.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
131260d6be9cc2fd80a8963b3e09cc7206b6d408a66d4063c1c5761c35a4a27f
|
|
| MD5 |
6bb76803fe065b9a3d08e901322fe388
|
|
| BLAKE2b-256 |
0a07970f87be862102db9d8fb80dbdb7802f1d1477f5fdc162f792046501a8bb
|
Provenance
The following attestation bundles were made for capital_com_mcp_server-0.1.7.tar.gz:
Publisher:
python-publish.yml on syedair/mcp-servers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
capital_com_mcp_server-0.1.7.tar.gz -
Subject digest:
131260d6be9cc2fd80a8963b3e09cc7206b6d408a66d4063c1c5761c35a4a27f - Sigstore transparency entry: 207510838
- Sigstore integration time:
-
Permalink:
syedair/mcp-servers@b82109069e3b342f529c2cc264ea43da7210c5ce -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/syedair
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b82109069e3b342f529c2cc264ea43da7210c5ce -
Trigger Event:
release
-
Statement type:
File details
Details for the file capital_com_mcp_server-0.1.7-py3-none-any.whl.
File metadata
- Download URL: capital_com_mcp_server-0.1.7-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4405c9971669c470a1e92da97c2becfbc0804ff9445ee6f73f860090fba70ca
|
|
| MD5 |
16094098f90379b86b951611a7c60049
|
|
| BLAKE2b-256 |
eec3ef3ed7b196fb0d650fbb9ad08e55f8517598b462e0eebbfd88396fad6585
|
Provenance
The following attestation bundles were made for capital_com_mcp_server-0.1.7-py3-none-any.whl:
Publisher:
python-publish.yml on syedair/mcp-servers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
capital_com_mcp_server-0.1.7-py3-none-any.whl -
Subject digest:
f4405c9971669c470a1e92da97c2becfbc0804ff9445ee6f73f860090fba70ca - Sigstore transparency entry: 207510840
- Sigstore integration time:
-
Permalink:
syedair/mcp-servers@b82109069e3b342f529c2cc264ea43da7210c5ce -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/syedair
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b82109069e3b342f529c2cc264ea43da7210c5ce -
Trigger Event:
release
-
Statement type: