Kite Connect MCP

io.github.techfreakworm由 GitHub 帳號 techfreakworm 發布v0.1.1更新於 Nov 4, 2026

Zerodha Kite Connect v3 for AI agents: orders (dry-run by default), GTT, alerts, portfolio, quotes

發布方自己的服務:Kite

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

自架的 Zerodha Kite Connect v3 伺服器,讓助理讀取印度券商帳戶、行情與訂單,並可預覽或下單交易。

可以做什麼
  • 檢查工作階段狀態、發起或完成每日 Kite 登入、登出
  • 讀取個人資料、資金與保證金、委託簿、委託歷史、成交、持股、部位與拍賣
  • 預覽、下單、修改與取消委託、GTT 和提醒,預設為試運行並需確認權杖
  • 取得報價、OHLC、最新價、歷史K線,並搜尋商品與共同基金
  • 計算單筆與組合保證金及費用,轉換部位產品類型
  • 查看安全狀態與稽核日誌,並啟動緊急停止開關
適用情境
適合想讓 AI 助理操作 Zerodha 帳戶的情境:檢視投資組合與損益、研究商品與價格,或謹慎準備並確認交易。較適合個人自架自己的 Kite Connect 應用,而非多人共用環境。
執行需求
透過 uvx 或 pip 以 stdio 在本機執行(需 Python 3.11+),也可用 Docker。需要 Zerodha 帳戶與 Kite Connect 應用;必須提供 KITE_API_KEY 與 KITE_API_SECRET(或 KITE_API_SECRET_FILE)。行情資料需付費 Connect 方案(每個 API key 每月 500 盧比)。實盤下單需在開發者主控台登記靜態 IP。每天早上需完成一次登入。
安裝前請注意
啟用實盤後可在真實券商帳戶上實際下單。它會處理 KITE_API_KEY 與 KITE_API_SECRET 密鑰,並在磁碟保存存取權杖。寫入類工具會改變帳戶狀態(委託、GTT、提醒、部位轉換、持股授權),預設僅為試運行;建議維持 KITE_MCP_READ_ONLY 並設定較低額度上限,逐項核對確認。專案仍為 beta,實盤寫入未經測試。交易有風險,Kite Connect 資料不得再散布。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Kite Connect MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

kite-connect-mcp

[CI] [PyPI] [Licence: MIT]

A self-hostable Model Context Protocol server for the Zerodha Kite Connect v3 API. Run it on your own machine or server with your own Kite Connect app, and let an AI assistant read your account, market data and orders. Every write is a dry run by default.

Status: beta (0.x). Every Kite Connect v3 capability is covered and tested offline against a fake Kite. The read tools, the margin and charge calculators and the ticker have also been checked against the live API; live writes (orders, GTTs, alerts, mutual funds) have not, so expect rough edges there and report them. Changes are listed in CHANGELOG.md. This project is not affiliated with or endorsed by Zerodha.

Why another Kite MCP server?

Zerodha publishes an official server (zerodha/kite-mcp-server) and hosts it at mcp.kite.trade. This project differs in three ways:

  • It covers the whole paid Kite Connect API. That includes alerts, GTTs, order and basket margins, charges, position conversion, holdings authorisation, auctions, mutual funds and the WebSocket ticker.
  • It's built for one person self-hosting. The daily token is persisted and shared by every client you connect.
  • It has a safety layer for orders: dry runs, two-step confirmation, value caps, allow-lists, a kill switch, an audit log and rate limiting.

The full evaluation and reasoning are in docs/DECISION.md.

What you need

  • A Zerodha account, and a Kite Connect app from the developer console.
    • Connect (paid, ₹500/month per API key) includes live quotes, the WebSocket and historical candles.
    • Personal (free) covers orders, GTTs, alerts, portfolio and margins, but no market data. Market-data tools return a clear "needs the paid plan" error.
  • Python 3.11+ (or Docker).
  • To place live orders: the order requests must come from a static IP registered in the developer console. This is a SEBI/NSE rule, in force since April 2026. Reads work from any IP.

The developer-console steps are in docs/KITE_SETUP.md: creating the app, the API key and secret, the redirect and postback URLs, the subscription, and the static IP.

Quick start (local, stdio)

bash
# installuv tool install kite-connect-mcp        # or: pipx install kite-connect-mcp  /  pip install kite-connect-mcp# or run without installing:  uvx kite-connect-mcp --help# or the image:               docker pull ghcr.io/techfreakworm/kite-connect-mcp
# configure: credentials from env vars or files (mode 600)export KITE_API_KEY=your_api_keyexport KITE_API_SECRET_FILE=~/.config/kite-connect-mcp/api_secret
kite-connect-mcp check-config   # validates settings, never prints credentialskite-connect-mcp login --listen # prints the Kite login link and waits for the redirect (managed mode)kite-connect-mcp status         # session and safety status

