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
Trade across 22+ exchanges and brokers from any MCP-capable AI agent, no install required.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Brazilian Open Finance MCP — 30+ banks (Itaú, Nubank, etc.) to Claude/Cursor. Read-only.
Agentic brokerage access to a US brokerage account: quotes, orders, positions, cash and documents.
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 gradedqualityCmaintenanceEnables 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.-
- FlicenseNot gradedqualityDmaintenanceEnables AI models to interact with the Zerodha trading platform for portfolio management, trading, and account operations through natural language.3-
- AlicenseNot gradedqualityDmaintenanceEnables natural language management of Zerodha trading accounts, including placing orders, checking portfolio, and viewing positions through MCP integration.32Apache 2.0