Zerodha Kite Connect
ZE
Docker Hub MCP

Zerodha Kite Connect

by anshuljain90 · Finance

0.0 · 0 reviews
32 installs · 15 tools
Not yet security audited

MCP server for Zerodha Kite Connect API - India's leading stock broker trading platform. Execute trades, manage portfolios, and access real-time market data for NSE, BSE, and other Indian exchanges.

Zerodha Kite Connect MCP Server

An MCP (Model Context Protocol) server for integrating Zerodha's Kite Connect API with AI assistants like Claude. This server enables AI assistants to execute trades, manage portfolios, and access real-time market data from Indian stock exchanges.

Features

  • Trading Operations: Place, modify, and cancel orders
  • Portfolio Management: View positions, holdings, and margins
  • Market Data: Get real-time quotes and historical data
  • Order Management: Track orders and trades
  • User Information: Access profile and account details

Prerequisites

  1. Zerodha Trading Account: You need an active Zerodha trading account
  2. Kite Connect Developer Account: Register at Kite Connect
  3. API Credentials: Create an app on Kite Connect to obtain:
  4. API Key
  5. API Secret
  6. 2FA Setup: Enable TOTP-based two-factor authentication on your Zerodha account

Installation

docker pull mcp/zerodha-kite:0.1.0
# or use latest
docker pull mcp/zerodha-kite:latest

From Source

git clone https://github.com/anshuljain90/zerodha-kite-mcp.git
cd zerodha-kite-mcp
npm install
npm run build

Configuration

Environment Variables

Create a .env file with your credentials:

KITE_API_KEY=your_api_key_here
KITE_API_SECRET=your_api_secret_here
KITE_ACCESS_TOKEN=your_access_token_here  # Optional, can be generated at runtime
KITE_REDIRECT_URL=http://localhost:3000/redirect

Docker Desktop Integration

  1. Open Docker Desktop with MCP Toolkit enabled
  2. Import the Zerodha Kite MCP server
  3. Configure your API credentials in the settings
  4. Enable the server and connect it to your AI assistant

Authentication Flow

The Kite Connect API uses OAuth 2.0:

  1. Generate Login URL: Use your API key to create a login URL
  2. User Authorization: User logs in and authorizes the app
  3. Receive Request Token: Get the request token from the redirect
  4. Exchange for Access Token: Use API secret to get access token
  5. API Access: Use access token for all API calls

Available Tools

Trading

  • place_order - Place buy/sell orders
  • modify_order - Modify pending orders
  • cancel_order - Cancel pending orders

Portfolio

  • get_positions - View open positions
  • get_holdings - View demat holdings
  • get_margins - Check available margins

Market Data

  • get_quote - Get real-time quotes
  • get_historical_data - Get historical OHLC data
  • get_instruments - List tradeable instruments
  • get_ltp - Get last traded prices

Order Management

  • get_orders - View all orders
  • get_trades - View executed trades
  • get_order_history - Get order modification history

Account

  • get_profile - Get user profile
  • get_market_status - Check if markets are open

Usage Examples

Place a Market Order

{
  "tool": "place_order",
  "arguments": {
    "exchange": "NSE",
    "tradingsymbol": "RELIANCE",
    "transaction_type": "BUY",
    "quantity": 10,
    "order_type": "MARKET",
    "product": "CNC"
  }
}

Get Current Holdings

{
  "tool": "get_holdings",
  "arguments": {}
}

Get Real-time Quote

{
  "tool": "get_quote",
  "arguments": {
    "exchange": "NSE",
    "tradingsymbol": "INFY"
  }
}

Development

Running Locally

npm run dev

Building

npm run build

Testing

npm test

Linting

npm run lint

Important Notes

  1. Market Hours: Indian markets operate 9:15 AM - 3:30 PM IST on weekdays
  2. Product Types:
  3. CNC: Cash and Carry (delivery)
  4. MIS: Margin Intraday Square-off
  5. NRML: Normal (for F&O)
  6. Order Types:
  7. MARKET: Market order
  8. LIMIT: Limit order
  9. SL: Stop-loss limit
  10. SL-M: Stop-loss market
  11. Rate Limits: Be mindful of API rate limits
  12. Security: Never expose API secrets in logs or responses

Docker Build

To build the Docker image locally:

docker build -t zerodha-kite-mcp .

Release Information

  • Current Version: 0.1.0
  • Release Date: 2025-01-24
  • Changelog: See CHANGELOG.md for detailed release notes

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE file for details

Support

Compliance

This MCP server is for legitimate trading purposes only. Users must comply with SEBI regulations and Zerodha's terms of service. Automated trading may require additional approvals from the exchange.

Disclaimer

This is an unofficial integration. Use at your own risk. The authors are not responsible for any financial losses incurred through the use of this software.

place_order Place a new order in the market
modify_order Modify an existing pending order
cancel_order Cancel a pending order
get_positions Get all open positions (intraday and overnight)
get_holdings Get long-term holdings in demat account
get_margins Get account margins and available funds
get_quote Get real-time market quotes for a symbol
get_historical_data Get historical candlestick data
get_instruments Get list of all tradeable instruments
get_orders Get list of all orders for the day
get_trades Get list of all executed trades
get_order_history Get complete history of an order including modifications
get_profile Get user profile information
get_ltp Get last traded price for multiple instruments
get_market_status Check if markets are open or closed

Security Audit

This integration has not been scanned yet. Once a security audit has been completed, the results will be displayed here.

0.0
0 reviews
5
0%
4
0%
3
0%
2
0%
1
0%

Sign in to leave a review

No reviews yet — be the first!

Connect →
0.0
★ Rating
15
Tools
32
Installs

Configuration

KITE_API_SECRET required secret
KITE_API_SECRET

Configure your Zerodha Kite Connect API credentials. Requires an active Zerodha trading account and Kite Connect developer app.

KITE_API_KEY required string
KITE_API_KEY

Your Kite Connect API key from the developer console

KITE_ACCESS_TOKEN string
KITE_ACCESS_TOKEN

Access token obtained after OAuth authentication (optional - can be generated at runtime)

KITE_REDIRECT_URL string
KITE_REDIRECT_URL

OAuth redirect URL configured in your Kite Connect app

Docker Image

Docker Hub
mcp/zerodha-kite

Docker MCP Toolkit

docker mcp catalog import https://marketplace.orcorus.com/catalog.yaml
docker mcp server enable zerodha-kite

Or download zerodha-kite.yaml and run docker mcp catalog add my-catalog zerodha-kite zerodha-kite.yaml

Published by github.com/anshuljain90