Zerodha
๐น This is code for Zerodha MCP โ you can use it to trade live on the Indian Stock Market ๐ฎ๐ณ๐๐ฐ
claude mcp add --transport stdio maniklakhanpal-zerodha-mcp bun main.ts \ --env API_KEY="your_zerodha_api_key" \ --env API_SECRET="your_zerodha_api_secret"
How to use
Zerodha MCP Server provides tools to interact with Zerodha's KiteConnect API through the MCP protocol. It exposes capabilities to place stock orders, retrieve current holdings, manage mutual fund SIPs, and view mutual fund holdings (experimental). The server handles OAuth-based authentication, token storage, and session management, enabling AI assistants to perform trading actions and fetch portfolio data on your behalf. You can initiate trading commands, query your positions, and manage authentication flow via the included MCP tool definitions described in the repository.
To use it with an MCP-enabled assistant, ensure your environment has Zerodha API credentials and that the OAuth tokens are configured. The server exposes tools such as login, token setting, place order, and holdings retrieval. When integrated with Claude or similar assistants, you can instruct the assistant with natural language prompts like placing a buy order, checking your holdings, or listing SIPs, and the MCP layer will map those requests to the underlying KiteConnect API calls.
How to install
Prerequisites:
- Node.js-compatible Bun runtime installed (https://bun.sh/)
- Zerodha trading account with API credentials (API Key and API Secret)
- Git installed
- Clone the repository
git clone git@github.com:ManikLakhanpal/Zerodha-MCP.git
cd zerodha-mcp
- Install dependencies (via Bun)
bun install
- Create environment configuration Create a .env file in the project root (or use the provided env variables in mcp_config):
# Example values
export API_KEY=your_zerodha_api_key
export API_SECRET=your_zerodha_api_secret
- Run the MCP server
bun main.ts
- Verify startup and usage
- Ensure the server starts without errors
- Use the MCP tools (login, set tokens, place stock orders, get holdings, get SIPs, and get MF holdings) as described in the repository README
Additional notes
Tips and notes:
- Token management is automatic; tokens are stored in config/tokens.json when available
- Be mindful of Zerodha API rate limits; implement proper error handling for retries
- The mutual fund holdings tool is experimental; results may vary and may require additional permissions
- Ensure .env/API credentials are kept secure and not committed to version control
- The main entry point uses Bun; if you prefer Node.js, you may adapt startup commands accordingly, but Bun is the recommended runtime for this repository
Related MCP Servers
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
mcp -arangodb
This is a TypeScript-based MCP server that provides database interaction capabilities through ArangoDB. It implements core database operations and allows seamless integration with ArangoDB through MCP tools. You can use it wih Claude app and also extension for VSCode that works with mcp like Cline!
CodeRAG
Advanced graph-based code analysis for AI-assisted software development
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!