Kite Connect MCP

v0.2.0
io.github.techfreakworm/kite-connect-mcp Checked 4 days ago Published 21 days ago

Zerodha Kite Connect v3 for AI agents: orders (dry-run by default), GTT, alerts, portfolio, quotes

Values you need

VariableWhat it is
KITE_API_KEYrequired secret API key of your Kite Connect app (developers.kite.trade)
KITE_API_SECREToptional secret API secret of your Kite Connect app, needed for the daily login (or use KITE_API_SECRET_FILE)
KITE_MCP_AUTH_MODEoptional managed (this server owns the daily login) or external (read a token file another program writes) Default: managed
KITE_TOKEN_FILEoptional Path of the access-token file (default: ~/.local/state/kite-connect-mcp/access_token.json)
KITE_MCP_TRADING_MODEoptional dry_run (default: writes are only previewed) or live (writes need a confirmation token) Default: dry_run
KITE_MCP_READ_ONLYoptional true hides every tool that can change the account Default: false

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add kite-connect-mcp -e 'KITE_API_KEY=<KITE_API_KEY>' -- uvx kite-connect-mcp==0.2.0 serve
Add to claude_desktop_config.json
{
  "mcpServers": {
    "kite-connect-mcp": {
      "args": [
        "kite-connect-mcp==0.2.0",
        "serve"
      ],
      "command": "uvx",
      "env": {
        "KITE_API_KEY": "<KITE_API_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "kite-connect-mcp": {
      "args": [
        "kite-connect-mcp==0.2.0",
        "serve"
      ],
      "command": "uvx",
      "env": {
        "KITE_API_KEY": "<KITE_API_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "KITE_API_KEY",
      "id": "kite-api-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "kite-connect-mcp": {
      "args": [
        "kite-connect-mcp==0.2.0",
        "serve"
      ],
      "command": "uvx",
      "env": {
        "KITE_API_KEY": "${input:kite-api-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.kite-connect-mcp]
command = "uvx"
args = ["kite-connect-mcp==0.2.0", "serve"]
env = { "KITE_API_KEY" = "<KITE_API_KEY>" }

For AI agents

  1. Ask the user for: KITE_API_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: session_status, login, complete_login, logout, get_profile, get_margins, get_orders, get_order_history, ….
  5. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json