ibkr_headless_mcp

johnlam1968/ibkr_headless_mcp

3.2

If you are the rightful owner of ibkr_headless_mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The IBKR Headless MCP Server is designed for market analysis using Interactive Brokers market data and external LLMs, operating independently of IBKR TWS/gateway.

Tools
4
Resources
0
Prompts
0

A IBKR Headless MCP Server with little codes

This project provides an MCP (Model Context Protocol) server and tools for Interactive Brokers (IBKR) via ibind library.

Using ibind's oauth feature, this headless application runs independent of a IBKR TWS/gateway or helper java program.

Features

Minimal codes: a LLM agent parses the documentation and uses the get method to retrieve information for an end user interactively.

Writing hard codes to call API will eventually become largely redundant because AI could figure it out in runtime. The target API documentation per se is the code.

Prerequisites

  1. IBKR Account: Paper/live trading account with API access enabled.
  2. **oauth files stored in local folder. Refer to https://github.com/Voyz/ibind/wiki/OAuth-1.0a

Quick Setup

# Install dependencies
pip install -r requirements.txt

# Create .env with following lines
IBIND_USE_OAUTH=True
IBIND_OAUTH1A_CONSUMER_KEY=""
IBIND_OAUTH1A_ENCRYPTION_KEY_FP="path-to/private_encryption.pem"
IBIND_OAUTH1A_SIGNATURE_KEY_FP="path-to/private_signature.pem"
IBIND_OAUTH1A_ACCESS_TOKEN=""
IBIND_OAUTH1A_ACCESS_TOKEN_SECRET=""
IBIND_OAUTH1A_DH_PRIME='prime_hex'

## Reference
https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/#endpoints