For login --listen, register http://127.0.0.1:8765/callback as your app's redirect URL. Every setting is listed in docs/CONFIGURATION.md.

Add it to an MCP client, e.g. Claude Desktop (claude_desktop_config.json) or any client that launches stdio servers:

json
{  "mcpServers": {    "kite": {      "command": "kite-connect-mcp",      "args": ["serve"],      "env": { "KITE_API_KEY": "your_api_key", "KITE_API_SECRET_FILE": "/home/you/.config/kite-connect-mcp/api_secret" }    }  }}

To run it on a server over HTTP, see docs/SELF_HOSTING.md. It covers systemd and Docker, a reverse proxy with TLS, bearer-token auth, and the login callback.

The safety model, in short

GuardDefault
Every write tool takes dry_runtrue: validate, run the checks, preview the exact request and Kite's margin calculation; send nothing
Live trading switchoff (KITE_MCP_TRADING_MODE=dry_run)
Confirmationa live write needs the single-use confirmation_token from a dry run of the identical call (or, if you opt in, an explicitly allow-listed instrument)
Value caps₹10,000 per order, ₹50,000 per day, 20 live orders per day
Allow-listsinstruments, exchanges, products, varieties, order types, sides (all optional)
Read-only modeKITE_MCP_READ_ONLY=true hides every write tool, and the HTTP client refuses write endpoints too
Kill switcha file; a tool can switch it on, only a person can switch it off
Audit logevery dry run, refusal, live send and result, as JSON lines; the intent is fsynced before sending
Rate limitskept under Kite's 1/s (quotes), 3/s (historical), 10/s (orders and the rest), 400 orders/min
Retriesreads back off and retry; writes are never retried. A timeout is reported as an unknown outcome: check the order book before trying again

Details: docs/SAFETY.md.

Sessions and the daily login

Kite access tokens expire every day at about 06:00 IST. A request token is single-use. Logging in again with the same API key invalidates the previous access token. So one app should have exactly one program that owns the daily login.

  • managed mode (default). This server owns the login. The login tool (or kite-connect-mcp login) gives you the link. Kite redirects to this server's /callback, which checks the one-time state, exchanges the request_token, and stores the token with mode 600.
  • external mode. Another program owns the login and writes a token file. This server only reads that file, picks up the new token every morning without a restart, and never writes, deletes or logs out that token.

Tools

58 tools in 11 toolsets (53 by default: the mutual-fund writes are opt-in). Tool names follow the official server where one exists, so prompts carry over. Pick toolsets with KITE_MCP_TOOLSETS and hide single tools with KITE_MCP_EXCLUDED_TOOLS; kite-connect-mcp tools lists what your configuration exposes.

ToolsetTools
sessionsession_status, login, complete_login, logout
accountget_profile, get_margins
ordersplace_order, modify_order, cancel_order, get_orders, get_order_history, get_trades, get_order_trades
gttget_gtts, get_gtt, place_gtt_order, modify_gtt_order, delete_gtt_order
alertsget_alerts, get_alert, get_alert_history, create_alert (simple and ATO), modify_alert, delete_alerts
portfolioget_holdings, get_positions, get_auctions, convert_position, authorise_holdings
marketget_quotes, get_ohlc, get_ltp, get_historical_data, search_instruments, get_instrument, get_instruments_status, refresh_instruments
marginsget_order_margins, get_basket_margins, get_order_charges
mfget_mf_holdings, get_mf_orders, get_mf_sips, search_mf_instruments; opt-in: place_mf_order, cancel_mf_order, place_mf_sip, modify_mf_sip, cancel_mf_sip
tickerticker_subscribe, ticker_unsubscribe, ticker_get_ticks, ticker_status, ticker_order_updates, ticker_stop
safetyget_safety_status, get_audit_log, engage_kill_switch

Every argument of every tool is in docs/TOOLS.md.

Development

bash
git clone https://github.com/techfreakworm/kite-connect-mcp && cd kite-connect-mcppython -m venv .venv && .venv/bin/pip install -e ".[dev]".venv/bin/pytest            # never touches the network: Kite is faked in-process.venv/bin/ruff check . && .venv/bin/ruff format --check .

See CONTRIBUTING.md. Security reports: SECURITY.md.

Disclaimer

Trading involves risk. This software can place real orders on a real brokerage account when you configure it to. AI systems are unpredictable: keep the caps low, use dry runs, and review what you confirm. The software is provided "as is", without warranty of any kind (see LICENSE). You are responsible for complying with Zerodha's terms, SEBI's rules (including the static-IP and algo rules) and exchange data policies. Kite Connect data may not be redistributed.

