Angel One MCP Server

Angel One MCP Server

Enables AI agents to interact with Angel One brokerage for live market data, portfolio management, and order placement using the SmartAPI.

Category
Visit Server

README

Angel One MCP Server

Angel One SmartAPI integration for AI trading agents (MCP Tool Server).

This provides a secure HTTP-based interface for AI systems (Claude, Grok, custom agents) to interact with Angel One brokerage for live data, portfolio, and order placement.

Features (v0.1)

  • SmartAPI authentication with TOTP support (auto-generate if secret provided)
  • Tools: login, get_ltp, get_holdings, get_positions, place_order (with dryRun safety)
  • Protected MCP endpoint with secret key (x-mcp-key header)
  • Auto token refresh attempt on 401
  • Ready for deployment to get a public URL (Render, Railway, etc.)

Prerequisites

  1. Angel One Demat account
  2. Enable SmartAPI access and generate API Key from https://smartapi.angelone.in/
  3. Enable TOTP authentication in your Angel One account (for secure API login)
  4. Note your Client ID, Password/PIN, and TOTP secret key (from authenticator setup)

Quick Start (Local)

# 1. Clone the repo
git clone https://github.com/tamil3yashni-ship-it/angel-one-mcp-server.git
cd angel-one-mcp-server

# 2. Setup environment
cp .env.example .env
# Edit .env with your credentials (see below)

# 3. Install dependencies
npm install

# 4. Run
npm start

Server runs on http://localhost:3000 by default.

Environment Variables (.env)

Copy from .env.example and fill:

ANGEL_CLIENT_CODE=AB1234          # Your Angel One Client ID
ANGEL_PASSWORD=your_trading_pin
ANGEL_TOTP_SECRET=JBSWY3DPEHPK3PXP  # Optional but recommended - Base32 secret from TOTP setup
ANGEL_API_KEY=your_api_key_from_smartapi_portal
MCP_API_KEY=change_this_to_a_strong_secret_for_ai_access
PORT=3000

Security: Never commit .env file. Use strong unique MCP_API_KEY.

Deployment for Public URL

  1. Push to GitHub (already done)
  2. Connect repo to Render.com or Railway.app (free tiers available for Node.js)
  3. Set all environment variables in the hosting platform dashboard
  4. Deploy
  5. Your MCP URL will be something like: https://angel-one-mcp-server.onrender.com/mcp/invoke

After deployment, test with curl or integrate into your AI prompt.

MCP Integration for AI Agents

Configure your AI tool (Claude Desktop, Cursor, or custom) with:

  • MCP Server URL: https://your-deployed-url.com/mcp/invoke
  • Auth Header: x-mcp-key = your_MCP_API_KEY value

The AI can then discover and call tools like:

  • login (if needed)
  • get_ltp
  • get_holdings
  • place_order (use dryRun first!)

Example invoke body:

{
  "tool": "get_ltp",
  "args": {
    "exchange": "NSE",
    "tradingsymbol": "RELIANCE",
    "symboltoken": "2885"
  }
}

Available Tools

See server.js for handler details and update as needed. Core tools:

  • login: Authenticates and establishes session. Args: { "password": "...", "totp": "123456" } (or uses env/TOTP_SECRET)
  • get_ltp: Fetch last traded price. Requires accurate symboltoken (download symbol master from Angel if needed).
  • get_holdings: Current share holdings.
  • get_positions: Open positions.
  • place_order: Execute trade. HIGH RISK - Always test with dryRun: true first. Real money at stake.

Important Notes & Customization

  • API Endpoints: The endpoints in server.js (e.g. /rest/secure/angelbroking/...) are based on common SmartAPI patterns. Verify and correct them using official documentation or by cross-testing with the official Python SDK (https://github.com/angel-one/smartapi-python).
  • Add more tools as needed: orderbook, tradebook, historical candles, margin calculator, etc.
  • For production: Add request logging, rate limiting (e.g. express-rate-limit), IP whitelisting, and order confirmation workflow.
  • Token expiry: The server attempts re-login on 401. Improve with proper refresh token flow if needed.
  • This is a starting template tailored for your trading automation needs.

Support

For issues with Angel One API, refer to https://smartapi.angelone.in/ or their forum. For MCP integration or prompt engineering with this server, provide feedback.

Built for reliable AI-assisted trading on Angel One.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured