Zerodha Trading Integration
STDIOIntegrates Zerodha trading platform with Claude AI using MCP framework for direct account interaction.
Integrates Zerodha trading platform with Claude AI using MCP framework for direct account interaction.
This project integrates Zerodha's trading platform with Claude AI using the Multi-Cloud Plugin (MCP) framework, allowing you to interact with your Zerodha trading account directly through Claude.
To install zerodha-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @aptro/zerodha-mcp --client claude
http://127.0.0.1:5000/zerodha/auth/redirect
After creating your app, you'll receive:
These credentials will be displayed on your app's details page.
.env
file in the root directory of this projectKITE_API_KEY=your_api_key_here
KITE_API_SECRET=your_api_secret_here
Replace your_api_key_here
and your_api_secret_here
with the actual credentials from step 3.
Make sure you have all required dependencies installed:
uv pip install kiteconnect fastapi uvicorn python-dotenv httpx
Install the MCP config on your Claude desktop app:
mcp install main.py
This command registers the Zerodha plugin with Claude, making all trading functionality available to the AI.
After setup, you can interact with your Zerodha account via Claude using the following features:
Can you please check if I'm logged into my Zerodha account and authenticate if needed?
What are my current margins on Zerodha?
Show me my current holdings on Zerodha
What positions do I currently have open on Zerodha?
What's the current price of RELIANCE and INFY on NSE?
Place a buy order for 10 shares of INFY at market price on NSE
Can you show me the historical price data for SBIN for the last 30 days?
Show me my mutual fund holdings on Zerodha
List all my mutual fund orders on Zerodha
Place a buy order for ₹5000 in the mutual fund with symbol INF090I01239
Cancel my mutual fund order with order ID 123456789
Show all my active SIPs on Zerodha
Set up a monthly SIP of ₹2000 for the fund with symbol INF090I01239 for 12 installments
Change my SIP with ID 987654321 to ₹3000 per month
Cancel my SIP with ID 987654321
Show me a list of available mutual funds on Zerodha
The first time you use any Zerodha functionality, Claude will:
Your session will remain active until the token expires (typically 24 hours). When the token expires, Claude will automatically initiate the login flow again.
This plugin offers the following MCP tools that Claude can use:
check_and_authenticate
- Verifies authentication status and initiates login if neededinitiate_login
- Starts the Zerodha login flowget_request_token
- Retrieves the request token after loginget_holdings
- Retrieves portfolio holdingsget_positions
- Gets current positionsget_margins
- Retrieves account marginsplace_order
- Places a trading orderget_quote
- Gets quotes for specified symbolsget_historical_data
- Retrieves historical price dataget_mf_orders
- Retrieves mutual fund ordersplace_mf_order
- Places a mutual fund ordercancel_mf_order
- Cancels a mutual fund orderget_mf_instruments
- Gets available mutual fund instrumentsget_mf_holdings
- Retrieves mutual fund holdingsget_mf_sips
- Gets active SIPsplace_mf_sip
- Creates a new SIPmodify_mf_sip
- Modifies an existing SIPcancel_mf_sip
- Cancels a SIP.tokens
file and restart the authentication process.env
file are correct.env
file.tokens
file in the project directory