Licence

MIT © 2026 Mayank Gupta

來源:README.md,提交 023049c

工具

53

session_status

Session status

Whether this server is logged in to Kite, and what to do if it is not. Call this first: Kite sessions end every day at 06:00 IST. Returns `logged_in`, the token's `expires_at` and `minutes_left`, `auth_mode` (managed: this server does the daily login; external: another program keeps the token file and this server only reads it), `login_managed_here`, the token file path, `minutes_to_token_reset` (to the next 06:00 IST), and a one-line `safety` summary (trading mode, read-only). The token itself is never shown. verify=true also makes one live call to Kite and adds `verify` with the user id or Kite's error. Use it when a token that looks valid might have been ended elsewhere (logging in again with the same API key, or a master logout on the Kite web, ends the earlier token).

輸入參數verify

login

Log in to Kite

Start the daily Kite login (managed auth mode): returns a one-time login link for the person to open. Show them the `warning` and the link. They log in at Kite themselves (user id, password, 2FA); never ask for their credentials and never try to log in for them. Kite then redirects to the app's registered redirect URL (`redirect_url`). This server completes the login when that redirect reaches it; if the redirect page cannot be reached, the person can copy the request_token from the browser's address bar (or the whole URL) and you call complete_login with it. If a valid token already exists nothing is issued, unless force=true; a new login ends the old token at Kite. In external auth mode another program owns the login: this only explains and shows the status.

輸入參數force

complete_login

Complete the Kite login by hand

Finish a Kite login with a request_token the person copied from the browser's address bar after logging in (use it when the redirect page could not be reached). Exchanges the token with Kite and stores the access token for every client of this server. Request tokens are single use and last only a few minutes. If KITE_MCP_ALLOWED_USER_ID is set, a login by any other Kite account is ended and refused.

輸入參數staterequest_token必填

logout

Log out of Kite

End the Kite API session, delete the stored token and close any open login link (managed auth mode). Two steps: the first call (no confirmation_token) only describes what would happen and returns a confirmation_token; call again with it to do it. Every client using this token is signed out until the next login. It does not log the person out of the Kite web or mobile apps.

輸入參數confirmation_token

get_profile

User profile

The logged-in user's Kite profile: user id, name, email, broker, the exchanges, products and order types enabled for the account, and whether it is a demat consent / POA account (`meta.demat_consent`).

無需輸入參數。

get_margins

Funds and margins

Funds and margins: `available` (cash, opening balance, live balance, collateral, intraday payin) and `utilised` (debits, exposure, span, option premium, holding sales, turnover, ...) per segment, plus `net` (what is left to trade with). Amounts in INR.

輸入參數segment

get_orders

Today's orders

The day's order book (open and executed orders), newest first. Each order has order_id, status, status_message, variety, exchange, tradingsymbol, transaction_type, order_type, product, quantity, filled/pending/cancelled quantities, price, trigger_price, average_price, timestamps and tag.

輸入參數limitoffsetstatustradingsymbol

get_order_history

Order history

Every state an order went through (put order req received, validation pending, open, complete, rejected...), oldest first, with the status_message of each step.

輸入參數order_id必填

get_trades

Today's trades

The day's executed trades (fills), newest first: trade_id, order_id, exchange, tradingsymbol, product, average_price, quantity, transaction_type, fill_timestamp.

輸入參數limitoffset

get_order_trades

Trades of an order

The fills that one order produced.

輸入參數order_id必填

place_order

Place an order (dry run by default)

Place an order. DRY RUN BY DEFAULT: with dry_run=true (the default) nothing is sent; the answer shows the exact request, the estimated value, Kite's margin calculation, every safety check and, when live trading is enabled and the checks pass, a confirmation_token. To send it, repeat the identical call with dry_run=false and that token. Live sends are checked against the server's caps and allow-lists and written to the audit log. Placing an order only registers it with Kite's OMS; check get_order_history for its fate. Live API orders must come from the static IP registered in the Kite developer console (SEBI rule, since April 2026).

輸入參數tagpricedry_runproduct必填varietyexchange必填quantity必填validityautosliceorder_type必填iceberg_legsvalidity_ttl另有 8 個

modify_order

Modify an open order (dry run by default)

Modify an open or pending order: quantity, price, order_type, trigger_price, validity, disclosed_quantity (cover orders: price / trigger_price only). DRY RUN BY DEFAULT, confirmed like place_order. The new value is checked against the per-order cap and any increase against the daily cap. Kite allows 25 modifications per order.

輸入參數pricedry_runvarietyorder_id必填quantityvalidityorder_typetrigger_priceparent_order_idmarket_protectionconfirmation_tokendisclosed_quantity

cancel_order

