kite-connect-mcp
Integrates with the Zerodha Kite Connect v3 API to let AI assistants read account data, market data, holdings, positions, margins, orders, trades, GTTs, alerts, mutual funds, and the WebSocket ticker, and to place or manage orders and GTTs with configurable dry-run and safety controls.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
kite-connect-mcp
A self-hostable Model Context Protocol server for the Zerodha Kite Connect v3 API. Run it on your own machine or server with your own Kite Connect app, and let an AI assistant read your account, market data and orders. Every write is a dry run by default.
Status: alpha, under active development. The core (HTTP client, token store, safety pipeline, order tools) is in place and tested. The remaining tool groups are being added; see CHANGELOG.md. This is not affiliated with or endorsed by Zerodha.
Why another Kite MCP server?
Zerodha publishes an official server (zerodha/kite-mcp-server) and
hosts it at mcp.kite.trade. This project differs in three ways:
It covers the whole paid Kite Connect API. That includes alerts, GTTs, order and basket margins, charges, position conversion, holdings authorisation, auctions, mutual funds and the WebSocket ticker.
It's built for one person self-hosting. The daily token is persisted and shared by every client you connect.
It has a safety layer for orders: dry runs, two-step confirmation, value caps, allow-lists, a kill switch, an audit log and rate limiting.
The full evaluation and reasoning are in docs/DECISION.md.
Related MCP server: Kite MCP Server
What you need
A Zerodha account, and a Kite Connect app from the developer console.
Connect (paid, ₹500/month per app) includes live quotes, the WebSocket and historical candles.
Personal (free) covers orders, GTTs, alerts, portfolio and margins, but no market data. Market-data tools return a clear "needs the paid plan" error.
Python 3.11+ (or Docker).
To place live orders: the order requests must come from a static IP registered in the developer console. This is a SEBI/NSE rule, in force since April 2026. Reads work from any IP.
The developer-console steps are in docs/KITE_SETUP.md: creating the app, the API key and secret, the redirect and postback URLs, the subscription, and the static IP.
Quick start (local, stdio)
# install (from GitHub; no PyPI release yet)
uv tool install git+https://github.com/techfreakworm/kite-connect-mcp
# or: pipx install git+https://github.com/techfreakworm/kite-connect-mcp
# configure: credentials from env vars or files (mode 600)
export KITE_API_KEY=your_api_key
export KITE_API_SECRET_FILE=~/.config/kite-connect-mcp/api_secret
kite-connect-mcp check-config # validates settings, never prints credentials
kite-connect-mcp login # prints the Kite login link (managed mode)
kite-connect-mcp status # session and safety statusAdd it to an MCP client, e.g. Claude Desktop (claude_desktop_config.json) or any client that launches stdio servers:
{
"mcpServers": {
"kite": {
"command": "kite-connect-mcp",
"args": ["serve"],
"env": { "KITE_API_KEY": "your_api_key", "KITE_API_SECRET_FILE": "/home/you/.config/kite-connect-mcp/api_secret" }
}
}
}To run it on a server over HTTP, see docs/SELF_HOSTING.md. It covers systemd and Docker, a reverse proxy with TLS, bearer-token auth, and the login callback.
The safety model, in short
Guard | Default |
Every write tool takes |
|
Live trading switch | off ( |
Confirmation | a live write needs the single-use |
Value caps | ₹10,000 per order, ₹50,000 per day, 20 live orders per day |
Allow-lists | instruments, exchanges, products, varieties, order types, sides (all optional) |
Read-only mode |
|
Kill switch | a file; a tool can switch it on, only a person can switch it off |
Audit log | every dry run, refusal, live send and result, as JSON lines; the intent is fsynced before sending |
Rate limits | kept under Kite's 1/s (quotes), 3/s (historical), 10/s (orders and the rest), 400 orders/min |
Retries | reads back off and retry; writes are never retried. A timeout is reported as "outcome unknown: check the order book" |
Details: docs/SAFETY.md.
Sessions and the daily login
Kite access tokens expire every day at about 06:00 IST. A request token is single-use. Logging in again with the same API key invalidates the previous access token. So one app should have exactly one program that owns the daily login.
managedmode (default). This server owns the login. Thelogintool (orkite-connect-mcp login) gives you the link. Kite redirects to this server's/callback, which checks the one-timestate, exchanges therequest_token, and stores the token with mode 600.externalmode. Another program owns the login and writes a token file. This server only reads that file, picks up the new token every morning without a restart, and never writes, deletes or logs out that token.
Tools
Tool names follow the official server where one exists, so prompts carry over: get_profile, get_margins,
get_holdings, get_positions, place_order, modify_order, cancel_order, get_orders, get_trades,
get_gtts, place_gtt_order, get_quotes, get_ltp, get_ohlc, get_historical_data, search_instruments, …
The full reference with every parameter is docs/TOOLS.md. kite-connect-mcp tools lists what
your configuration exposes.
Development
git clone https://github.com/techfreakworm/kite-connect-mcp && cd kite-connect-mcp
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest # never touches the network: Kite is faked in-process
.venv/bin/ruff check . && .venv/bin/ruff format --check .See CONTRIBUTING.md. Security reports: SECURITY.md.
Disclaimer
Trading involves risk. This software can place real orders on a real brokerage account when you configure it to. AI systems are unpredictable: keep the caps low, use dry runs, and review what you confirm. The software is provided "as is", without warranty of any kind (see LICENSE). You are responsible for complying with Zerodha's terms, SEBI's rules (including the static-IP and algo rules) and exchange data policies. Kite Connect data may not be redistributed.
Licence
MIT © 2026 Mayank Gupta
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Indian broker accounts for AI agents: positions, holdings, orders, P&L, option chains, 10+ brokers.
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the Zerodha trading platform for placing stock orders, viewing portfolio holdings, and managing mutual fund investments. Provides secure OAuth authentication and real-time trading capabilities through Zerodha's official API.1-
- AlicenseBqualityDmaintenanceEnables trading and portfolio management on Zerodha Kite Connect through natural language. Supports placing orders, viewing positions/holdings, accessing real-time market data, and managing GTT orders.24MIT
- FlicenseNot gradedqualityDmaintenanceEnables natural language access to Zerodha trading accounts for retrieving portfolio holdings, positions, orders, funds, and real-time market prices. Supports secure authentication for Indian stock market trading operations via Claude, Cursor, and other MCP-compatible AI tools.1-
- FlicenseNot gradedqualityDmaintenanceEnables AI models to interact with the Zerodha trading platform for portfolio management, trading, and account operations through natural language.3-