aranjan/kite-mcp

💰 Finance & Fintech
0 Views
0 Installs

🐍 🏠 - Trade Indian stocks on Zerodha Kite via natural conversation. 14 tools for holdings, orders, quotes, GTT triggers, and more with automated TOTP login.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "aranjan-kite-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "aranjan-kite-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

kite-mcp logo

kite-mcp

PyPI version CI License: MIT Smithery

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:

You:       "Buy 50 Reliance at market price"
Assistant: checks quote, verifies funds, asks for confirmation, places order

You:       "How's my portfolio doing?"
Assistant: fetches holdings, calculates P&L, summarizes gainers and losers

You:       "Set a stop-loss on my HAL position at 3400"
Assistant: places a GTT trigger for you

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

You (natural language) --> AI Assistant --> kite-mcp (MCP server) --> Zerodha Kite API

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:

ToolDescription
kite_loginAuto-authenticate with TOTP
get_holdingsPortfolio holdings with P&L
get_positionsToday's intraday/delivery positions
get_ordersToday's order history
get_marginsAvailable funds and margins
get_quoteLive market quotes
get_ohlcOpen, high, low, close data
get_historical_dataHistorical candle data (minute to daily)
get_instrumentsSearch tradeable instruments across NSE, BSE, NFO, MCX
place_orderPlace buy/sell orders (market, limit, stop-loss)
modify_orderModify pending orders
cancel_orderCancel pending orders
get_gtt_triggersView Good Till Triggered orders
place_gttPlace 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:

ClientPlatform
Claude DesktopmacOS, Windows
Claude CodeTerminal (macOS, Linux, Windows)
CursormacOS, Windows, Linux
WindsurfmacOS, Windows, Linux
ContinueVS Code, JetBrains
Any MCP-compatible clientSee MCP clients list

Quick Start

1. Install

pip install kite-mcp

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.

{
  "mcpServers": {
    "kite": {
      "command": "kite-mcp",
      "env": {
        "KITE_API_KEY": "your-api-key",
        "KITE_API_SECRET": "your-api-secret",
        "KITE_USER_ID": "your-user-id",
        "KITE_PASSWORD": "your-password",
        "KITE_TOTP_SECRET": "your-totp-secret"
      }
    }
  }
}

Restart your MCP client. You're ready to trade.

4. Try it out

Open a new chat and try:

  • "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"

The AI assistant understands stock names in plain English -- no need to use trading symbols.

Environment Variables

VariableRequiredDescription
KITE_API_KEYYesKite Connect API key
KITE_API_SECRETYesKite Connect API secret
KITE_USER_IDYesZerodha client ID
KITE_PASSWORDYesZerodha login password
KITE_TOTP_SECRETNoTOTP base32 seed for auto-login. Without this, you must run kite-mcp-login manually each day.

Manual Login

If you don't have a TOTP secret, you can log in manually each day:

export KITE_API_KEY=your-api-key
export KITE_API_SECRET=your-api-secret
export KITE_USER_ID=your-user-id
export KITE_PASSWORD=your-password
kite-mcp-login

This caches the access token for the rest of the day. The MCP server will use the cached token until it expires.

Use Cases

  • Daily portfolio monitoring -- "Give me a summary of my portfolio with top gainers and losers"
  • Quick trades -- "Buy 50 Reliance" / "Sell all my Yes Bank"
  • Research + action -- "What's the 52-week high of HDFC Bank? Should I add more at current levels?"
  • Risk management -- "Set a stop-loss GTT on my BDL position at 1100"
  • Scheduled reports -- Combine with MCP scheduled tasks to get a daily portfolio summary at 9am
  • Slack integration -- Pair with Slack MCP to receive portfolio alerts in your Slack channel

Roadmap

  • Option chain data for F&O traders
  • Basket orders -- place multiple orders in one command
  • Mutual fund tools -- buy, redeem, check SIPs
  • Watchlist management
  • Portfolio analytics -- sector allocation, diversification score
  • Webhook/streaming support for real-time price alerts
  • Support for multiple Zerodha accounts

Have an idea? Open a feature request.

Development

git clone https://github.com/aranjan/kite-mcp.git
cd kite-mcp
python -m venv venv
source venv/bin/activate
pip install -e .

Security

  • Credentials are passed via environment variables -- never stored in code
  • Access tokens are cached locally at ~/.zerodha_kite_token.json and expire daily
  • The server runs locally on your machine -- no data is sent to third-party servers
  • All communication with Zerodha uses HTTPS

License

MIT

Related MCP Servers

@agentfund/mcp

📇 ☁️ - Fundraising infrastructure for AI agents on Solana — campaigns, x402 donations, and on-chain reputation. MCP tools for registering agents, creating campaigns, and donating via the x402 pay-to-call flow, backed by Anchor programs (agentregistry, escrow, reputation). npx -y @agentfund/mcp

💰 Finance & Fintech1 views
@asterpay/mcp-server

📇 ☁️ - EUR settlement for AI agents via x402 protocol. Market data, AI tools, crypto analytics — pay-per-call in USDC on Base. SEPA Instant EUR off-ramp.

💰 Finance & Fintech1 views
@czagents/cnb

📇 ☁️ 🏠 🍎 🪟 🐧 - Czech National Bank (ČNB) daily FX rates: fetch official CZK exchange rates, convert between currencies, fetch historical rates. Cached 10 min to ease upstream load. npm @czagents/cnb or HTTP at cnb.cz-agents.dev/mcp.

💰 Finance & Fintech1 views
@arbitova/mcp-server

📇 ☁️ - Non-custodial on-chain escrow + AI dispute arbitration for agent-to-agent USDC payments on Base. Seven tools covering the full EscrowV1 contract surface: create escrow, mark delivered with on-chain content hash, confirm or dispute, arbiter resolves with signed verdict, cancel/escalate on timeout. npx @arbitova/mcp-server

💰 Finance & Fintech0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

Last checked: 7/28/2026, 3:01:06 PM

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.