IG Trading MCP
This server provides a local Python MCP interface to IG's REST Trading API, enabling account management, market data retrieval, historical prices, and guarded trade execution for positions and working orders.
Account & History
List accounts, get account preferences, retrieve activity history (date range, optional detail), and retrieve transaction history (by type and date range).
Market Data
Search markets by name/symbol, get detailed market info (including dealing rules, snapshot, and instrument data), fetch historical OHLC prices (with persistent caching for UTC date ranges), list instrument categories, and list instruments within a category.
Positions
List all open positions, get a specific position by deal ID, create/update/close OTC positions.
Working Orders
List open working orders, create/update/cancel OTC working orders.
Trade Confirmations
Retrieve the confirmation of a submitted deal using its deal reference.
Safety & Caching
All trade/order mutation tools require
confirm: true; live environments also requirelive_confirmation: "LIVE_TRADE_CONFIRMED".Trading-sensitive data (positions, snapshots, orders, confirmations) is never cached, and credentials are never stored. Non-sensitive data is cached to reduce API usage.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@IG Trading MCPshow my open positions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
IG Trading MCP
A local Python MCP server for IG's REST Trading API. It provides account/history, market data, position, working-order, and trade-confirmation tools, plus guarded OTC trade actions. This project is not affiliated with, endorsed by, or sponsored by IG Group.
Trading leveraged products can result in losses exceeding deposits. Start with an IG demo account.
Setup
Create a demo or live IG API key in the IG trading platform.
Copy
.env.exampleto.envand set the values, or export the same variables in the MCP client's environment.Install and run with
uv:
uv sync
uv run ig-mcpRequired environment variables:
Variable | Description |
| API key generated for the selected IG environment. |
| IG login identifier. |
| IG login password. |
|
|
| Optional active account ID. IG's login-selected account is used when omitted. |
The server keeps OAuth tokens in memory only. It sends credentials to IG only during login and never returns tokens from tools.
Related MCP server: IBKR MCP
API Call Cache
Persistent caching is enabled by default to reduce IG API usage. Cached data is stored in ~/.cache/ig-mcp/cache.sqlite3; set IG_CACHE_PATH to use another location or IG_CACHE_ENABLED=false to disable cache reads and writes.
The server caches categories for 6 hours, category instruments for 1 hour, market searches for 10 minutes, and activity/transaction history for 5 minutes. A successful trade or working-order change invalidates cached activity and transactions for the active account.
Trading-sensitive data is never cached: account details, market snapshots, positions, working orders, confirmations, and all write operations. OAuth tokens, API keys, passwords, and HTTP headers are never written to the cache.
Historical price requests use a persistent candle cache. Request an explicit UTC range and the server calls IG only for periods that are not already covered. The current, potentially incomplete candle is refreshed after one minute.
ig_get_historical_prices(
epic="CS.D.EURUSD.CFD.IP",
resolution="MINUTE",
from_date="2026-08-01T00:00:00Z",
to_date="2026-08-01T12:00:00Z",
)MCP Client Configuration
Example configuration for a local stdio-capable MCP client:
{
"mcpServers": {
"ig": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/ig-integration-mcp", "run", "ig-mcp"],
"env": {
"IG_API_KEY": "your-demo-key",
"IG_IDENTIFIER": "your-identifier",
"IG_PASSWORD": "your-password",
"IG_ENVIRONMENT": "demo"
}
}
}
}Trade Safety
All tools that create, update, close, or cancel a trade/order require confirm: true.
When IG_ENVIRONMENT=live, they additionally require this exact parameter:
{"live_confirmation": "LIVE_TRADE_CONFIRMED"}Use ig_get_market to inspect a market's dealing rules before submitting an order. Trade tools validate the main IG field dependencies before making API calls, but IG remains the authority for account-specific eligibility, sizes, and price rules.
Testing
uv run pytestTests mock all IG API traffic and do not need credentials.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseCqualityCmaintenanceAn MCP server that provides an interface for the Interactive Brokers API via the ib_async library. It enables users to manage accounts, access real-time and historical market data, and execute or monitor trades through TWS or IB Gateway.Last updated331
- FlicenseBqualityCmaintenanceMCP server for Interactive Brokers via IB Gateway, enabling read access to account data and trading capabilities for paper accounts.Last updated11
- AlicenseBqualityCmaintenanceA read-only-by-default MCP server for Interactive Brokers that exposes account, positions, PnL, market data, and trade history from a local TWS/IB Gateway session, with optional trading capabilities.Last updated15MIT
- Alicense-qualityBmaintenanceMCP server for the Oanda v20 REST API enabling forex/CFD trading account management, market data retrieval, and order/trade operations with a read-first design and practice environment by default.Last updated1MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarkHorwell/ig-integration-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server