kite-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
MCP server for Zerodha Kite -- trade Indian stocks through natural conversation with any MCP-compatible AI assistant.
Why an MCP server instead of a Python library?
Traditional Kite wrappers require you to write Python code to trade. With kite-mcp, you just talk:
No code. No scripts. No terminal. Just conversation.
kite-mcp connects any MCP-compatible AI assistant directly to your Zerodha account with 14 trading tools, automated TOTP login, and auto-retry on expired tokens.
How it works
Your AI assistant interprets your intent, maps stock names to symbols (e.g., "Infosys" to NSE:INFY), checks your funds, and executes trades -- all through the MCP protocol. The server handles authentication automatically, including daily token refresh via TOTP.
Features
14 tools for complete trading control:
| Tool | Description |
|------|-------------|
| kite_login | Auto-authenticate with TOTP |
| get_holdings | Portfolio holdings with P&L |
| get_positions | Today's intraday/delivery positions |
| get_orders | Today's order history |
| get_margins | Available funds and margins |
| get_quote | Live market quotes |
| get_ohlc | Open, high, low, close data |
| get_historical_data | Historical candle data (minute to daily) |
| get_instruments | Search tradeable instruments across NSE, BSE, NFO, MCX |
| place_order | Place buy/sell orders (market, limit, stop-loss) |
| modify_order | Modify pending orders |
| cancel_order | Cancel pending orders |
| get_gtt_triggers | View Good Till Triggered orders |
| place_gtt | Place GTT single or OCO (stoploss + target) triggers |
**Key capabilities:**
- Fully automated login -- TOTP generated on the fly, no manual intervention
- Auto-retry on stale tokens -- re-authenticates transparently if a token expires mid-session
- Supports delivery (CNC), intraday (MIS), and F&O (NRML) orders
- After-market orders (AMO) supported
Compatible with
Works with any MCP-compatible client, including:
| Client | Platform |
|--------|----------|
| Claude Desktop | macOS, Windows |
| Claude Code | Terminal (macOS, Linux, Windows) |
| Cursor | macOS, Windows, Linux |
| Windsurf | macOS, Windows, Linux |
| Continue | VS Code, JetBrains |
| Any MCP-compatible client | See MCP clients list |
Quick Start
1. Install
2. Get your credentials
You need a Kite Connect API app. From your app dashboard, note your **API Key** and **API Secret**.
You also need:
- **User ID** -- your Zerodha client ID (e.g., AB1234)
- **Password** -- your Zerodha login password
- **TOTP Secret** (recommended) -- the base32 seed from setting up an external authenticator app for Zerodha 2FA. This enables fully automated login with no manual steps.
How to get your TOTP secret
1. Log in to **console.zerodha.com**
2. Go to **My Profile** > **Security** > **2FA Settings**
3. Switch to an **external authenticator app** (Google Authenticator, Authy, etc.)
4. When the QR code appears, look for a **"Can't scan? Copy this key"** link
5. That key is your TOTP secret -- save it before completing setup
6. Enter the 6-digit code from your authenticator to finish
3. Configure your MCP client
Add this to your MCP client configuration. The config location depends on your client -- refer to your client's documentation for the exact path.