kite-mcp-server
Provides tool-based access to a Zerodha Kite Connect account for portfolio and margin checks, order management, GTT orders, trade reports, margin calculations, instrument lookup, mutual fund orders/SIPs, and live or historical market data on paid Connect tiers.
Click on "Deploy 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., "@kite-mcp-server show me my holdings and available margins"
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.
kite-mcp-server
A Model Context Protocol server for Zerodha Kite Connect. It gives any MCP client — Claude Desktop, Claude Code, or any other compatible agent — direct, tool-based access to a user's Kite account: portfolio, orders, margins, mutual funds, and (on a paid Connect plan) live market data.
Disclaimer: This project is independently developed and is not affiliated with, endorsed by, or sponsored by Zerodha. You are responsible for any action taken on your trading account through this server. Order-placing and SIP tools interact with real money — review the dry-run output of any tool before enabling live trading.
Capabilities
Supports both Kite Connect app tiers. Tools that require live market data or historical candles return a clear, actionable error on the free tier instead of a generic API failure; every other tool works identically on both tiers.
Available on the free ("Personal") tier:
Area | Tools |
Profile & margins |
|
Portfolio |
|
Orders & reports |
|
Trading |
|
GTT (standing stop-loss / target orders) |
|
Margin calculators (pre-trade checks) |
|
Instrument lookup |
|
Mutual funds |
|
Requires a paid Connect subscription with market data access:
Tool | Purpose |
| Live quotes and depth |
| Historical OHLC candles |
| Opens a WebSocket connection and returns a bounded snapshot (1–30s) of live ticks. MCP tools are request/response, so this trades continuous streaming for a short poll — call it again for a fresher snapshot. |
All tools that place, modify, or cancel an order, SIP, or position run in dry-run mode by default. See Trading safety.
Related MCP server: Zerodha MCP Server
Requirements
Node.js 18 or later
A Kite Connect app (developers.kite.trade/apps) — the free Personal tier is sufficient for most of this server's functionality
Setup
Create a Kite Connect app at https://developers.kite.trade/apps. Note the API key and secret, and set a Redirect URL (it doesn't need to be a live server —
https://127.0.0.1works for manual login).Clone and build:
git clone https://github.com/<your-username>/kite-mcp-server.git cd kite-mcp-server npm install npm run buildConfigure credentials — copy
.env.exampleto.envand fill inKITE_API_KEYandKITE_API_SECRET.Authenticate (required once per trading day — Kite access tokens expire daily):
npm run loginThis prints a login URL. Log in and complete two-factor authentication in your browser, then paste the resulting redirect URL (or just the
request_tokenfrom it) back into the terminal. The access token is saved to.kite-session.json, which is excluded from version control.Register the server with your MCP client. Example configuration for Claude Desktop (
claude_desktop_config.json) or Claude Code (settings.json):{ "mcpServers": { "kite": { "command": "node", "args": ["/absolute/path/to/kite-mcp-server/dist/index.js"], "env": { "KITE_API_KEY": "your_api_key_here", "KITE_MCP_ENABLE_TRADING": "false" } } } }
Trading safety
By default, KITE_MCP_ENABLE_TRADING is unset (equivalent to false), so every
order/SIP/position-mutating tool — place_order, modify_order, cancel_order,
convert_position, place_gtt, modify_gtt, delete_gtt, place_mf_order,
cancel_mf_order, place_mf_sip, modify_mf_sip, cancel_mf_sip — runs in dry-run
mode: it returns exactly what it would send to Kite without sending it. Set
KITE_MCP_ENABLE_TRADING=true once you've reviewed the dry-run output and want the
server to execute for real.
calculate_order_margins and calculate_basket_margins are always live and always
read-only, since they never place anything — use them to validate a trade before
enabling live trading.
There is no additional per-call confirmation beyond your MCP client's own tool-approval
UI. Treat enabling KITE_MCP_ENABLE_TRADING with the same caution as granting shell
access to your trading account.
Daily token refresh
Kite's login flow requires a browser session and two-factor authentication, so it
cannot be fully automated without storing a user's 2FA secret — which this project
does not do. Run npm run login once per trading day before using the server. An
authentication error from any tool call is the first thing to check.
Contributing
Issues and pull requests are welcome. Planned areas for contribution:
Streaming tick data via MCP resources/notifications instead of the bounded
watch_tickspollBasket order execution
Kite Alerts API integration
License
MIT — see LICENSE.
Available Tools
36 toolscalculate_basket_marginsB
Calculate combined margin for a basket of hypothetical orders, accounting for hedges/offsets across them (e.g. a spread). Read-only — free on all tiers.
Inputs: orders (required), compact, consider_positions.
calculate_order_marginsA
Calculate the margin required for one or more hypothetical orders, without placing them. Use this before place_order to check affordability/leverage. Read-only — free on all tiers.
Inputs: orders (required), compact.
cancel_mf_orderA
Cancel a pending mutual fund order. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: order_id (required).
cancel_mf_sipB
Cancel an SIP. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: sip_id (required).
cancel_orderA
Cancel a pending order. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: variety (required), order_id (required), parent_order_id.
convert_positionA
Convert an open position's product type (e.g. move an intraday MIS position to CNC overnight delivery, or vice versa). Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: exchange (required), quantity (required), new_product (required), old_product (required), +3 more.
delete_gttA
Delete (cancel) a GTT order. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: trigger_id (required).
get_auction_instrumentsA
Get instruments currently available to buy in an auction session (used to cover short-delivery obligations).
Inputs: no named parameters.
get_gttB
Get details of a single GTT order by trigger id.
Inputs: trigger_id (required).
get_gttsB
List all active GTT (Good Till Triggered) orders.
Inputs: no named parameters.
get_historical_dataA
Get historical OHLC candles for an instrument. Use search_instruments first to find the instrument_token. Requires a paid Kite Connect subscription with market data access — not included in the free Personal tier. Minute-level data is capped by Kite to recent history (e.g. ~60 days for 'minute'); day candles go back much further.
Inputs: to_date (required), interval (required), from_date (required), instrument_token (required), +3 more.
get_holdingsA
Get long-term equity holdings (stocks held in demat, not intraday positions).
Inputs: no named parameters.
get_ltpA
Get last traded price for up to 50 instruments. Requires a paid Kite Connect subscription with market data access — not included in the free Personal tier.
Inputs: instruments (required).
get_marginsB
Get available trading margins. Optionally scoped to a segment (equity or commodity).
Inputs: segment.
get_mf_holdingsB
Get mutual fund holdings.
Inputs: no named parameters.
get_mf_ordersA
Get mutual fund orders. Omit order_id to list all of today's orders.
Inputs: order_id.
get_mf_sipsB
Get mutual fund SIPs (systematic investment plans). Omit sip_id to list all active SIPs.
Inputs: sip_id.
get_ohlcA
Get OHLC (open/high/low/close) snapshot for up to 50 instruments. Requires a paid Kite Connect subscription with market data access — not included in the free Personal tier.
Inputs: instruments (required).
get_order_historyC
Get the full status history of a single order.
Inputs: order_id (required).
get_ordersA
Get the day's order book (all orders placed today and their status).
Inputs: no named parameters.
get_order_tradesB
Get the trades (fills) generated by a single order.
Inputs: order_id (required).
get_positionsA
Get current day's and net trading positions (intraday + carry-forward F&O etc).
Inputs: no named parameters.
get_profileB
Get the logged-in Kite user's profile.
Inputs: no named parameters.
get_quoteA
Get full market quote (price, depth, OHLC, volume) for up to 50 instruments. Requires a paid Kite Connect subscription with market data access — not included in the free Personal tier.
Inputs: instruments (required).
get_tradesA
Get all trades (fills) for the day across all orders.
Inputs: no named parameters.
get_trigger_rangeB
Get the valid stop-loss trigger price range for Cover Order instruments. Requires a paid Kite Connect subscription with market data access — not included in the free Personal tier.
Inputs: instruments (required), transaction_type (required).
modify_gttB
Modify an existing GTT order. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: orders (required), exchange (required), last_price (required), trigger_id (required), +3 more.
modify_mf_sipB
Modify, pause, or unpause an existing SIP. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: sip_id (required), status, frequency, instalments, +1 more.
modify_orderA
Modify a pending order (price, quantity, order type, trigger price, validity, or disclosed quantity). Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: variety (required), order_id (required), price, quantity, +4 more.
place_gttB
Create a GTT (Good Till Triggered) order — e.g. a standing stop-loss or target that fires without you watching the price. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: orders (required), exchange (required), last_price (required), trigger_type (required), +2 more.
place_mf_orderA
Place a mutual fund buy (amount) or sell (quantity) order. Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: tradingsymbol (required), transaction_type (required), tag, amount, +1 more.
place_mf_sipB
Start a mutual fund SIP (recurring investment). Dry-run unless KITE_MCP_ENABLE_TRADING=true is set.
Inputs: amount (required), frequency (required), instalments (required), tradingsymbol (required), +3 more.
place_orderA
Place a new order on Kite. Returns a dry-run preview unless KITE_MCP_ENABLE_TRADING=true is set in the server's environment, since this sends a real order to the exchange with real money.
Inputs: product (required), variety (required), exchange (required), quantity (required), +9 more.
search_instrumentsA
Search the instrument master list by trading symbol or name substring (case-insensitive). Use this to find instrument_token / exact tradingsymbol values needed by quote, historical-data, and tick-watching tools. The full list has tens of thousands of rows, so results are capped — narrow with exchange and query for best results. Free on all Kite Connect tiers.
Inputs: query (required), limit, exchange, instrument_type.
search_mf_instrumentsB
Search the mutual fund instrument list by trading symbol (ISIN) or name substring, e.g. "Nifty 50 Index".
Inputs: query (required), limit.
watch_ticksA
Open a live WebSocket connection to Kite and collect ticks for a short window, then return everything received (latest price per instrument plus full history within the window). Requires a paid Kite Connect subscription with market data access. Use search_instruments first to find instrument_token values.
Inputs: instrument_tokens (required), mode, duration_seconds.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 36 tools
Most tools map to distinct resources and actions, and descriptions clarify boundaries between similar-sounding pairs such as get_order_trades vs get_trades and calculate_order_margins vs calculate_basket_margins. Minor overlap remains among market-data snapshot tools (get_quote, get_ohlc, get_ltp) and order-inspection tools, but it is manageable.
The tool set uses a consistent snake_case verb_noun pattern throughout: get_*, place_*, modify_*, cancel_*, search_*, calculate_*, convert_*, and watch_*. Domain prefixes such as mf and gtt are applied predictably, with only natural pluralization differences.
36 tools is heavy for agent selection and exceeds the typical well-scoped range. However, the server covers a broad brokerage surface including equity orders, GTTs, market data, mutual funds, SIPs, positions, holdings, and margin calculations, so many tools are justified rather than gratuitous.
Coverage is strong across core trading workflows: equity order lifecycle, GTT CRUD, market data snapshots/history/ticks, positions, holdings, margins, and mutual fund/SIP operations. Minor gaps exist around some single-resource retrieval and mutual fund order-modification paths, but there are no major dead ends for common workflows.
Maintenance
Related MCP Connectors
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
OAuth MCP for Google, Meta, X, LinkedIn, Reddit, TikTok, GSC, GA4, WordPress and GHL.
OAuth Gate exchange MCP for CEX trading, account, wallet, unified account, and sub-account.
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables trading automation through Zerodha Kite Connect API, allowing users to place buy/sell orders and fetch holdings via MCP tools accessible to Claude Desktop and other MCP-compatible clients.-
- 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 assistants to interact with the Zerodha trading platform for placing stock orders, viewing holdings, and managing mutual fund investments through the MCP protocol.4-
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to read Webull account balances, positions, orders, stock quotes, historical bars, and US option market data, with live equity trading available only as an explicitly enabled opt-in.MIT