Zerodha MCP Server
Servidor MCP de Zerodha
Consulta tu cuenta de trading de Zerodha a través de MCP (Model Context Protocol). Funciona con Claude Code, Claude Desktop, Cursor y otras herramientas de IA compatibles con MCP.
Herramientas disponibles
Herramienta | Descripción |
| Saldo disponible y márgenes |
| Participaciones en demat a largo plazo |
| Posiciones intradía/F&O con P&L |
| Historial de órdenes de hoy |
| Resumen combinado de P&L |
| Último precio negociado de cualquier instrumento |
| Datos OHLC de cualquier instrumento |
| Resumen histórico de P&L para un rango de fechas (máximo 3 meses) |
| Desglose diario de P&L para un rango de fechas (máximo 3 meses) |
Related MCP server: Trade-MCP
Instalación
git clone https://github.com/anish5256/zerodha-mcp.git
cd zerodha-mcp
pip install -e .Configuración
Variables de entorno
El servidor requiere estas variables de entorno para la autenticación:
Variable | Descripción |
| Tu ID de cliente de Zerodha (ej., |
| Tu contraseña de inicio de sesión de Zerodha |
| Tu clave secreta TOTP (cadena base32 de 32 caracteres) |
Obtención de tu clave TOTP
Tu clave secreta TOTP es el código de 32 caracteres que utilizaste al configurar la autenticación de dos factores (2FA) en Google Authenticator/Authy. Se ve así: ABCD1234EFGH5678IJKL9012MNOP3456
Si no la tienes guardada, restablece la 2FA en Zerodha Console para obtener una nueva.
Configuración por plataforma
Claude Code (CLI)
Añade a ~/.mcp.json:
{
"mcpServers": {
"zerodha": {
"command": "python",
"args": ["/path/to/zerodha-mcp/server.py"],
"env": {
"ZERODHA_USER_ID": "YOUR_USER_ID",
"ZERODHA_PASSWORD": "YOUR_PASSWORD",
"ZERODHA_TOTP_KEY": "YOUR_TOTP_SECRET"
}
}
}
}Luego reinicia Claude Code.
Claude Desktop (macOS)
Edita ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"zerodha": {
"command": "python",
"args": ["/path/to/zerodha-mcp/server.py"],
"env": {
"ZERODHA_USER_ID": "YOUR_USER_ID",
"ZERODHA_PASSWORD": "YOUR_PASSWORD",
"ZERODHA_TOTP_KEY": "YOUR_TOTP_SECRET"
}
}
}
}Luego reinicia Claude Desktop.
Claude Desktop (Windows)
Edita %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"zerodha": {
"command": "python",
"args": ["C:\\path\\to\\zerodha-mcp\\server.py"],
"env": {
"ZERODHA_USER_ID": "YOUR_USER_ID",
"ZERODHA_PASSWORD": "YOUR_PASSWORD",
"ZERODHA_TOTP_KEY": "YOUR_TOTP_SECRET"
}
}
}
}Luego reinicia Claude Desktop.
Cursor
Añade a la configuración MCP de Cursor (Settings > MCP):
{
"zerodha": {
"command": "python",
"args": ["/path/to/zerodha-mcp/server.py"],
"env": {
"ZERODHA_USER_ID": "YOUR_USER_ID",
"ZERODHA_PASSWORD": "YOUR_PASSWORD",
"ZERODHA_TOTP_KEY": "YOUR_TOTP_SECRET"
}
}
}Otros clientes MCP
Para cualquier cliente compatible con MCP, configura:
Comando:
pythonArgumentos:
["/path/to/zerodha-mcp/server.py"]Variables de entorno:
ZERODHA_USER_ID= Tu ID de clienteZERODHA_PASSWORD= Tu contraseñaZERODHA_TOTP_KEY= Tu secreto TOTP
Ejemplos de uso
Una vez configurado, pregúntale a tu asistente de IA:
"¿Cuál es el valor actual de mi cartera?"
"Muéstrame mis posiciones abiertas"
"¿Cuál es mi P&L de hoy?"
"¿Cuántos fondos tengo disponibles?"
"¿Cuál es el LTP de RELIANCE?"
"Obtén el OHLC para NIFTY 50"
"¿Cuál fue mi beneficio en F&O en 2024?"
"Muéstrame mi P&L diario del último mes"
Notas de seguridad
Tus credenciales se almacenan localmente en tu archivo de configuración MCP
Las credenciales nunca se envían al modelo de IA, solo se utilizan en el lado del servidor
Los tokens se almacenan en caché localmente en
zerodha_enctoken.txtyzerodha_console_token.txt(ignorados por git)Cada usuario debe configurar sus propias credenciales en su propia máquina
Licencia
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Indian broker accounts for AI agents: positions, holdings, orders, P&L, option chains, 10+ brokers.
OpenFinance gives any AI agent easy trading across every major market through one hosted MCP server. Trade crypto spot and perpetuals on Hyperliquid with market, limit and TWAP orders, leverage and margin control. Trade stocks, indices, commodities, forex and pre-IPO names as Hyperliquid HIP-3 perps. Trade Polymarket prediction markets with odds, order books, positions, PnL and trader leaderboards. Swap and bridge across 40+ EVM chains and Solana with Relay and Jupiter, find memecoins across 200+ chains, launch tokens on Robinhood Chain and Solana, and buy crypto with card, bank or UPI. Write actions are designed to ask for your confirmation first. Connect with OAuth (sign in to OpenFinance and approve) or an API key. Works with Claude, ChatGPT, Cursor, VS Code, Codex and any MCP client. No install. Home: https://openfinance.tech/agents · Docs: https://docs.openfinance.tech · GitHub: https://github.com/openfinance-tech/mcp
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the Zerodha trading platform for placing stock orders, viewing portfolio holdings, and managing mutual fund investments. Provides secure OAuth authentication and real-time trading capabilities through Zerodha's official API.1-
- FlicenseNot gradedqualityDmaintenanceEnables trading automation through Zerodha Kite Connect API, allowing users to place buy/sell orders and fetch holdings via MCP tools accessible to Claude Desktop and other MCP-compatible clients.-
- AlicenseNot gradedqualityDmaintenanceEnables natural language management of Zerodha trading accounts, including placing orders, checking portfolio, and viewing positions through MCP integration.32Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the Zerodha trading platform for placing stock orders, viewing holdings, and managing mutual fund investments through the MCP protocol.4-