Cancel an open order (dry run by default)

Cancel an open or pending order. DRY RUN BY DEFAULT, confirmed like place_order (cancelling a stop-loss can increase risk, so it is not exempt). Caps do not apply to cancellations.

輸入參數dry_runvarietyorder_id必填parent_order_idconfirmation_token

get_gtts

GTT order book

The GTT book, newest first: every active GTT and those in other states from the previous 7 days. Each has id (the trigger_id), type (single or two-leg), status, created_at / updated_at / expires_at (IST), condition (exchange, tradingsymbol, trigger_values, last_price at placement), orders (with `result` once an order was placed by the trigger, including the rejection reason if the order failed) and meta.

輸入參數limitoffsetstatus

get_gtt

One GTT

One GTT by its trigger_id, whatever its age or status: type, status, condition, the orders it places and the result of the order if the trigger fired.

輸入參數trigger_id必填

place_gtt_order

Place a GTT (dry run by default)

Place a GTT (good till triggered): Kite watches the price and places a LIMIT order when a trigger value is reached. DRY RUN BY DEFAULT: with dry_run=true (the default) nothing is sent; the answer shows the exact request, the value of each order, Kite's margin calculation, every safety check and, when live trading is enabled and the checks pass, a confirmation_token. To create it, repeat the identical call with dry_run=false and that token. type=single: one trigger value (not equal to last_price) and one order. type=two-leg is an OCO (one cancels other): two trigger values, lower first, with last_price between them, and two orders; orders[i] is placed when trigger_values[i] is reached and the other is dropped (typically a stop-loss below and a target above). last_price is the current price in INR from get_ltp, get_quotes or get_holdings: never guess it. Only LIMIT orders are supported; prices must sit on the tick size. Safety: a GTT uses one slot of the daily order count. Every order is checked against the per-order cap and the allow-lists; for an OCO only one order can execute, so the day's value grows by the larger order, not the sum. MCX, CDS and BCD GTTs cannot be valued and so cannot be sent live. Returns the trigger_id when sent.

輸入參數type必填orders必填dry_runexchange必填last_price必填tradingsymbol必填trigger_values必填confirmation_token

modify_gtt_order

Modify a GTT (dry run by default)

Modify an ACTIVE GTT. Kite replaces the whole trigger, so send its complete new definition: call get_gtt first and change only what you mean to change. The fields are those of place_gtt_order, with the same rules. DRY RUN BY DEFAULT, confirmed like place_gtt_order. Safety: the new orders are checked against the per-order cap and the allow-lists. A modification takes no new slot of the daily order count; only the increase over the stored trigger's value counts toward the day's value cap. Returns the trigger_id when sent.

輸入參數type必填orders必填dry_runexchange必填last_price必填trigger_id必填tradingsymbol必填trigger_values必填confirmation_token

delete_gtt_order

Delete a GTT (dry run by default)

Delete an ACTIVE GTT so it can no longer fire. DRY RUN BY DEFAULT, confirmed like place_gtt_order (deleting a stop-loss GTT can increase risk, so it is not exempt). Caps do not apply to deletions; the allow-lists do, judged on the orders the GTT would have placed. The dry run shows the stored GTT. Returns the trigger_id when sent.

輸入參數dry_runtrigger_id必填confirmation_token

get_alerts

Alerts

Your alerts, newest first. Kite allows at most 500 active alerts per user. Each has uuid, type (simple or ato), name, status (enabled = being evaluated, disabled, deleted = soft-deleted), disabled_reason, the condition (lhs_exchange, lhs_tradingsymbol, lhs_attribute, operator, rhs_type, rhs_constant or the rhs_* instrument), alert_count (how many times it triggered), created_at / updated_at (IST) and, for an ato alert, the basket of orders it places.

輸入參數limitoffsetstatus

get_alert

One alert

One alert by its uuid: type, name, status, condition, alert_count and, for an ato alert, its basket.

輸入參數uuid必填

get_alert_history

When an alert triggered

Every time the alert triggered, newest first: the condition as evaluated, created_at (IST), the market data of the instrument at that moment (last_price, ohlc, volume, oi, ...) and, for an ato alert, the orders it placed (order_meta).

輸入參數uuid必填limitoffset

create_alert

Create an alert (dry run by default)

