A stdio MCP server exposing Angel One SmartAPI (account, portfolio, orders, market data, GTT) to Claude.
-
bun install -
cp .env.example .envand fill in:ANGEL_API_KEY— from https://smartapi.angelone.in/ → My AppsANGEL_CLIENT_CODE— your client IDANGEL_PIN— your MPINANGEL_TOTP_SECRET— base32 secret from https://smartapi.angelone.in/enable-totp
-
Register it with Claude Code:
claude mcp add angelone -- bun /absolute/path/to/angelone-mcp/index.ts
Or in Claude Desktop's
claude_desktop_config.json:{ "mcpServers": { "angelone": { "command": "bun", "args": ["/absolute/path/to/angelone-mcp/index.ts"] } } }
The server reads .env from this directory, logs in lazily with an auto-generated TOTP, and re-logs in when the session expires.
The server keeps Angel One's WebSocket feeds open while it runs:
start_watch— stream up to 1000 instruments (get tokens fromsearch_scrip) and accumulate per-symbol stats.get_watch_summary— % change over the window and day, price vs VWAP, window volume, buy/sell ratio, uptick ratio.wait_seconds: 300returns after a 5-minute window.stop_watch,list_watches— manage watches (max 5; unread watches stop after 30 minutes).get_order_updates— your own order status changes as they happen.
Ticks only flow during market hours (NSE 09:15–15:30 IST).
scripts/order.ts places a real order yourself, without going through Claude. It looks up the token and last price, shows the order, and sends it only after you type YES:
bun scripts/order.ts BUY SBIN-EQ 1 --product INTRADAY
bun scripts/order.ts SELL RELIANCE-EQ 5 --product DELIVERY --type LIMIT --price 1250
bun scripts/order.ts BUY SBIN-EQ 1 --product INTRADAY --dry-run # show the request, send nothingRun it with no arguments for all options. It doesn't depend on ANGEL_ENABLE_TRADING.
With ANGEL_ENABLE_TRADING=true, Claude gets request_place_order, request_modify_order, request_cancel_order, request_convert_position, request_create_gtt_rule, request_modify_gtt_rule and request_cancel_gtt_rule. Claude can't change your account directly:
- The tool writes
requests/<id>.jsonwith the parameters and Claude's reason, and startsscripts/approver.ts. - The approver shows a Yes/No dialog (a PowerShell popup on Windows,
osascripton macOS) with the order, the last price and the reason. The default button is No/Reject. - Only Yes/Approve sends it to Angel One. Unanswered requests expire after 2 minutes.
- The outcome is written to
requests/<id>.result.jsonand returned to Claude.get_requestandlist_requestsread it later; the approver's output is inrequests/<id>.log.
To re-run the dialog for a pending request yourself: bun scripts/approver.ts <id>.
The direct tools these replace are documented in docs/removed-write-tools.md.
bun test