kite-mcp is an MCP server for Zerodha Kite, with the goal of trading Indian stocks through natural conversation via any MCP-compatible AI assistant. Unlike traditional Kite Python wrapper libraries that require writing code, kite-mcp lets users complete trades directly through conversation, with no code, scripts, or terminal required.
Purpose: kite-mcp connects MCP-compatible AI assistants directly to the user's Zerodha account, providing 14 trading tools, automated TOTP login, and automatic retry when the token expires. The AI assistant parses the user's intent, maps stock names to trading symbols (for example, mapping "Infosys" to NSE:INFY), checks funds, and executes the trade, all through the MCP protocol. The server automatically handles authentication, including daily token refresh via TOTP.
Key capabilities:
- 14 trading tools, providing complete trading control.
- Fully automated login: dynamically generates TOTP, with no manual intervention required.
- Automatic retry on token expiration: if the token expires mid-session, it transparently re-authenticates.
- Supports delivery (CNC), intraday (MIS), and F&O (NRML) orders.
- Supports after-market orders (AMO).
- Compatible with any MCP-compatible client.
- The AI assistant understands plain English stock names, with no need to use trading symbols.
- Provides environment variable configuration and supports a manual login alternative.
- Credentials are passed via environment variables and are not stored in code.
- Access tokens are cached locally at ~/.zerodha_kite_token.json and expire daily.
- The server runs on the user's local machine and does not send data to third-party servers.
- All communication with Zerodha uses HTTPS.
Usage: To use kite-mcp, you first need to obtain a Kite Connect API app, and note down the API Key and API Secret from the app dashboard. Then prepare the following credentials:
- User ID: Zerodha customer ID (for example AB1234).
- Password: Zerodha login password.
- TOTP Secret (recommended): a base32 seed from an external authenticator app set up for Zerodha two-factor authentication. This enables fully automated login with no manual steps. How to obtain it: log in to console.zerodha.com, go to My Profile > Security > 2FA Settings, switch to an external authenticator app (such as Google Authenticator, Authy), and when the QR code appears, find the "Can't scan? Copy this key" link. That key is the TOTP secret; save it before completing setup, then enter the 6-digit code from the authenticator to complete setup. Next, configure the MCP client: add the corresponding configuration to the MCP client configuration (the configuration location depends on the client; refer to the corresponding client documentation). After restarting the MCP client, you can trade. Afterward, you can open a new conversation and try the following commands:
- "Show my portfolio holdings"
- "What's Tata Motors trading at?"
- "Buy 10 Infosys at market price"
- "How much cash do I have available?"
- "Cancel my last pending order"
- "Show my top gainers and losers"
If there is no TOTP secret, you can log in manually every day: this method caches the access token for the remainder of the day, and the MCP server will use the cached token until it expires.
Applicable scenarios:
- Daily portfolio monitoring: "Give me a portfolio summary including top gainers and losers."
- Quick trading: "Buy 50 shares of Reliance" or "Sell all my Yes Bank."
- Research plus action: "What is HDFC Bank's 52-week high? Should I add to my position at the current price?"
- Risk management: "Set a stop-loss GTT at 1100 for my BDL position."
- Scheduled reports: combine with MCP scheduled tasks to get a daily portfolio summary at 9 a.m.
- Slack integration: work with Slack MCP to receive portfolio alerts in a Slack channel.
Limitations and information not yet provided: The material listssome planned future features, including options chain data for F&O traders, basket orders (multiple orders in one instruction), mutual fund tools (purchase, redemption, SIP inquiry), watchlist management, portfolio analysis (sector allocation, diversification score), webhook/streaming support for real-time price alerts, and support for multiple Zerodha accounts. These are planned feature request directions, not capabilities that currently exist. The material does not provide specific fee standards, prices, a complete list of supported clients, installation command details, or platform compatibility information. Regarding security policy, it only mentions that credentials are passed through environment variables, tokens are cached locally, it runs locally, and HTTPS communication is used.