Create a price alert. DRY RUN BY DEFAULT: with dry_run=true (the default) nothing is sent; the answer shows the exact request, every safety check and, when live trading is enabled and the checks pass, a confirmation_token. To create it, repeat the identical call with dry_run=false and that token. Kite allows at most 500 active alerts per user. The alert watches lhs_attribute (LastTradedPrice) of lhs_exchange:lhs_tradingsymbol and triggers when "value operator right-hand side" becomes true (operators: <=, >=, <, >, ==). The right-hand side is a constant (rhs_type=constant with rhs_constant, in INR for prices) or another instrument's attribute (rhs_type=instrument with rhs_exchange and rhs_tradingsymbol). Indices live on the exchange INDICES (INDICES:NIFTY 50). type=simple only notifies. type=ato (alert triggers order) also places the basket `orders` by itself when the condition becomes true, with no confirmation at that moment: the confirmation you give now covers them. Each basket order is checked like place_order (per-order cap, allow-lists, tick and lot size) and counts toward the daily order count and value caps; MARKET orders are valued at the live price plus a buffer (paid market data needed), MCX/CDS/BCD orders cannot be valued and so cannot be sent live. A simple alert has no orders and no caps. Returns the created alert (with its uuid) when sent.

輸入參數name必填type必填ordersdry_runoperator必填rhs_type必填lhs_exchange必填rhs_constantrhs_exchangelhs_attributerhs_attributelhs_tradingsymbol必填另有 2 個

modify_alert

Modify an alert (dry run by default)

Modify an alert. Kite replaces the whole alert, so send its complete new definition: call get_alert first and change only what you mean to change. The fields are those of create_alert, with the same rules (for an ato alert that includes the whole basket `orders`). DRY RUN BY DEFAULT, confirmed like create_alert. Safety: an ato alert's new basket is checked like place_order. A modification takes no new slot of the daily order count, but the full value of the new basket counts toward the day's value cap. The dry run shows the stored alert. Kite's docs do not say whether a basket sent here replaces the stored basket or adds to it, so the dry run warns when the alert already has one. Returns the updated alert when sent.

輸入參數name必填type必填uuid必填ordersdry_runoperator必填rhs_type必填lhs_exchange必填rhs_constantrhs_exchangelhs_attributerhs_attribute另有 3 個

delete_alerts

Delete alerts (dry run by default)

Delete one or more alerts in a single call (a deleted alert shows status 'deleted'). Deleting an ato alert also removes the orders it would have placed. DRY RUN BY DEFAULT, confirmed like create_alert. No caps or allow-lists apply to a deletion. The dry run lists the alerts that will be deleted. Kite answers with no data when it is sent.

輸入參數uuids必填dry_runconfirmation_token

get_holdings

Holdings

