ibkr
MCP Server for IBKR Client
claude mcp add --transport stdio seriallazer-ibkr-mcp-server python -m uvicorn app.main:app --reload
How to use
This MCP server is a FastAPI application that interfaces with the Interactive Brokers (IBKR) API to fetch portfolio details. Once running, you can access the automatically generated API docs at http://localhost:8000/docs, where you’ll find endpoints related to portfolio data. The server exposes an endpoint that retrieves current portfolio information via the IBKR integration, and it’s designed to be invoked by MCP tooling or any client that can call HTTP APIs. Typical usage involves starting the server locally or in your environment and then querying the portfolio endpoints to obtain holdings, positions, and value metrics.
Tools and capabilities include:
- An API endpoint to fetch portfolio details from IBKR using the configured credentials in your environment.
- Automatic OpenAPI docs and interactive Swagger UI for exploring available endpoints and response schemas.
- A FastAPI-based structure that allows easy extension if you need additional IBKR-related data (e.g., positions by account, unrealized P&L, or margin details).
To use, ensure your environment is pointed to IBKR with valid credentials (see Setup Instructions) and call the exposed HTTP endpoints from your MCP workflow or any HTTP client.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Access to IBKR API credentials (IBKR account with API enabled)
- Network access to IBKR endpoints from the host running this server
Install steps:
-
Clone the repository and navigate into it: git clone <repository-url> cd ibkr-mcp-server
-
Create and activate a virtual environment: python -m venv venv
macOS/Linux
source venv/bin/activate
Windows
venv\Scripts\activate
-
Install dependencies: pip install -r requirements.txt
-
Configure environment variables:
- Create a .env file in the project root and add your IBKR API credentials as required by the application (e.g., IBKR_API_KEY, IBKR_API_SECRET, IBKR_CLIENT_ID, etc.).
- Example (adjust to actual env vars used by the app): IBKR_API_KEY=your_key IBKR_API_SECRET=your_secret IBKR_CLIENT_ID=your_client_id
-
Run the application: uvicorn app.main:app --reload
If you prefixed with the MCP runtime command, use the equivalent as defined in mcp_config.
-
Verify the server is running by visiting http://localhost:8000/docs for the API docs.
Additional notes
Notes and tips:
- Ensure your IBKR credentials are stored securely and not committed to version control.
- If you switch environments (dev, staging, prod), keep separate .env configurations or use a secrets manager.
- The OpenAPI docs at /docs will help you discover available endpoints and their request/response schemas.
- If you encounter connectivity issues with IBKR, verify network access and that any required IBKR API services are reachable from your host.
- You can customize the port or reload behavior by adjusting the uvicorn startup options in the mcp_config or your local startup script.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP