npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zerodha-mcp-server-aks

v1.0.3

Published

Zerodha Kite Connect MCP Server for AI Assistants

Downloads

766

Readme

Zerodha Kite Connect MCP Server (zerodha-mcp-server-aks)

An Model Context Protocol (MCP) server that connects your AI Assistant (Claude Desktop, Cursor, etc.) directly to the Zerodha Kite Connect API. This enables your AI agent to fetch portfolio details, look up instruments, check funds, and safely place stock orders on your behalf.

[!CAUTION] Trading Safety: Running trading operations via AI assistants carries inherent risks. Always verify your holdings and available margins, and review orders before execution.


Features & Tools

  • Profile & Funds: Get account profile info (get_zerodha_profile) and check margins/available cash (get_zerodha_margins).
  • Portfolio Tracking: Retrieve current stock holdings (get_zerodha_hodings) and intraday/derivatives positions (get_zerodha_positions).
  • Market Data: Look up trading symbols for companies (get_trading_symbols) and retrieve stock quotes (get_stock_details).
  • Trading: Place stock orders (BUY/SELL) securely with automated pre-checks for quantity, margins, and ownership (trade_stocks_on_zerodha).

How It Works

Zerodha's Kite Connect API requires a daily session authentication token which expires every morning.

  1. You use a web assistant (e.g. hosted on a Cloudflare Worker) to log in to Zerodha and generate your daily access_token.
  2. You provide the ZERODHA_API_KEY and the generated ZERODHA_ACCESS_TOKEN as environment variables to your AI client.
  3. The AI client runs the MCP server locally in the background using npx.

Setup Guide

1. Zerodha Developer App

  1. Go to the Zerodha Developer Console and create an account.
  2. Create an App (requires a Kite Connect subscription).
  3. Set the Redirect URL of your app to your hosted token generator URL (e.g., https://your-token-generator.workers.dev/).

2. Generate Daily Access Token

  1. Open your hosted token generator URL in your browser.
  2. Enter your Zerodha API Key and API Secret (these are saved only in your browser's local storage).
  3. Click Connect to Zerodha and complete the login.
  4. When redirected back to your page, click Generate Access Token.
  5. Copy the generated Access Token.

3. Configure Your AI Client

Claude Desktop

Open your Claude Desktop configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add the following block to the mcpServers section:

{
  "mcpServers": {
    "zerodha-mcp": {
      "command": "npx",
      "args": ["-y", "zerodha-mcp-server-aks"],
      "env": {
        "ZERODHA_API_KEY": "YOUR_ZERODHA_API_KEY",
        "ZERODHA_ACCESS_TOKEN": "YOUR_GENERATED_DAILY_ACCESS_TOKEN"
      }
    }
  }
}

Cursor IDE

  1. Open Cursor Settings > Features > MCP.
  2. Click + Add New MCP Server.
  3. Configure the following fields:
    • Name: zerodha
    • Type: command
    • Command: npx -y zerodha-mcp-server-aks
  4. Add Environment Variables:
    • ZERODHA_API_KEY = YOUR_ZERODHA_API_KEY
    • ZERODHA_ACCESS_TOKEN = YOUR_GENERATED_DAILY_ACCESS_TOKEN
  5. Click Save.

License

MIT License. Feel free to fork, customize, and build your own trading agents!