Long-term equity holdings in the demat account, by tradingsymbol, with a `summary` over ALL the holdings that match (not just the page), in INR: invested (average_price x shares), current_value (last_price x shares), pnl (the sum of Kite's pnl) and its percentage, day_change (against the previous close) and its percentage. The shares of a holding are quantity (settled, T+2) plus t1_quantity (bought, not yet delivered). Each holding has tradingsymbol, exchange, isin, product, quantity, t1_quantity, used_quantity, authorised_quantity (for sale at the depository), collateral_quantity, average_price, last_price, close_price, pnl, day_change (per share) and day_change_percentage.

輸入參數limitoffsettradingsymbol

get_positions

Positions

Short-term positions (derivatives and intraday equity). `net` is the actual current position book; `day` is a snapshot of today's buying and selling, useful for intraday P&L. Each position has tradingsymbol, exchange, product, quantity, overnight_quantity, multiplier (lot-size multiplier for P&L: 1 for equity and F&O, the lot size for MCX), average_price, last_price, value, pnl, m2m, unrealised, realised and the buy / sell / day_buy / day_sell quantity, price and value. A `summary` per book totals pnl, m2m, unrealised and realised (INR) and counts the open positions (quantity not 0). Equity positions carried overnight move to the holdings the next day.

輸入參數kind

get_auctions

Auctions of your holdings

The auctions being held right now for stocks you hold in your demat account (only those). Each entry is the holding (tradingsymbol, exchange, isin, quantity, average_price, last_price, pnl, ...) plus its auction_number: pass that to place_order with variety=auction to take part.

無需輸入參數。

convert_position

Convert a position's product (dry run by default)

Convert the margin product of an open position, for example MIS to NRML or NRML to MIS. DRY RUN BY DEFAULT: with dry_run=true (the default) nothing is sent; the answer shows the exact request, the position found in get_positions, every safety check and, when live trading is enabled and the checks pass, a confirmation_token. To convert, repeat the identical call with dry_run=false and that token. A conversion places no order and adds no exposure, so it does not count toward the daily order count or the daily value. It is still checked: the new product must be allowed, and the converted quantity's notional (quantity x multiplier x last_price from get_positions) must be within the per-order cap. If the position is not found, its value is unknown and the conversion cannot be sent live. Moving a position out of MIS keeps it open past the end of the day and needs the full margin of the new product. Returns true when sent.

輸入參數dry_runexchange必填quantity必填new_product必填old_product必填position_type必填tradingsymbol必填transaction_type必填confirmation_token

authorise_holdings

Authorise holdings for sale (dry run by default)

Start a CDSL authorisation so that shares can be sold from the demat account. Call this when a SELL fails with HTTP 428 ('N quantity needs authorisation at depository'). DRY RUN BY DEFAULT: with dry_run=true (the default) nothing is sent; the answer shows the request and the checks. Repeat the identical call with dry_run=false and the confirmation_token to send it: Kite answers with a request_id, and this tool's live answer then contains `authorise_url`, the link YOU open in a browser to key in your demat PIN (TPIN) at CDSL. The PIN never passes through this server. Nothing is authorised until you finish that page. With `holdings` (isin and quantity pairs) only those shares are authorised; without it the page offers the entire holdings. An authorisation is valid for one trading session (until 5:30 PM IST, then it counts for the next trading day) and is used up as you sell. This is not an order: no caps apply.

輸入參數dry_runholdingsconfirmation_token

get_quotes

Full market quotes

Full market snapshot for up to 500 instruments in one call: last_price, last_quantity, volume, average_price, buy_quantity / sell_quantity, ohlc (close is the previous session's close), net_change, oi / oi_day_high / oi_day_low (F&O), lower / upper circuit limits and the 5-level market depth (buy / sell price, quantity, orders). Prices are in INR, timestamps in IST. Returns {"quotes": {instrument: snapshot}, "missing": [...]}: `missing` lists requested instruments Kite has no data for (misspelt, expired or not traded). Needs the paid Kite Connect plan; quote calls are limited to 1 per second. A full quote with depth is about 1.5 KB: for many instruments use get_ltp or get_ohlc.

輸入參數instruments必填

get_ohlc

OHLC quotes

Last price and the day's open / high / low / close (close is the previous session's close) for up to 1000 instruments in one call, in INR. Returns {"quotes": {instrument: {instrument_token, last_price, ohlc}}, "missing": [...]} (`missing`: instruments Kite has no data for). Lighter than get_quotes: no depth, volume or open interest. Needs the paid Kite Connect plan.

輸入參數instruments必填

get_ltp

Last traded prices

Last traded price (INR) for up to 1000 instruments in one call. Returns {"quotes": {instrument: {instrument_token, last_price}}, "missing": [...]} (`missing`: instruments Kite has no data for). The cheapest price check. Needs the paid Kite Connect plan.

輸入參數instruments必填

get_historical_data

Historical candles

OHLCV candles for one instrument between two IST times, oldest first, in INR. Returns {instrument, instrument_token, interval, from, to, columns, candles, count}; each candle is a list in `columns` order (date, open, high, low, close, volume, and oi when requested), `date` being the candle's start as Kite sends it (e.g. 2026-11-03T09:15:00+0530; day candles are at 00:00). Kite limits the date range of one request by interval (minute 60 days, 3/5/10minute 100, 15/30minute 200, 60minute 400, day 2000). Longer ranges are split into several requests automatically, newest first, and the tool stops as soon as it holds `limit` candles (at most 2000, always the newest). When older candles may exist in the range, `truncated` is true and `note` explains: to read further back, call again with to_date just before the first candle returned. continuous=true gives a future's day candles across its expired contracts (interval must be day). oi=true adds open interest (zero or null for plain equities). Needs the paid Kite Connect plan; historical requests are limited to 3 per second. Output is large (a candle is about 25 tokens, so 2000 candles are about 50k): ask for the range you need, or set `limit`.

輸入參數oilimitto_date必填interval必填from_date必填continuousinstrument必填

search_instruments

Search instruments

Find instruments in Kite's daily instrument list (cached locally; see get_instruments_status). Returns a list, best match first (exact tradingsymbol, then prefix, then substring; NSE before NFO before BSE), each with key (EXCHANGE:TRADINGSYMBOL, the name every other tool takes), instrument_token, exchange_token, tradingsymbol, name, exchange, segment, instrument_type, expiry, strike, lot_size (orders on NFO / BFO must be a multiple of it), tick_size (INR; limit prices must be a multiple of it) and last_price (from the daily dump, NOT live: use get_ltp). A full list (`limit` entries) may have more behind it: add filters. Examples: query="NIFTY", instrument_type="FUT", exchange="NFO" for index futures; query="RELIANCE", expiry="2026-11" for that month's contracts.

輸入參數limitqueryexpirysegmentexchangeinstrument_type

get_instrument

Instrument details

One instrument from Kite's daily instrument list: key, instrument_token, exchange_token, tradingsymbol, name, exchange, segment, instrument_type (EQ, FUT, CE, PE), expiry, strike, lot_size, tick_size (INR) and last_price (from the daily dump, not live). Use it to check the lot size and tick size before an order.

輸入參數instrument必填

get_instruments_status

Instrument list status

What the local instrument cache holds: for the instrument list and the mutual fund list, whether it is loaded, row counts (per exchange for the instrument list), when it was loaded, whether it is stale (Kite publishes a new dump every day around 08:30 IST), when it will next be refreshed and the last refresh error, if any. Never contacts Kite.

無需輸入參數。

refresh_instruments

Refresh the instrument list

Download Kite's instrument list and mutual fund list into the local cache (a few MB). The cache refreshes itself on first use after 08:30 IST each day, so this is only needed after a failed refresh or when a brand-new contract is missing. Returns the same as get_instruments_status plus `refreshed` (the lists replaced). A list that fails to download keeps its old copy, and the error is shown under last_error.

輸入參數force

search_mf_instruments

Search mutual fund schemes

Find mutual fund schemes on Zerodha Coin in Kite's daily mutual fund list (cached locally). Returns a list, best match first, each with tradingsymbol (the scheme's ISIN, which the MF tools take), amc, name, purchase_allowed, redemption_allowed, minimum_purchase_amount and purchase_amount_multiplier (INR), minimum_additional_purchase_amount, minimum_redemption_quantity and redemption_quantity_multiplier (units), dividend_type (growth / payout), scheme_type, plan (direct / regular), settlement_type, last_price (the latest NAV, INR) and last_price_date.

