Skip to content

Commit 045f69c

Browse files
anshuljain90Anshul Jain
andauthored
feat: Add Zerodha Kite Connect 3.0 MCP server (#258)
- Adds MCP server for Zerodha's Kite Connect API - Enables trading operations for Indian stock markets (NSE, BSE) - Provides tools for orders, portfolio, market data, and account management - Includes comprehensive tool definitions in tools.json - MIT licensed implementation available at github.com/anshuljain90/zerodha-kite-mcp Co-authored-by: Anshul Jain <[email protected]>
1 parent 02e867b commit 045f69c

File tree

2 files changed

+246
-0
lines changed

2 files changed

+246
-0
lines changed

servers/zerodha-kite/server.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: zerodha-kite
2+
image: mcp/zerodha-kite
3+
type: server
4+
meta:
5+
category: finance
6+
tags:
7+
- finance
8+
- trading
9+
- stocks
10+
- india
11+
about:
12+
title: Zerodha Kite Connect
13+
description: MCP server for Zerodha Kite Connect API - India's leading stock broker trading platform. Execute trades, manage portfolios, and access real-time market data for NSE, BSE, and other Indian exchanges.
14+
icon: https://avatars.githubusercontent.com/u/34680622?s=300&v=4
15+
source:
16+
project: https://github.com/anshuljain90/zerodha-kite-mcp
17+
config:
18+
description: Configure your Zerodha Kite Connect API credentials. Requires an active Zerodha trading account and Kite Connect developer app.
19+
secrets:
20+
- name: zerodha-kite.api_secret
21+
env: KITE_API_SECRET
22+
example: your_api_secret_here
23+
env:
24+
- name: KITE_API_KEY
25+
example: your_api_key_here
26+
value: '{{zerodha-kite.kite_api_key}}'
27+
- name: KITE_ACCESS_TOKEN
28+
example: your_access_token_here
29+
value: '{{zerodha-kite.kite_access_token}}'
30+
- name: KITE_REDIRECT_URL
31+
example: http://localhost:3000/redirect
32+
value: '{{zerodha-kite.kite_redirect_url}}'
33+
parameters:
34+
type: object
35+
properties:
36+
kite_api_key:
37+
type: string
38+
description: Your Kite Connect API key from the developer console
39+
kite_access_token:
40+
type: string
41+
description: Access token obtained after OAuth authentication (optional - can be generated at runtime)
42+
kite_redirect_url:
43+
type: string
44+
description: OAuth redirect URL configured in your Kite Connect app
45+
required:
46+
- kite_api_key

servers/zerodha-kite/tools.json

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
[
2+
{
3+
"name": "place_order",
4+
"description": "Place a new order in the market",
5+
"arguments": [
6+
{
7+
"name": "exchange",
8+
"type": "string",
9+
"desc": "Trading exchange (NSE, BSE, NFO, CDS, MCX)"
10+
},
11+
{
12+
"name": "tradingsymbol",
13+
"type": "string",
14+
"desc": "Trading symbol (e.g., RELIANCE, INFY)"
15+
},
16+
{
17+
"name": "transaction_type",
18+
"type": "string",
19+
"desc": "BUY or SELL"
20+
},
21+
{
22+
"name": "quantity",
23+
"type": "number",
24+
"desc": "Number of shares/lots"
25+
},
26+
{
27+
"name": "order_type",
28+
"type": "string",
29+
"desc": "Order type (MARKET, LIMIT, SL, SL-M)"
30+
},
31+
{
32+
"name": "product",
33+
"type": "string",
34+
"desc": "Product type (CNC for delivery, MIS for intraday, NRML for F&O)"
35+
},
36+
{
37+
"name": "price",
38+
"type": "number",
39+
"desc": "Price for LIMIT orders (optional)"
40+
},
41+
{
42+
"name": "trigger_price",
43+
"type": "number",
44+
"desc": "Trigger price for SL orders (optional)"
45+
}
46+
]
47+
},
48+
{
49+
"name": "modify_order",
50+
"description": "Modify an existing pending order",
51+
"arguments": [
52+
{
53+
"name": "order_id",
54+
"type": "string",
55+
"desc": "Unique order ID"
56+
},
57+
{
58+
"name": "quantity",
59+
"type": "number",
60+
"desc": "New quantity (optional)"
61+
},
62+
{
63+
"name": "price",
64+
"type": "number",
65+
"desc": "New price (optional)"
66+
},
67+
{
68+
"name": "order_type",
69+
"type": "string",
70+
"desc": "New order type (optional)"
71+
},
72+
{
73+
"name": "trigger_price",
74+
"type": "number",
75+
"desc": "New trigger price (optional)"
76+
}
77+
]
78+
},
79+
{
80+
"name": "cancel_order",
81+
"description": "Cancel a pending order",
82+
"arguments": [
83+
{
84+
"name": "order_id",
85+
"type": "string",
86+
"desc": "Unique order ID to cancel"
87+
}
88+
]
89+
},
90+
{
91+
"name": "get_positions",
92+
"description": "Get all open positions (intraday and overnight)",
93+
"arguments": []
94+
},
95+
{
96+
"name": "get_holdings",
97+
"description": "Get long-term holdings in demat account",
98+
"arguments": []
99+
},
100+
{
101+
"name": "get_margins",
102+
"description": "Get account margins and available funds",
103+
"arguments": []
104+
},
105+
{
106+
"name": "get_quote",
107+
"description": "Get real-time market quotes for a symbol",
108+
"arguments": [
109+
{
110+
"name": "exchange",
111+
"type": "string",
112+
"desc": "Exchange (NSE, BSE, etc.)"
113+
},
114+
{
115+
"name": "tradingsymbol",
116+
"type": "string",
117+
"desc": "Trading symbol"
118+
}
119+
]
120+
},
121+
{
122+
"name": "get_historical_data",
123+
"description": "Get historical candlestick data",
124+
"arguments": [
125+
{
126+
"name": "instrument_token",
127+
"type": "string",
128+
"desc": "Unique instrument identifier"
129+
},
130+
{
131+
"name": "from_date",
132+
"type": "string",
133+
"desc": "Start date (YYYY-MM-DD)"
134+
},
135+
{
136+
"name": "to_date",
137+
"type": "string",
138+
"desc": "End date (YYYY-MM-DD)"
139+
},
140+
{
141+
"name": "interval",
142+
"type": "string",
143+
"desc": "Time interval (minute, 3minute, 5minute, 10minute, 15minute, 30minute, 60minute, day)"
144+
}
145+
]
146+
},
147+
{
148+
"name": "get_instruments",
149+
"description": "Get list of all tradeable instruments",
150+
"arguments": [
151+
{
152+
"name": "exchange",
153+
"type": "string",
154+
"desc": "Exchange to fetch instruments for"
155+
}
156+
]
157+
},
158+
{
159+
"name": "get_orders",
160+
"description": "Get list of all orders for the day",
161+
"arguments": []
162+
},
163+
{
164+
"name": "get_trades",
165+
"description": "Get list of all executed trades",
166+
"arguments": []
167+
},
168+
{
169+
"name": "get_order_history",
170+
"description": "Get complete history of an order including modifications",
171+
"arguments": [
172+
{
173+
"name": "order_id",
174+
"type": "string",
175+
"desc": "Unique order ID"
176+
}
177+
]
178+
},
179+
{
180+
"name": "get_profile",
181+
"description": "Get user profile information",
182+
"arguments": []
183+
},
184+
{
185+
"name": "get_ltp",
186+
"description": "Get last traded price for multiple instruments",
187+
"arguments": [
188+
{
189+
"name": "instruments",
190+
"type": "array",
191+
"desc": "Array of exchange:tradingsymbol pairs"
192+
}
193+
]
194+
},
195+
{
196+
"name": "get_market_status",
197+
"description": "Check if markets are open or closed",
198+
"arguments": []
199+
}
200+
]

0 commit comments

Comments
 (0)