Indian Broker MCP Server
Provides integration with the Zerodha Kite platform for read-only portfolio data including stock holdings, F&O positions, mutual funds (via Coin), and order history.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Indian Broker MCP Server What are my current holdings?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Indian Broker MCP Server
A Model Context Protocol (MCP) server that connects to Indian broker platforms — Groww, Zerodha Kite, and INDmoney — to provide a unified, read-only view of your financial portfolio through Claude Code, Claude Desktop, or any MCP-compatible client.
No paid broker API subscriptions required. The server uses Playwright browser automation to capture data from the broker web apps after you log in via a visible Chrome window.
Features
Unified portfolio view across multiple brokers
Stocks, F&O, Mutual Funds, US Stocks, Gold — all asset classes
Network interception captures structured JSON from broker SPAs (more reliable than DOM scraping)
Persistent browser sessions — log in once per session expiry
Encrypted session storage (AES-256-GCM) in memory
Read-only — no order placement, no fund transfers
Graceful degradation — partial data returned if one broker fails
Broker Support Matrix
Feature | Groww | Zerodha Kite | INDmoney |
Stock Holdings | Yes | Yes | Yes |
F&O Positions | Yes | Yes | — |
Mutual Funds | Yes | Yes (Coin) | Yes |
US Stocks | Yes | — | Yes |
Gold / SGB | Yes | — | Yes |
Orders | Yes | Yes | Yes |
Login Method | Email + OTP | User ID + Password + TOTP | Phone + OTP |
Related MCP server: Investidor B3
Prerequisites
Node.js 18+
Google Chrome installed (Playwright uses your system Chrome via
channel: 'chrome')Claude Code or Claude Desktop (or any MCP client)
Installation
git clone <repo-url> indian-broker-mcp
cd indian-broker-mcp
npm install
npx playwright install chromium
npm run buildConfiguration
Copy the example env file and edit as needed:
cp .env.example .envEnvironment Variables
Variable | Default | Description |
| Auto-generated | 32-byte hex key for AES-256-GCM session encryption |
|
| Session expiry time in hours |
|
| Set |
|
| Delay in ms between Playwright actions (helps avoid detection) |
|
| Persistent browser profile storage |
|
|
|
|
| Output directory for |
Connecting to an MCP Client
Claude Code
claude mcp add indian-broker -- node /path/to/indian-broker-mcp/build/index.jsClaude Desktop
Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json on Linux, ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"indian-broker": {
"command": "node",
"args": ["/path/to/indian-broker-mcp/build/index.js"]
}
}
}Restart Claude Desktop after adding the configuration.
MCP Inspector (for testing)
npx @modelcontextprotocol/inspector node ./build/index.jsOpens a web UI at http://localhost:5173 where you can call tools interactively.
Usage
Step 1: Connect to a broker
Ask Claude:
"Connect me to Zerodha"
This calls the broker_connect tool, which:
Opens a visible Chrome window to the broker's login page
You log in manually (including OTP / 2FA)
The server detects login success automatically and captures the session
You can also connect using cookies from your browser's DevTools:
"Connect to Groww using these cookies:
<paste from document.cookie>"
Step 2: Query your portfolio
Once connected, ask naturally:
"What are my stock holdings?"
"Show my mutual fund portfolio across all brokers"
"What's my total portfolio value?"
"Show my F&O positions on Zerodha"
"What US stocks do I hold?"
"Show today's orders"
"Search for Reliance stock"
Step 3: Disconnect
"Disconnect from Zerodha"
This wipes the session data and deletes the browser profile for that broker.
Tools Reference
Authentication
Tool | Parameters | Description |
|
| Connect to a broker |
|
| Disconnect and wipe session |
| — | Show connection status for all brokers |
Portfolio (Read-Only)
Tool | Parameters | Description |
|
| Stock holdings |
|
| Open positions (intraday/delivery) |
|
| F&O positions specifically |
|
| Mutual fund portfolio |
|
| US stock holdings |
|
| Gold / SGB / Gold ETF holdings |
|
| Today's order history |
| — | Aggregated summary across all brokers |
Market Data
Tool | Parameters | Description |
|
| Search for stocks/MFs by name or symbol |
|
| Current price quote for a stock |
Development
Tool | Parameters | Description |
|
| Record browser navigation, XHR requests, and DOM snapshots for building/updating scrapers |
Resources
MCP Resources provide cached data accessible by URI:
URI | Description |
| Connection status for all brokers |
| Holdings for a specific broker (e.g., |
| Mutual funds for a specific broker |
| Aggregated portfolio summary |
Architecture
MCP Client (Claude Code / Desktop)
│
│ STDIO (JSON-RPC)
▼
┌─────────────────────────────────┐
│ MCP Server (Node.js) │
│ │
│ ┌─────────┐ ┌───────┐ ┌─────┐ │
│ │ Groww │ │Zerodha│ │ IND │ │
│ │ Adapter │ │Adapter│ │money│ │
│ └────┬─────┘ └───┬───┘ └──┬──┘ │
│ │ │ │ │
│ ┌────▼───────────▼────────▼──┐ │
│ │ Playwright (Chrome) │ │
│ │ • Network interception │ │
│ │ • Page navigation │ │
│ │ • Persistent contexts │ │
│ └────────────────────────────┘ │
│ │
│ ┌────────────────────────────┐ │
│ │ Session Store (encrypted) │ │
│ └────────────────────────────┘ │
└─────────────────────────────────┘How data extraction works
Navigate to the relevant broker page (e.g., holdings dashboard)
Intercept the XHR/fetch responses the SPA makes to its internal APIs
Parse the structured JSON from those responses
Normalize broker-specific fields into unified types
Return to the MCP client in a consistent format
Network interception is the primary strategy because it captures clean, structured data directly from the broker's internal APIs — far more reliable than parsing the DOM.
Project Structure
src/
├── index.ts # Entry point (STDIO transport)
├── server.ts # MCP server, tool/resource registration
├── types/
│ ├── portfolio.ts # Holding, Position, MutualFundHolding, etc.
│ ├── broker.ts # BrokerAdapter interface
│ └── auth.ts # Session types
├── adapters/
│ ├── base.ts # Abstract base adapter
│ ├── groww/
│ │ ├── index.ts # Adapter + normalizers
│ │ ├── scraper.ts # Network interception logic
│ │ ├── endpoints.ts # URL patterns
│ │ ├── selectors.ts # DOM selectors (fallback)
│ │ └── types.ts # Raw API response types
│ ├── zerodha/ # Same structure
│ └── indmoney/ # Same structure
├── browser/
│ ├── manager.ts # Browser lifecycle, persistent contexts
│ ├── auth-flow.ts # Login detection + session capture
│ ├── interceptor.ts # XHR/fetch response capture engine
│ ├── recorder.ts # Navigation recorder for development
│ └── helpers.ts # Utilities (delays, screenshots)
├── auth/
│ ├── crypto.ts # AES-256-GCM encrypt/decrypt
│ └── session-store.ts # In-memory encrypted session store
├── normalizer/
│ └── index.ts # Portfolio summary aggregation
└── utils/
├── logger.ts # stderr-only logger
├── config.ts # .env config loader
└── retry.ts # Exponential backoff retrySession Management
Sessions are stored encrypted in memory using AES-256-GCM
Browser profiles are persisted to disk under
browser-data/{broker}/so cookies survive server restartsSessions auto-expire after the configured TTL (default: 6 hours)
When a session expires, the next data request will return an error prompting you to reconnect
broker_disconnectsecurely wipes both the in-memory session and the on-disk browser profileEach broker is fully isolated in its own browser context
Typical session lifetimes
Broker | Approximate Session Duration |
Zerodha Kite | 6–8 hours |
Groww | Varies |
INDmoney | Days to weeks |
Development
Adding or updating broker scrapers
The learn_broker_navigation tool helps you discover and update internal API endpoints:
Call the tool:
learn_broker_navigationwithbroker: "groww"A Chrome window opens — log in and navigate to the pages you care about
The recorder captures every URL, XHR request/response, and DOM state
Recordings are saved to
recordings/{broker}/{timestamp}/Use the captured data to update
endpoints.tsandtypes.tsfor that broker
Watch mode
npm run dev # tsc --watchKey design decisions
Network interception over DOM scraping: Broker SPAs fetch data via internal REST APIs. Intercepting those JSON responses is more reliable and structured than parsing rendered HTML.
Persistent browser contexts: Using Playwright's
launchPersistentContextso cookies/localStorage survive restarts. The user only needs to log in when the session expires.Anti-detection: Uses real Chrome (not Chromium), removes
webdriverflag, adds random delays between actions.Flexible response parsing: Each adapter's normalizer handles multiple possible response shapes (brokers may change their API structure). Fields are accessed with fallback chains (
raw.field1 ?? raw.field2 ?? default).
Security
No credentials stored — you log in manually; only session cookies are captured
AES-256-GCM encryption for all in-memory session data
Cookies and tokens are never logged — the logger redacts sensitive data
All output goes to stderr — stdout is reserved for MCP JSON-RPC (writing to stdout would break the protocol)
Browser profiles are gitignored and deleted on disconnect
Strictly read-only — there are no tools for placing orders, modifying positions, or transferring funds
Limitations
Browser scraping is fragile — broker UIs and internal APIs change without notice. Use
learn_broker_navigationto recalibrate when something breaks.OTP login requires user presence — Groww and INDmoney require manual OTP entry. Zerodha requires TOTP/PIN.
No real-time streaming — data is fetched on demand by navigating to pages. There is no WebSocket or live price feed.
Rate limiting — avoid calling portfolio tools in rapid succession. The server adds delays between page navigations but aggressive use may trigger broker anti-bot measures.
Terms of Service — automated access to broker web apps may violate their terms. This tool is intended for personal use only.
Single user — the server manages one session per broker. It is not designed for multi-user or shared access.
License
MIT
Available Tools
14 toolsbroker_connectC
Connect to an Indian broker by opening a browser for login
Inputs: broker (required), method, cookies.
broker_disconnectA
Disconnect from a broker and wipe session data
Inputs: broker (required).
broker_statusA
Show connection status for all brokers
Inputs: no named parameters.
get_fno_positionsC
Fetch F&O positions from connected brokers
Inputs: broker.
get_goldA
Fetch gold holdings from connected brokers
Inputs: broker.
get_holdingsC
Fetch stock holdings from connected brokers
Inputs: broker.
get_mutual_fundsB
Fetch mutual fund holdings from connected brokers
Inputs: broker.
get_ordersB
Fetch today's order history from connected brokers
Inputs: broker.
get_portfolio_summaryB
Aggregated portfolio summary across all connected brokers
Inputs: no named parameters.
get_positionsC
Fetch open positions from connected brokers
Inputs: broker.
get_quoteC
Get current price quote for a stock
Inputs: symbol (required), broker.
get_us_stocksB
Fetch US stock holdings from connected brokers
Inputs: broker.
search_stockB
Search for a stock or mutual fund by name or symbol
Inputs: query (required), broker.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have clearly distinct purposes, but get_positions and get_fno_positions could be confused since F&O positions are a subset of positions. Similarly, get_holdings, get_mutual_funds, get_us_stocks, and get_gold are differentiated by asset type, which is clear. Overall, the tools are separable by their descriptions.
The naming convention is mixed: some tools follow a verb_noun pattern (e.g., get_holdings, search_stock), while others use a noun_verb pattern (e.g., broker_connect, broker_disconnect). This inconsistency is not chaotic but could be more uniform. Both patterns use lowercase with underscores, so it's readable.
14 tools is appropriate for a broker aggregation server. The count is well within the typical 3-15 range, and each tool addresses a specific aspect of broker connectivity, data retrieval, or usability. None feel redundant.
The tool set covers connection management, holdings, positions, and orders, but misses obvious financial data like cash balances and trade history. It also lacks any trading or order placement capabilities, which could be expected for a broker MCP, though it may be intentionally read-only. The core read-only aggregation surface is present, but notable gaps exist.
Maintenance
Related MCP Connectors
Indian broker accounts for AI agents: positions, holdings, orders, P&L, option chains, 10+ brokers.
Research Indian mutual funds and manage consent-based portfolio tracking records.
Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.
Read-only crypto and traditional portfolio: holdings, PNL, FIFO tax figures and market data.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables AI-powered trading and portfolio management through Upstox API integration. Supports portfolio rebalancing strategies with LLM inference for automated trading decisions.59MIT
- AlicenseNot gradedqualityDmaintenanceConsolidates your B3 investment portfolio (stocks, FIIs, fixed income, etc.) from all brokerages into one view. Provides read-only tools to check position, dividends, transactions, and more.MIT
- FlicenseNot gradedqualityDmaintenanceControls and reads a live TradingView Desktop chart via Chrome DevTools Protocol, enabling market scanning, morning briefs, backtesting, and live NSE PCR data through a local dashboard.-
- AlicenseNot gradedqualityDmaintenanceFetches and normalizes investment portfolio data from eToro and Interactive Brokers (IBKR), enabling AI agents to consolidate, aggregate, and visualize holdings across brokers.MIT