About Zerodha MCP
Zerodha MCP is an MCP server published by saiabhiramjaini in the Developer Tools category: zerodha MCP with buy-stock and sell-stock tools.
The repository has 3 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/saiabhiramjaini/Zerodha-MCPThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (2)
buy-stockBuys the stock from zerodha trading account for the given tradingsymbol and quantity to the user. It executes a real order.
Parameters not published.
sell-stockSells the stock from zerodha trading account for the given tradingsymbol and quantity to the user. It executes a real order.
Parameters not published.
Ask AI
Ask AI about Zerodha MCP
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- !License declaredNo license file. Legally you have no right to use it in a product.
- !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
Zerodha MCP
Zerodha MCP (Model Context Protocol) integrates with the Zerodha Kite API to provide programmatic trading capabilities via conversational tools. This project demonstrates how to build an MCP-compatible agent with tools to buy and sell stocks in real-time using the Zerodha trading platform.
Features
- MCP server integration using
@modelcontextprotocol/sdk - Tool to buy stocks via Zerodha
- Tool to sell stocks via Zerodha
- Secure access token generation
- Modular code structure using TypeScript and Bun runtime
Project Structure
zerodha-mcp/
├── README.md
├── getAccessToken.ts // Used to generate and test the access token
├── index.ts // Initializes the MCP server and tools
├── package.json
├── trade.ts // Contains buy/sell order functions
└── tsconfig.json
Getting Started
Prerequisites
- Node.js alternative: Bun (v1.2.10 or higher)
- A Zerodha developer account with API key and secret
- A valid request token (refer to the video link below for guidance)
Installation
Clone the repository:
git clone https://github.com/saiabhiramjaini/Zerodha-MCP.git
cd Zerodha-MCP
Install dependencies using Bun:
bun install
Environment Setup
Create a .env file in the root directory with the following variables:
KITE_API_KEY=your_kite_api_key
KITE_API_SECRET=your_kite_api_secret
KITE_REQUEST_TOKEN=your_generated_request_token
KITE_ACCESS_TOKEN=your_generated_access_token
To learn how to get your access token, refer to this video guide
Run the MCP Server
bun run index.ts
This will start the MCP server and expose two tools:
buy-stocksell-stock
Tools
1. buy-stock
Executes a real BUY order on Zerodha.
Inputs:
tradingsymbol: string (e.g., "INFY")quantity: number (e.g., 10)
Returns: Confirmation with order ID or an error message.
2. sell-stock
Executes a real SELL order on Zerodha.
Inputs:
tradingsymbol: stringquantity: number
Returns: Confirmation with order ID or an error message.
Videos
- How to Get Zerodha Access Token: Watch here
- Project Demo: Watch here
Tech Stack
- Bun - Fast JavaScript runtime
- TypeScript
- Zerodha KiteConnect
- Model Context Protocol (MCP)
README fetched from the repository 7 days ago. The original is authoritative.