Zerodha

Kite MCP server

Connect AI assistants to a Zerodha account over MCP: holdings, positions, orders, margins and live market data.

Finance & bankingGuided#mcp#trading#stocks#india#kite#ai-agents

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Kite MCP is Zerodha's official, hosted Model Context Protocol server for Kite. It lets an AI assistant (Claude, Cursor, VS Code Copilot Chat, Windsurf, or this app's MCP client) read your Zerodha account in plain conversation: holdings, positions, margins, orders, trades, GTTs, mutual fund holdings and live market data (quotes, last price, OHLC, historical candles and instrument search). It is built on top of the Kite Connect APIs, but you do not need a Kite Connect developer subscription or API key to use the hosted server: you sign in with your normal Kite login.

Endpoint. https://mcp.kite.trade/mcp (Streamable HTTP). A legacy SSE endpoint is also served at https://mcp.kite.trade/sse. The source code is open at github.com/zerodha/kite-mcp-server; the product page is zerodha.com/products/mcp.

Read-only by design. The hosted server leaves out the trading tools (place_order, modify_order, cancel_order and the GTT write tools). Zerodha's README says that if you want those you must run the server yourself with your own Kite Connect API key and secret. This collection only saves read tools for the hosted server, and documents the trading tools in the last folder for self-hosted use.

How sign-in works (checked live on 2026-11-18)

  1. An unauthenticated call to /mcp returns 401 with WWW-Authenticate: Bearer resource_metadata="https://mcp.kite.trade/.well-known/oauth-protected-resource" and the body no bearer token.
  2. The protected-resource document names https://mcp.kite.trade as the authorization server; its /.well-known/oauth-authorization-server document lists /authorize, /token and a dynamic client /register endpoint, the authorization_code grant with PKCE S256, and public clients (token_endpoint_auth_methods_supported: none).
  3. Your MCP client registers itself, opens the authorize page in a browser, you log in to Kite (user ID, password, 2FA) and approve, and the client gets an access token it sends as Authorization: Bearer ....
  4. The login tool still exists: if the Kite session behind your token expires mid-conversation, call it and open the link it returns.

In this app: open the MCP editor of any request, use the OAuth sign-in, and the token lands in the accessToken variable (collection auth is Bearer {{accessToken}}). Kite sessions expire daily (the Kite Connect session ends early the next morning), so expect to sign in again each trading day.

Add it to your AI client

  • Claude Code: claude mcp add --transport http kite https://mcp.kite.trade/mcp, then run /mcp and choose Authenticate.
  • Claude Desktop: Settings > Connectors > Add custom connector, URL https://mcp.kite.trade/mcp. Older setups use the README's config entry {"mcpServers": {"kite": {"command": "npx", "args": ["mcp-remote", "https://mcp.kite.trade/mcp"]}}}.
  • Cursor: in ~/.cursor/mcp.json add {"mcpServers": {"kite": {"url": "https://mcp.kite.trade/mcp"}}}.
  • VS Code: in .vscode/mcp.json add {"servers": {"kite": {"type": "http", "url": "https://mcp.kite.trade/mcp"}}}.

Run order

Folder 1 shows the OAuth discovery as plain HTTP (no token needed). Sign in, then run folder 2 (profile and margins), folder 3 (portfolio), folder 4 (orders and trades, read-only) and folder 5 (market data). Instrument symbols use EXCHANGE:TRADINGSYMBOL, for example NSE:INFY; get_historical_data needs a numeric instrument_token, which you get from search_instruments.

Tools on the hosted server

ToolWhat it returns
loginA Kite login link for the current session
get_profile, get_marginsAccount details, available funds and margins
get_holdings, get_positions, get_mf_holdingsPortfolio (paginated with from/limit)
get_orders, get_trades, get_order_history, get_order_trades, get_gttsToday's orders and trades, one order's history, active GTTs
get_quotes, get_ltp, get_ohlcMarket data for up to 500 instruments per call
get_historical_data, search_instrumentsCandles by interval; instrument lookup

Limits and safety

Market data and historical data follow Kite Connect's rate limits (docs). The assistant sees your account data: only connect clients you trust, and revoke the access from your Kite account when you stop using it (Zerodha says access can be revoked at any time). Even on a self-hosted server with trading tools, treat every place_order call as real money: keep a human confirmation step and never let an agent trade unattended.

Common errors

ResponseMeaningFix
HTTP 401 no bearer tokenNo or expired OAuth tokenSign in again (OAuth)
Tool result asks you to log inKite session expiredCall login, open the link
isError: true with TokenExceptionKite access token invalidLog in again
InputExceptionBad symbol, token or date formatCheck EXCHANGE:SYMBOL, YYYY-MM-DD HH:MM:SS
Tool not found (place_order)Hosted server is read-onlySelf-host with your own API key

Docs: README, Kite Connect docs, MCP authorization spec.

Endpoints 22

1. Start here: sign-in discovery

  • POSTCall /mcp without a token (expect 401){{mcpUrl}}Sends a normal MCP initialize request with no Authorization header. The hosted server answers 401 with a WWW-Authenticate header that points at the…
  • GETProtected resource metadata{{authBase}}/.well-known/oauth-protected-resourceReads the OAuth protected-resource document named in the 401 header. It says which authorization server issues tokens for /mcp, that tokens go in the…
  • GETAuthorization server metadata{{authBase}}/.well-known/oauth-authorization-serverReads the authorization server's metadata: the authorize, token and dynamic client registration endpoints, the authorization_code grant with PKCE S256, and…
  • POSTRegister an OAuth client (dynamic registration){{authBase}}/registerShows the RFC 7591 dynamic client registration call an MCP client makes before sending you to the authorize page. Change client_name and redirect_uris to your…

