# Angel One MCP [![PyPI](https://img.shields.io/pypi/v/angel-one-mcp)](https://pypi.org/project/angel-one-mcp/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) MCP server for **Angel One SmartAPI** — trade stocks, manage your portfolio, access market data, and run analytics through AI assistants like Claude, Cursor, and more. ## Tools (30+) | Category | Tools | |----------|-------| | **Session** | `angelone_ping`, `angelone_login`, `angelone_auto_login`, `angelone_logout`, `angelone_get_profile`, `angelone_get_rms_limit` | | **Orders** | `angelone_place_order`, `angelone_modify_order`, `angelone_cancel_order`, `angelone_get_order_book`, `angelone_get_trade_book`, `angelone_get_order_details` | | **Portfolio** | `angelone_get_holdings`, `angelone_get_all_holdings`, `angelone_get_positions`, `angelone_convert_position` | | **Market Data** | `angelone_get_ltp`, `angelone_get_market_data`, `angelone_search_scrip` | | **Historical** | `angelone_get_candle_data` | | **GTT** | `angelone_create_gtt_rule`, `angelone_modify_gtt_rule`, `angelone_cancel_gtt_rule`, `angelone_get_gtt_rule`, `angelone_list_gtt_rules` | | **Analytics** | `angelone_get_option_greeks`, `angelone_get_gainers_losers`, `angelone_get_put_call_ratio`, `angelone_get_oi_buildup`, `angelone_estimate_charges`, `angelone_get_margin_api` | ## Quick Start ### 1. Get API Keys 1. Go to [smartapi.angelone.in](https://smartapi.angelone.in/) 2. Sign up / login with your Angel One account 3. Create an app to get your **API Key** 4. Note your **Client Code** (Angel One ID) and **PIN** 5. Set up TOTP and note the **TOTP Secret** (from QR code) ### 2. Install ```bash pip install angel-one-mcp ``` ### 3. Configure Claude Desktop Add to your `claude_desktop_config.json`: ```json { "mcpServers": { "angel-one": { "command": "angel-one-mcp", "env": { "ANGELONE_API_KEY": "your_api_key", "ANGELONE_CLIENT_CODE": "your_client_code", "ANGELONE_PASSWORD": "your_pin", "ANGELONE_TOTP_SECRET": "your_totp_secret" } } } } ``` ### 4. Use with Claude ``` "Login to my Angel One account" "Show my portfolio holdings" "What's the current price of RELIANCE?" "Place a buy order for 10 shares of INFY at market price" "Show me NIFTY historical data for the last month" "What are the option greeks for NIFTY 23000 CE?" "Show top gainers in the market" ``` ## Alternative Setup ### Using Python module directly ```json { "mcpServers": { "angel-one": { "command": "python", "args": ["-m", "angel_one_mcp.server"], "env": { "ANGELONE_API_KEY": "your_api_key", "ANGELONE_CLIENT_CODE": "your_client_code", "ANGELONE_PASSWORD": "your_pin", "ANGELONE_TOTP_SECRET": "your_totp_secret" } } } } ``` ### Using Docker ```bash docker build -t angel-one-mcp . docker run -p 8000:8000 \ -e ANGELONE_API_KEY=your_key \ -e ANGELONE_CLIENT_CODE=your_code \ -e ANGELONE_PASSWORD=your_pin \ -e ANGELONE_TOTP_SECRET=your_secret \ angel-one-mcp ``` ### Using MCP Inspector (for testing) ```bash npx @modelcontextprotocol/inspector # Command: python # Args: -m angel_one_mcp.server ``` ## Environment Variables | Variable | Required | Description | |----------|----------|-------------| | `ANGELONE_API_KEY` | Yes | SmartAPI key from developer portal | | `ANGELONE_CLIENT_CODE` | Yes | Your Angel One client ID | | `ANGELONE_PASSWORD` | Yes | Your Angel One PIN | | `ANGELONE_TOTP_SECRET` | Yes | TOTP secret for auto-OTP generation | | `ANGELONE_MCP_TRANSPORT` | No | `stdio` (default) or `streamable_http` | | `ANGELONE_MCP_PORT` | No | Port for HTTP mode (default: 8000) | ## Angel One SmartAPI — Free Angel One SmartAPI is **completely free**: - No monthly charges - Free API access for trading, portfolio, and market data - Historical candle data included - Option chain and analytics included Just need an active Angel One trading account. ## License MIT