輸入參數amcplanlimitqueryscheme_type

get_order_margins

Margin required for orders

Margin Kite would block for each of 1 to 50 orders, without placing anything (works in read-only mode too). Every order is priced on its own, taking your existing positions and open orders into account; to price orders as one package (hedge or spread benefit) use get_basket_margins. All amounts are INR. Each entry has type (equity or commodity), span, exposure, option_premium, additional, bo, cash, var, pnl, leverage, charges and total, the margin to block. mode=compact returns the totals only. Leave price at 0 for MARKET and SL-M orders. `summary` adds up the totals and the charges.

輸入參數modeorders必填

get_basket_margins

Margin required for a basket of orders

Margin for 1 to 50 orders taken together as one basket, without placing anything (also in read-only mode). `initial` is the total margin required to execute the orders, `final` the total margin with the spread (hedge) benefit, `orders` the per-order margins, and `charges` Kite's overall charges block, which can leave out the transaction tax when MCX and equity orders are mixed: use the per-order charges instead. All amounts are INR. mode=compact returns the totals only. `summary` gives the initial and final margin, the spread benefit (initial minus final) and the summed per-order charges.

輸入參數modeorders必填consider_positions

get_order_charges

Charges for orders (virtual contract note)

Charges Kite would levy on 1 to 50 executed or imaginary orders (a virtual contract note), without placing anything (works in read-only mode too): brokerage, transaction tax (STT, or CTT on commodities), exchange and SEBI turnover charges, stamp duty and GST, all INR. Give each order's average_price (the price it was or would be executed at; must be above 0); order_id can be any string. Each entry in `orders` is Kite's answer for one order: the order's fields, the price used and a `charges` block (total plus the breakdown). `summary` has the grand total, the total per component and a line per order.

輸入參數orders必填

get_mf_holdings

Mutual fund holdings

