Overview
What is Zerodha MCP Integration?
This server integrates Zerodha's trading platform with Claude AI using the Model Context Protocol (MCP), allowing you to interact with your Zerodha trading account directly through Claude. It is designed for Zerodha users who want to execute trades, check portfolio details, and manage mutual funds via natural language commands.
How to use Zerodha MCP Integration?
Install via Smithery with npx -y @smithery/cli install @aptro/zerodha-mcp --client claude or manually: create a Zerodha developer account, create an app with redirect URL http://127.0.0.1:5000/zerodha/auth/redirect, obtain API key and secret, set them in a .env file, install dependencies (kiteconnect, fastapi, uvicorn, python-dotenv, httpx), and run mcp install main.py. On first use, Claude will start a local server on port 5000 to handle authentication.
Key features of Zerodha MCP Integration
- Check and initiate authentication with Zerodha
- Retrieve portfolio holdings, positions, and margins
- Place stock trading orders and get quotes
- Fetch historical price data for symbols
- View and manage mutual fund holdings and orders
- Create, modify, and cancel mutual fund SIPs
Use cases of Zerodha MCP Integration
- Ask Claude to check current margins and open positions
- Place a market order for shares without leaving the chat
- View mutual fund holdings and recent orders
- Set up a new monthly SIP for a specific fund
- Browse available mutual funds on Zerodha
FAQ from Zerodha MCP Integration
What authentication is required?
You need a Zerodha developer account, an API key and secret from a created app, and a one-time browser login. The access token is stored locally for future sessions.
How are credentials stored?
API credentials are stored only in a local .env file. Access tokens are saved in a .tokens file. No credentials are transmitted to Claude or any third parties.
What is the session duration?
The session remains active until the token expires, typically after 24 hours. When expired, Claude automatically reinitiates the login flow.
What dependencies are needed?
The server requires Python packages: kiteconnect, fastapi, uvicorn, python-dotenv, and httpx. It uses a local HTTP server on port 5000 for the authentication redirect.
Can I place live trades with this server?
Yes, you can place buy/sell orders, get real-time quotes, and manage mutual fund orders and SIPs. Be aware of the risks of live trading; the server does not add any safeguards beyond what Zerodha provides.