Zerodha Kite MCP Server Setup with Claude AI | Complete Step-by-Step Guide

Zerodha MCP Server Setup with Claude

Unlock the power of real-time, personalized financial insights by linking your Zerodha account to AI assistants like Claude, Cursor, and Windsurf—completely free via the new Kite Model Context Protocol (MCP). Follow this detailed walkthrough to equip your AI with live portfolio data, interactive capabilities, and the ability to answer complex questions in natural language.


1. What Is the Model Context Protocol (MCP)?

Model Context Protocol (MCP) is an open communication standard that allows AI assistants to interface directly with external services and data sources. With MCP:

  • Real-time data access: Query your live market positions and account balances, not just stale or historical figures.
  • Personalized insights: Get analysis tailored to your exact holdings, risk profile, and exposure.
  • Interactive capabilities: Issue commands like “Place a buy order” or “Show margin utilization,” and the AI can perform API calls on your behalf.
  • Natural-language interface: Ask follow-up questions in plain English, Hindi, or any other language, and receive context-aware responses.

Since Kite Connect APIs are already free, integrating through MCP incurs no extra charges—just the same secure OAuth flow you know and trust.


2. Benefits of Kite MCP Integration

  1. Unified AI Experience
    Whether you prefer Anthropic Claude, Cursor’s developer-friendly tools, or Windsurf’s analytics, MCP standardizes connectivity so you can switch between assistants without re-authenticating.
  2. Zero Additional Cost
    Use your existing Kite Connect subscription at no extra fee—MCP simply sits on top of the same endpoints.
  3. Cut-through Complexity
    No need to write boilerplate code or host your own middleware. The MCP server handles SSE (Server-Sent Events) streams, command routing, and JSON-RPC for you.
  4. Future-proof Architecture
    As new AI platforms emerge, any MCP-compliant assistant can tap into your Zerodha account without further integration work.

3. Prerequisites

Before you begin, ensure you have:

  • A Zerodha trading account with Kite Connect API access (free).
  • Node.js (v14 or above) installed on your machine.
  • The AI assistant desktop app of your choice (e.g., Claude Desktop).
  • Network access to https://mcp.kite.trade/sse.

4. Setting Up Kite MCP for Claude Desktop

4.1 Install Node.js

  1. Visit nodejs.org and download the LTS installer for your operating system.
  2. Run the installer and follow the prompts.
  3. Verify installation in your terminal or command prompt:
node --version
npm --version

4.2 Configure Claude Desktop

  1. Launch the Claude Desktop application.
  2. Click the Settings (gear) icon in the top-right corner.
  3. Select Developer from the left-hand sidebar.
  4. Click Edit Config to open the JSON configuration file.
  5. Add or update the mcpServers block to include Kite:
{
  "mcpServers": {
    "kite": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.kite.trade/sse"]
    }
  }
}
  1. Save the file and restart Claude Desktop for changes to take effect.

5. Verifying Your Connection

  1. Open a new chat in Claude Desktop.
  2. Look for the Tools (hammer) icon in the chat input area—this indicates MCP tools are available.
  3. Click the icon and select kite from the list of MCP servers.
  4. When prompted, authorize access to your Zerodha account via the standard OAuth flow:
    • You’ll be redirected to Zerodha’s login page.
    • Enter your credentials and grant permissions.
    • On successful auth, you’ll see a confirmation message back in Claude.

6. First Queries and Commands

Once connected, try out these example prompts to explore your portfolio:

  • “What is my current equity position for TCS?”
  • “Show me my total unrealized P&L today.”
  • “Place a market buy order for 5 shares of INFY.”
  • “How much margin is available in my intraday account?”

The AI will handle the API calls seamlessly and return structured, human-readable responses.


7. Integrating with Other AI Assistants

Cursor

  1. Install the Cursor CLI or desktop client.
  2. In your Cursor config (e.g., ~/.cursor/config.json), add: jsonCopyEdit"mcp": { "kite": "https://mcp.kite.trade/sse" }
  3. Restart Cursor and authorize via the CLI prompt.

Windsurf

  1. Open Windsurf’s settings.
  2. Navigate to Integrations → MCP Servers.
  3. Click Add Server and enter:
    • Name: kite
    • Endpoint: https://mcp.kite.trade/sse
  4. Authorize via the embedded Zerodha login widget.

8. Troubleshooting Tips

  • No “kite” option in Tools menu?
    • Ensure you’ve saved the config properly and restarted the app.
  • OAuth errors or “access denied”?
    • Double-check your Zerodha API key permissions under the Kite developer dashboard.
  • Delayed updates in portfolio metrics?
    • MCP streams over SSE; verify your network allows long-lived HTTP connections to mcp.kite.trade.

9. Security and Privacy

  • Data stays encrypted end-to-end over HTTPS.
  • Revoking access is as simple as visiting your Kite Connect dashboard and revoking the token—no code changes needed.
  • Audit logs: Check recent API calls on your Kite Connect dashboard to monitor usage.

10. Next Steps

  • Explore advanced MCP commands: historical data queries, order book snapshots, and watchlist management.
  • Build custom prompts or chains that combine market analysis with portfolio recommendations.
  • Share your feedback or feature requests on the Kite MCP GitHub repo.

Congratulations! You’ve successfully connected your Zerodha account to AI assistants via Kite MCP. Harness real-time data, personalized insights, and seamless command execution—all through natural conversations. Happy trading!

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply