Indian Stock Mcp Agent — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Indian Stock Mcp Agent (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
| 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 |
channel: 'chrome')git clone <repo-url> indian-broker-mcp
cd indian-broker-mcp
npm install
npx playwright install chromium
npm run buildCopy the example env file and edit as needed:
cp .env.example .env| Variable | Default | Description |
|---|---|---|
SESSION_ENCRYPTION_KEY | Auto-generated | 32-byte hex key for AES-256-GCM session encryption |
SESSION_TTL_HOURS | 6 | Session expiry time in hours |
BROWSER_HEADLESS | false | Set true to run browsers headless (login still needs headed mode) |
BROWSER_SLOW_MO | 100 | Delay in ms between Playwright actions (helps avoid detection) |
BROWSER_DATA_DIR | ./browser-data | Persistent browser profile storage |
LOG_LEVEL | info | debug, info, warn, or error |
RECORDINGS_DIR | ./recordings | Output directory for learn_broker_navigation |
claude mcp add indian-broker -- node /path/to/indian-broker-mcp/build/index.jsAdd 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.
npx @modelcontextprotocol/inspector node ./build/index.jsOpens a web UI at http://localhost:5173 where you can call tools interactively.
Ask Claude:
"Connect me to Zerodha"
This calls the broker_connect tool, which:
You can also connect using cookies from your browser's DevTools:
"Connect to Groww using these cookies: <paste from document.cookie>"Once connected, ask naturally:
"Disconnect from Zerodha"
This wipes the session data and deletes the browser profile for that broker.
| Tool | Parameters | Description |
|---|---|---|
broker_connect | broker (groww/zerodha/indmoney), method (browser_login/cookies), cookies? | Connect to a broker |
broker_disconnect | broker | Disconnect and wipe session |
broker_status | — | Show connection status for all brokers |
| Tool | Parameters | Description |
|---|---|---|
get_holdings | broker (default: all) | Stock holdings |
get_positions | broker (default: all) | Open positions (intraday/delivery) |
get_fno_positions | broker (default: all) | F&O positions specifically |
get_mutual_funds | broker (default: all) | Mutual fund portfolio |
get_us_stocks | broker (default: all) | US stock holdings |
get_gold | broker (default: all) | Gold / SGB / Gold ETF holdings |
get_orders | broker (default: all) | Today's order history |
get_portfolio_summary | — | Aggregated summary across all brokers |
| Tool | Parameters | Description |
|---|---|---|
search_stock | query, broker? | Search for stocks/MFs by name or symbol |
get_quote | symbol, broker? | Current price quote for a stock |
| Tool | Parameters | Description |
|---|---|---|
learn_broker_navigation | broker, url? | Record browser navigation, XHR requests, and DOM snapshots for building/updating scrapers |
MCP Resources provide cached data accessible by URI:
| URI | Description |
|---|---|
broker://status | Connection status for all brokers |
broker://{name}/holdings | Holdings for a specific broker (e.g., broker://zerodha/holdings) |
broker://{name}/mutual-funds | Mutual funds for a specific broker |
portfolio://summary | Aggregated portfolio summary |
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) │ │
│ └────────────────────────────┘ │
└─────────────────────────────────┘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.
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 retrybrowser-data/{broker}/ so cookies survive server restartsbroker_disconnect securely wipes both the in-memory session and the on-disk browser profile| Broker | Approximate Session Duration |
|---|---|
| Zerodha Kite | 6–8 hours |
| Groww | Varies |
| INDmoney | Days to weeks |
The learn_broker_navigation tool helps you discover and update internal API endpoints:
learn_broker_navigation with broker: "groww"recordings/{broker}/{timestamp}/endpoints.ts and types.ts for that brokernpm run dev # tsc --watchlaunchPersistentContext so cookies/localStorage survive restarts. The user only needs to log in when the session expires.webdriver flag, adds random delays between actions.raw.field1 ?? raw.field2 ?? default).learn_broker_navigation to recalibrate when something breaks.MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.