2. Account

  • MCPLog in to Kite (get a login link){{mcpUrl}}Calls the login tool. When the Kite session behind your MCP token is missing or expired it returns a link to open in a browser; after you log in to Kite and…
  • MCPGet profile{{mcpUrl}}Calls get_profile, which returns the signed-in user's Kite user ID, name, email, broker, enabled exchanges, products and order types. Use it to confirm which…
  • MCPGet margins{{mcpUrl}}Calls get_margins, which returns equity and commodity segment margins: available cash, opening balance, utilised margin (SPAN, exposure, option premium) and…

3. Portfolio

  • MCPGet holdings{{mcpUrl}}Calls get_holdings to list long-term equity holdings with quantity, average price, last price and P&L. Pass from (0-based start) and limit to page through…
  • MCPGet positions{{mcpUrl}}Calls get_positions to list today's (day) and carried-forward (net) positions in F&O, intraday and commodity, with quantity, buy and sell values and P&L.…
  • MCPGet mutual fund holdings{{mcpUrl}}Calls get_mf_holdings to list mutual fund units held through Coin, with fund name, folio, quantity, average NAV and last NAV. Paginate with from and limit if…

4. Orders and trades (read-only)

  • MCPGet orders{{mcpUrl}}Calls get_orders to list all of today's orders with order_id, status (OPEN, COMPLETE, CANCELLED, REJECTED), symbol, quantity and price. Copy an order_id into…
  • MCPGet order history{{mcpUrl}}Calls get_order_history for one order_id and returns every state change the order went through (put order request received, validation pending, open, complete…
  • MCPGet trades for an order{{mcpUrl}}Calls get_order_trades with an order_id and returns the individual fills (trade_id, quantity, price, exchange timestamp). A partly filled order can have…
  • MCPGet today's trades{{mcpUrl}}Calls get_trades to list all executed trades for the day across orders. Supports from and limit pagination. Use it to reconcile what actually filled versus…
  • MCPGet GTT triggers{{mcpUrl}}Calls get_gtts to list active Good Till Triggered orders: trigger type (single or two-leg), trigger values, the order that fires and its status. Paginate with…

5. Market data

  • MCPSearch instruments{{mcpUrl}}Calls search_instruments to find instruments by query. filter_on picks the field to match: id (exchange:tradingsymbol, the default), name, isin, tradingsymbol…
  • MCPGet last traded price{{mcpUrl}}Calls get_ltp with a list of instruments (EXCHANGE:TRADINGSYMBOL) and returns only the latest price and instrument token for each. The cheapest market data…
  • MCPGet OHLC{{mcpUrl}}Calls get_ohlc for a list of instruments and returns the day's open, high, low and previous close plus last price. Useful for a quick daily range check across…
  • MCPGet full quotes{{mcpUrl}}Calls get_quotes for up to 500 instruments and returns the full snapshot: last price, volume, OHLC, open interest and five levels of bid and ask depth.…
  • MCPGet historical candles{{mcpUrl}}Calls get_historical_data for one numeric instrument_token (from search_instruments) between from_date and to_date (YYYY-MM-DD HH:MM:SS). interval is one of…

6. Self-hosted only: trading tools

  • MCPPlace an order (self-hosted){{mcpUrl}}Calls place_order on a self-hosted server. Required: variety (regular, co, amo, iceberg, auction), exchange, tradingsymbol, transaction_type (BUY or SELL),…
  • MCPCancel an order (self-hosted){{mcpUrl}}Calls cancel_order with the variety and order_id of an open order on a self-hosted server. Use it to clean up the test LIMIT order from the previous request;…

API details

Base URL
https://mcp.kite.trade/mcp
Authentication
OAuth 2.0 (authorization code flow) with 1 scope
Operations
22 operations on 22 pathsPOST 20GET 2
Main resources
1. Start here: sign-in discovery 42. Account 33. Portfolio 34. Orders and trades (read-only) 55. Market data 56. Self-hosted only: trading tools 2
Description format
Swastik Codes guided collection, API version checked against the docs on 2026-11-18

How to test the Kite MCP server in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Kite MCP server collection, without the publisher's secrets.
  3. Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 1 scope. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Call /mcp without a token (expect 401)” (POST {{mcpUrl}}), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Kite MCP server?

Connect AI assistants to a Zerodha account over MCP: holdings, positions, orders, margins and live market data. It is listed under Finance & banking and has 22 endpoints.

Who publishes the Kite MCP server?

It is listed from Zerodha's public API description (an OpenAPI document), not published by Zerodha on Swastik Codes. Anyone who controls kite.trade can claim the profile by adding a DNS TXT record.

What is the base URL of the Kite MCP server?

Requests go to https://mcp.kite.trade/mcp. Endpoint paths are added to this base URL.

How do I authenticate with the Kite MCP server?

With OAuth 2.0 (authorization code flow) with 1 scope.

How many endpoints does the Kite MCP server have?

22 operations on 22 paths (20 POST, 2 GET). The largest groups are 1. Start here: sign-in discovery, 2. Account, 3. Portfolio, 4. Orders and trades (read-only).

Is forking the Kite MCP server free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.