Zerodha Kite Connect MCP Server

Zerodha Kite Connect MCP Server

zerodha-mcpserver•bymanucr619

A Cloudflare Worker that acts as an MCP server providing an interface to the Zerodha Kite Connect API for trading and portfolio management.

License: MIT•Runtime: Awaiting documentation review•Category: finance crypto

WHAT IT DOES

  • •Handles Zerodha authentication by generating a login URL and processing redirect request tokens.
  • •Retrieves equity holdings, positions, and Good Till Triggered orders from Zerodha.
  • •Fetches historical candle data for a given instrument over a specified interval and date range.
  • •Returns all method responses in an MCP-compatible content array format.

BEST FOR

  • •Connecting Claude Desktop or other MCP clients to a Zerodha trading account.
  • •Checking portfolio holdings and positions through an MCP client after authenticating with Zerodha.
  • •Pulling historical market data for instruments such as NSE:INFY through an MCP client.

ABOUT ZERODHA-MCPSERVER

Zerodha Kite Connect MCP Server is cataloged as an MCP server attributed to manucr619. A Cloudflare Worker that acts as an MCP server providing an interface to the Zerodha Kite Connect API for trading and portfolio management. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Zerodha Kite Connect MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server handle Zerodha authentication?

It generates a login URL, processes the request token after the Zerodha redirect, then stores the resulting access token in a Cloudflare KV namespace for later API calls.

Where are API credentials and access tokens stored?

API keys and secrets are kept in Cloudflare environment variables, and access tokens are stored in a Cloudflare KV namespace.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 6c190862dc0c · 采集于 2026-11-13 11:38:16 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Zerodha Kite Connect MCP Server

This is a Cloudflare Worker that serves as an MCP (Model Context Protocol) server for interacting with the Zerodha Kite Connect API. It provides a comprehensive interface for trading and portfolio management through Zerodha.

Features

  • Zerodha authentication and session management
  • Portfolio management (holdings, positions)
  • GTT (Good Till Triggered) orders
  • Historical data retrieval
  • MCP-compatible responses for seamless integration with Claude Desktop and other MCP clients

Setup

Prerequisites

  • Zerodha Kite Connect API credentials (API Key and Secret)
  • Cloudflare account

Deployment

  1. Clone this repository

  2. Install dependencies:

    npm install
    
  3. Create your configuration file:

    cp wrangler.jsonc.example wrangler.jsonc
    
  4. Configure your Zerodha API credentials in the wrangler.jsonc file:

    • Update the ZERODHA_API_KEY and ZERODHA_API_SECRET values
    • Note: This file is gitignored to prevent committing sensitive information
  5. Create a KV namespace in Cloudflare:

    wrangler kv:namespace create ZERODHA_KV
    
  6. Update the wrangler.jsonc file with the KV namespace ID

  7. Add Node.js compatibility for crypto module:

    {
      "compatibility_date": "2023-05-18",
      "compatibility_flags": ["nodejs_compat"],
      ...
    }
    
  8. Deploy the worker:

    npx wrangler deploy
    

Available Methods

Authentication

  • getLoginUrl() - Generates a Zerodha login URL using the configured API key
  • handleRedirect(requestToken) - Processes the request token after successful login
  • rdhandle(requestToken) - Alternative endpoint for handling authentication redirects

Portfolio Management

  • getHoldings() - Retrieves a list of equity holdings from Zerodha
  • getPositions() - Retrieves current day and net positions

Orders

  • getGTTOrders() - Retrieves Good Till Triggered orders

Market Data

  • getHistoricalData(instrumentToken, interval, from, to, continuous, oi) - Retrieves historical candle data for a given instrument

Usage

With Claude Desktop or other MCP clients

Once deployed, you can add the worker as an MCP server in Claude Desktop:

  1. Go to Settings > MCP Servers
  2. Add a new server with your worker URL (e.g., https://zerodha-mcp.your-subdomain.workers.dev)
  3. Claude will automatically discover the available methods

With JavaScript

// Example of using the MCP worker in JavaScript
const loginUrl = await zerodhaWorker.getLoginUrl();
console.log('Please login at:', loginUrl);

// Authentication flow
window.location.href = loginUrl;
// After redirect back with request_token in URL...
const urlParams = new URLSearchParams(window.location.search);
const requestToken = urlParams.get('request_token');

// Get holdings after authentication
const holdingsResponse = await zerodhaWorker.getHoldings();
const holdings = JSON.parse(holdingsResponse.content[0].text);
console.log('Your holdings:', holdings);

// Get historical data
const historicalData = await zerodhaWorker.getHistoricalData(
  '5633',           // instrument_token (NSE:INFY)
  'minute',         // interval
  '2023-01-01 09:15:00', // from
  '2023-01-01 09:30:00', // to
  false,            // continuous
  false             // oi
);
console.log('Historical data:', JSON.parse(historicalData.content[0].text));

Extending Functionality

To add more Zerodha API functionality:

  1. Add new methods to the ZerodhaWorker class in src/index.js
  2. Implement the desired Zerodha API calls using the Kite Connect API
  3. Format responses according to the MCP specification (using the content array format)
  4. Update the docs.json file to document the new methods
  5. Deploy the updated worker

Response Format

All methods return responses in the MCP-compatible format:

{
  "content": [
    {
      "type": "text",
      "text": "{ ... data as JSON string ... }"
    }
  ]
}

Authentication Flow

  1. User visits the login URL generated by getLoginUrl()
  2. After successful login, Zerodha redirects to the callback URL with a request token
  3. The /callback or /rdhandle endpoint processes the request token
  4. The access token is obtained and stored in the KV namespace
  5. Subsequent API calls use the stored access token

Security

  • API keys and secrets are stored securely in Cloudflare environment variables
  • Access tokens are stored in Cloudflare KV namespace
  • The wrangler.jsonc file containing credentials is gitignored to prevent accidental exposure
  • Only essential endpoints are exposed, minimizing attack surface

Development

To run the worker locally:

npx wrangler dev

To test the worker:

npx wrangler dev --test

API Documentation

For more information about the Zerodha Kite Connect API, refer to the official documentation:

MCP Documentation

For more information about the Model Context Protocol (MCP), refer to:

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Zerodha Kite Connect MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/zerodha-mcpserver)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related finance crypto MCP Servers

Alternative and complementary servers in the same category

View all in finance crypto →
USA Spending MCP Server
usaspending-mcp-server•thsmale

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

Repository stats unavailable
Finance & Analytics
Fortnox MCP server — More AI
more-ai-chatgpt-claude-mcp-fortnox•amor3

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

0
Finance & Analytics

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.

Repository stats unavailable
Finance & Analytics