Mutual fund units in your demat account, largest first. Each holding has tradingsymbol (the fund's ISIN), fund (name), folio, quantity (units), average_price (INR per unit paid), last_price (the last available NAV, INR per unit), last_price_date, pnl and pledged_quantity. `summary` covers ALL holdings, not just the page: invested and current value in INR, the profit or loss and its percentage.

輸入參數limitoffset

get_mf_orders

Mutual fund orders

Mutual fund orders. With order_id: that one order, however old. Without: every order of the last 7 days (open and executed, lump sums and SIP instalments), newest first, optionally filtered by status, with `status_counts` over the whole window. Each order has order_id, status, status_message, tradingsymbol (ISIN), fund, transaction_type, amount (INR), quantity (units allotted or sold), average_price (the NAV used), last_price (latest NAV), variety (regular, sip, amc_sip), folio and tag.

輸入參數limitoffsetstatusorder_id

get_mf_sips

Mutual fund SIPs

Mutual fund SIPs (recurring purchases): with sip_id one SIP, else all active and paused ones with `status_counts`. Each has sip_id, tradingsymbol (ISIN), fund, status (ACTIVE, PAUSED, CANCELLED), instalment_amount (INR), frequency (weekly, monthly, quarterly), instalment_day (monthly only, else 0), instalments (the number planned; -1 means until cancelled), completed_instalments, pending_instalments, next_instalment, last_instalment and tag.

輸入參數limitoffsetsip_id

ticker_subscribe

Stream live ticks

Start streaming live market data for instruments over Kite's WebSocket. The server opens one connection in the background on the first call (it needs the paid Kite Connect plan and a current login), reconnects and resubscribes by itself, and keeps the latest tick of every subscribed instrument for ticker_get_ticks. Modes: ltp (last price), quote (default: last price, last quantity, average price, volume, buy/sell quantity, OHLC, change %), full (quote plus open interest, last trade time, exchange timestamp and 5 levels of bid/offer depth). Indices have no volume or depth. Subscribing an instrument again with another mode switches its mode. At most KITE_MCP_TICKER_MAX_SUBSCRIPTIONS instruments (default 1000; Kite allows 3000) can be subscribed. An empty instruments list only opens the connection, which is how to receive order updates (ticker_order_updates) without market data. This changes only the server's own streaming state; it places no orders.

輸入參數modeinstruments必填

ticker_unsubscribe

Stop streaming instruments

Stop streaming instruments and drop their cached ticks. Instruments that were not subscribed are listed under not_subscribed. The WebSocket connection stays open (order updates keep arriving); ticker_stop closes it.

輸入參數instruments必填

ticker_get_ticks

Latest cached ticks

The latest tick received for each subscribed instrument, from the server's cache (nothing is requested from Kite). Each tick has instrument (when known), instrument_token, mode, last_price and, for quote and full, last_traded_quantity, average_traded_price, volume_traded, total_buy_quantity, total_sell_quantity, ohlc {open, high, low, close} and change (% from the previous close); full adds oi, oi_day_high, oi_day_low, last_trade_time, exchange_timestamp and depth {buy, sell} (5 levels of {quantity, price, orders}). Prices are in rupees, times in IST. Every tick also has received_at and age_s (seconds since it arrived): ticks stop outside market hours or when the connection is down, so check age_s, or pass max_age_s to be told which instruments are stale. Instruments subscribed but without a tick yet are listed under no_tick_yet.

輸入參數max_age_sinstruments

ticker_status

WebSocket ticker status

The state of the WebSocket ticker: state (idle, connecting, connected, retrying, waiting_for_login, blocked, failed), connected, connected_since, last_message_at (any frame, heartbeats included), last_tick_at, reconnects, subscriptions by mode, how many ticks and order updates are cached, packets_skipped (frames this server could not parse), last_error, and blocked (why the ticker stopped retrying: Kite refused the token, for example because the app has no paid WebSocket plan). Nothing in it is secret.

無需輸入參數。

ticker_order_updates

Order updates and broker messages

Order updates and broker messages received by this server: the WebSocket stream (live updates for orders placed anywhere on the account: web, mobile or API) and, when KITE_MCP_POSTBACK_PATH is set, Kite postbacks sent to the HTTP endpoint. Each item has seq, received_at, source ("ticker" or "postback"), type ("order"; "error" or "message" for Kite's own text) and data. For orders, data has order_id, status (COMPLETE, REJECTED, CANCELLED, UPDATE...), status_message, exchange, tradingsymbol, transaction_type, order_type, product, variety, quantity, filled_quantity, pending_quantity, price, trigger_price, average_price and timestamps. Only the last 500 items are kept, in memory, and items arrive only while the WebSocket is open (ticker_subscribe, even with an empty list, opens it) or the postback endpoint is receiving. Without since: the latest items, oldest first. With since: the first items after it, so you can page forward (more=true means there are further ones). These are notifications, not the book of record: a postback is authenticated only by a checksum over order_id and order_timestamp, so confirm what matters with get_order_history.

輸入參數limitsince

ticker_stop

Stop the WebSocket ticker

Close the WebSocket connection and forget all subscriptions and cached ticks (order updates already received stay available). Calling ticker_subscribe later starts afresh, which is also how to retry after Kite refused the connection with the current token. Safe to call when nothing is running.

無需輸入參數。

get_safety_status

Safety settings and today's usage

How this server guards writes: trading mode (dry_run or live), read-only, how live writes are confirmed, the per-order / daily value caps and order count, the allow-lists, whether the kill switch is on, and what has been sent live today (counted from the audit log). Call this before planning any order.

無需輸入參數。

get_audit_log

Audit log of write attempts

The audit log: every dry run, refusal, confirmation, live send and its result, oldest first (newest `limit`). Each event has a call_id tying a live_intent to its live_result / live_error / live_unknown.

輸入參數datetoollimit

engage_kill_switch

Engage the kill switch

Stop every write at once: creates the kill-switch file, after which all write tools are refused (dry runs still work and say so). Only a person can switch it off again, by deleting the file on the server.

輸入參數reason必填

版本歷史

2
  1. v0.1.1最新Nov 4, 2026
  2. v0.1.0Nov 3, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Kite 整合