Zerodha MCP Server
Zerodha MCPサーバー
MCP (Model Context Protocol) を介してZerodha取引口座を照会します。Claude Code、Claude Desktop、Cursor、およびその他のMCP互換AIツールで動作します。
利用可能なツール
ツール | 説明 |
| 利用可能な残高と証拠金 |
| 長期デマット保有銘柄 |
| 損益を含むデイトレード/F&Oポジション |
| 今日の注文履歴 |
| 損益の合計サマリー |
| 任意の銘柄の最終取引価格 (LTP) |
| 任意の銘柄のOHLCデータ |
| 指定期間(最大3ヶ月)の損益サマリー |
| 指定期間(最大3ヶ月)の日次損益内訳 |
Related MCP server: Trade-MCP
インストール
git clone https://github.com/anish5256/zerodha-mcp.git
cd zerodha-mcp
pip install -e .設定
環境変数
サーバーの認証には以下の環境変数が必要です:
変数 | 説明 |
| ZerodhaクライアントID (例: |
| Zerodhaログインパスワード |
| TOTPシークレットキー (32文字のbase32文字列) |
TOTPキーの取得
TOTPシークレットキーは、Google AuthenticatorやAuthyで2要素認証を設定した際に使用した32文字のコードです。例: ABCD1234EFGH5678IJKL9012MNOP3456
保存していない場合は、Zerodha Consoleで2要素認証をリセットして新しいキーを取得してください。
プラットフォーム別のセットアップ
Claude Code (CLI)
~/.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"
}
}
}
}その後、Claude Codeを再起動してください。
Claude Desktop (macOS)
~/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"
}
}
}
}その後、Claude Desktopを再起動してください。
Claude Desktop (Windows)
%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"
}
}
}
}その後、Claude Desktopを再起動してください。
Cursor
CursorのMCP設定 (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"
}
}
}その他のMCPクライアント
MCP互換クライアントの場合は、以下のように設定してください:
コマンド:
python引数:
["/path/to/zerodha-mcp/server.py"]環境変数:
ZERODHA_USER_ID= クライアントIDZERODHA_PASSWORD= パスワードZERODHA_TOTP_KEY= TOTPシークレット
使用例
設定が完了したら、AIアシスタントに以下のように尋ねてください:
"現在のポートフォリオの価値は?"
"オープンポジションを見せて"
"今日の損益は?"
"利用可能な資金はいくら?"
"RELIANCEのLTPは?"
"NIFTY 50のOHLCを取得して"
"2024年のF&Oの利益はいくらでしたか?"
"先月の日次損益を表示して"
セキュリティに関する注意点
認証情報はMCP設定ファイル内にローカルで保存されます
認証情報はAIモデルには送信されず、サーバー側でのみ使用されます
トークンはローカルの
zerodha_enctoken.txtおよびzerodha_console_token.txtにキャッシュされます (gitignored)各ユーザーは自身のマシン上で個別に認証情報を設定する必要があります
ライセンス
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-