Zerodha MCP Server & Client
About
A Python-based trading assistant that connects to a Zerodha MCP server to help users manage their trading account. It integrates with Zerodha’s API via the Model Context Protocol and supports both Agno and Google ADK agent frameworks for natural-language interaction.
Details
- License
- Apache-2.0 license
Explore
- Account Management: Manage Zerodha trading account, orders, and positions
- Interactive Chat Interface: Natural language interface for trading operations
- MCP Integration: Built on the Model Context Protocol for standardized communication
- Zerodha API Integration: Uses Zerodha's API to interact with the trading platform
- Agno Agent: Uses Agno Agent to interact with the trading platform
- Google ADK Agent: Uses Google ADK Agent to interact with the trading platform
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Zerodha MCP Server & ClientCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
- Python
- Zerodha trading account with Personal API access from here
- Zerodha API key and secret
- OpenAI API key (for Agno Agent)
- Gemini API key or Application Default Credentials (for Google ADK Agent)
cp .env.example .env
ZERODHA_API_KEY=your_api_key
ZERODHA_API_SECRET=your_api_secret
PORT=8001
SERVER_MODE=sse # or stdio
MCP_HOST=localhost
MCP_PORT=8001
OPENAI_API_KEY=your_openai_api_key
The server provides a set of tools for interacting with the Zerodha trading platform. To start the server:
1. Make sure your .env file is properly configured with your Zerodha API credentials.
2. Start the server using one of the following methods:
python server.py
This project provides two client implementations: one using the Agno framework (client/agno_client.py) and another using Google ADK (client/google_adk_client.py). Both connect to the MCP server and provide an interactive interface for trading operations.
1. Ensure your .env file includes OPENAI_API_KEY.
2. Start the client using one of the following methods:
bash
python client/agno_client.py
1. Ensure you have authenticated with Google AI, either by setting the GOOGLE_API_KEY environment variable (and uncommenting it in .env) or by using Application Default Credentials (run gcloud auth application-default login).
2. Start the client using one of the following methods:
```bash
- Place Orders: Place orders in the trading platform
- Modify Orders: Modify orders in the trading platform
- Cancel Orders: Cancel orders in the trading platform
- Get Orders: Get orders in the trading platform
- Get Order History: Get order history in the trading platform
- Get Order Trades: Get order trades in the trading platform
- Get Margins: Get margins in the trading platform
- Get Holdings: Get holdings in the trading platform
- Get Positions: Get positions in the trading platform
- Get User Profile: Get user profile in the trading platform
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"zerodha mcp server & client": {
"zerodha-mcp-mtwn105": {
"command": "python",
"args": [
"-m",
"venv",
"venv"
]
}
}
}
}
McpServers
{
"zerodha-mcp-mtwn105": {
"command": "python",
"args": [
"-m",
"venv",
"venv"
]
}
}
A Python-based trading assistant that connects to a Zerodha MCP server to help users manage their trading account.
Features
- Account Management: Manage Zerodha trading account, orders, and positions
- Interactive Chat Interface: Natural language interface for trading operations
- MCP Integration: Built on the Model Context Protocol for standardized communication
- Zerodha API Integration: Uses Zerodha's API to interact with the trading platform
- Agno Agent: Uses Agno Agent to interact with the trading platform
- Google ADK Agent: Uses Google ADK Agent to interact with the trading platform
Tech Stack
- Protocol: Model Context Protocol (MCP)
- Agent Framework:
- Agno
- Google ADK
Tools
- Place Orders: Place orders in the trading platform
- Modify Orders: Modify orders in the trading platform
- Cancel Orders: Cancel orders in the trading platform
- Get Orders: Get orders in the trading platform
- Get Order History: Get order history in the trading platform
- Get Order Trades: Get order trades in the trading platform
- Get Margins: Get margins in the trading platform
- Get Holdings: Get holdings in the trading platform
- Get Positions: Get positions in the trading platform
- Get User Profile: Get user profile in the trading platform
Prerequisites
- Python
- Zerodha trading account with Personal API access from here
- Zerodha API key and secret
- OpenAI API key (for Agno Agent)
- Gemini API key or Application Default Credentials (for Google ADK Agent)
Installation
1. Clone the repository:
git clone https://github.com/mtwn105/zerodha-mcp-server-client.git
cd zerodha-mcp-server-client
2. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
3. Install dependencies:
pip install -r requirements.txt
4. Set up environment variables:
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



