Skip to main content
Glama
kite-mcp-server

kite-mcp-server

by Ritesh17rb

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

get_profile, get_margins

Portfolio

get_holdings, get_positions, get_auction_instruments

Orders & reports

get_orders, get_order_history, get_order_trades, get_trades

Trading

place_order, modify_order, cancel_order, convert_position

GTT (standing stop-loss / target orders)

get_gtts, get_gtt, place_gtt, modify_gtt, delete_gtt

Margin calculators (pre-trade checks)

calculate_order_margins, calculate_basket_margins

Instrument lookup

search_instruments

Mutual funds

get_mf_holdings, get_mf_orders, get_mf_sips, place_mf_order, cancel_mf_order, place_mf_sip, modify_mf_sip, cancel_mf_sip, search_mf_instruments

Requires a paid Connect subscription with market data access:

Tool

Purpose

get_quote, get_ohlc, get_ltp, get_trigger_range

Live quotes and depth

get_historical_data

Historical OHLC candles

watch_ticks

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

  1. 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.1 works for manual login).

  2. Clone and build:

    git clone https://github.com/<your-username>/kite-mcp-server.git
    cd kite-mcp-server
    npm install
    npm run build
  3. Configure credentials — copy .env.example to .env and fill in KITE_API_KEY and KITE_API_SECRET.

  4. Authenticate (required once per trading day — Kite access tokens expire daily):

    npm run login

    This prints a login URL. Log in and complete two-factor authentication in your browser, then paste the resulting redirect URL (or just the request_token from it) back into the terminal. The access token is saved to .kite-session.json, which is excluded from version control.

  5. 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_ticks poll

  • Basket order execution

  • Kite Alerts API integration

License

MIT — see LICENSE.

Available Tools

36 tools
calculate_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

    A3.5/5.0

    Scored across 36 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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