This document enables any AI agent to integrate with Alphabots for order placement via webhooks and MCP.
| Integration | Method | Use Case |
|---|---|---|
| Webhook API | HTTP POST | Direct order placement from any system |
| MCP Server | MCP Protocol | Enhanced portfolio data, analysis, Indian markets |
The Alphabots Signal Webhook allows any system to send trading orders via HTTP POST.
``` https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/{UUID} ```
Get your unique webhook UUID from alphabots.in.
```json { "order": [{ "type": "ENTRY", "symbol": "NSE:NIFTY25APRFUT", "quantity": 1, "side": "B", "ordertype": "MARKET", "segment": "FUT", "product": "N" }] } ```
| Field | Type | Values | Required | Notes |
|---|---|---|---|---|
| `type` | string | "ENTRY", "EXIT" | Yes | Order type |
| `symbol` | string | "NSE:SBIN-EQ", "NSE:NIFTY25APRFUT" | Yes | NSE: or BSE: prefixed symbols |
| `quantity` | number | > 0 | Yes | Number of shares/lots |
| `side` | string | "B", "S" | Yes | Buy or Sell |
| `ordertype` | string | "MARKET", "LIMIT", "STOP", "STOPLIMIT" | Yes | Order execution type |
| `segment` | string | "EQ", "FUT", "OPT" | ENTRY only | Equity, Future, Options |
| `product` | string | "I", "D", "N" | ENTRY only | Intraday, Delivery, Normal |
| `limit_price` | number | > 0 | LIMIT, STOPLIMIT | Limit order price |
| `stop_price` | number | > 0 | STOP, STOPLIMIT | Stop loss price |
```bash curl -X POST https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/YOUR_UUID \ -H "Content-Type: application/json" \ -d '{"order":[{"type":"ENTRY","symbol":"NSE:NIFTY25APRFUT","quantity":1,"side":"B","ordertype":"MARKET","segment":"FUT","product":"N"}]}' ```
```json { "order": [{ "type": "ENTRY", "symbol": "NSE:SBIN-EQ", "quantity": 100, "side": "S", "ordertype": "LIMIT", "segment": "EQ", "product": "I", "limit_price": 750.50 }] } ```
```json { "order": [{ "type": "EXIT", "symbol": "NSE:NIFTY25APRFUT", "quantity": 1, "side": "S", "ordertype": "MARKET" }] } ```
| Category | Example Format | Notes |
|---|---|---|
| Equity | `NSE:SBIN-EQ`, `NSE:RELIANCE-EQ` | Stock symbols with -EQ suffix |
| Index Futures | `NSE:NIFTY25APRFUT`, `NSE:BANKNIFTY25APRFUT` | YYMM format for expiry |
| Stock Futures | `NSE:SBIN25APRFUT` | Same expiry format |
| Options | `NSE:NIFTY25APR24200CE` | Symbol + YYMM + Strike + CE/PE |
```pinescript // Alert message with JSON alertJson = '{"order":[{"type":"ENTRY","symbol":"' + symbolName + '","side":"B","quantity":1,"ordertype":"MARKET","segment":"FUT","product":"N"}]}' alert(alertJson, alert.freq_once_per_bar_close) ```
See `tradingview/strategies/` for complete examples.
The `amibroker-plugin/` contains a file monitor that reads JSON files and forwards to webhook.
- Run `signal_file_monitor.exe`
- Write signals to `signal.json`
- Configure `.env` with webhook URL
Python: ```python import requests
url = "https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/YOUR_UUID" order = { "order": [{ "type": "ENTRY", "symbol": "NSE:NIFTY25APRFUT", "quantity": 1, "side": "B", "ordertype": "MARKET", "segment": "FUT", "product": "N" }] }
response = requests.post(url, json=order) print(response.status_code, response.text) ```
Node.js: ```javascript const fetch = require('node-fetch');
const url = 'https://algoexestaging.alphabots.in/api/v1/signal/webhook-handler/YOUR_UUID'; const order = { order: [{ type: 'ENTRY', symbol: 'NSE:NIFTY25APRFUT', quantity: 1, side: 'B', ordertype: 'MARKET', segment: 'FUT', product: 'N' }] };
fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(order) }).then(r => r.json()).then(console.log); ```
The Alphabots MCP Server provides advanced portfolio insights and market data optimized for AI agents.
```bash npx alphabots-mcp-server@1.0.12 ```
Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
```json { "mcpServers": { "alphabots": { "command": "npx", "args": ["alphabots-mcp-server@1.0.12"], "env": { "mcp_token": "YOUR_MCP_TOKEN_HERE" } } } } ```
Trae.ai / Cursor / ChatGPT (`~/mcp.json`):
```json { "mcpServers": { "alphabots": { "command": "npx", "args": ["alphabots-mcp-server@1.0.12"], "ENV": { "mcp_token": "YOUR_MCP_TOKEN_HERE" } } } } ```
For IDEs with native MCP support (VS Code, JetBrains):
- Download `mcp-server/alphabots_bundle.mcpb`
- Import via IDE's MCP extension
- Set your MCP token
The MCP server exposes these tools:
| Tool | Description |
|---|---|
| `get_portfolio_summary` | Complete portfolio overview with P&L |
| `get_broker_insights` | Broker-specific analytics and stats |
| `get_holdings` | List all current holdings with details |
| `analyze_options` | CE/PE options analysis with Greeks |
| `get_advanced_analysis` | Deep portfolio metrics and trends |
| `get_weekly_expiry_options` | Weekly options positions and exposure |
``` Agent: Show my portfolio summary
Total Value: ₹12,45,678 Today's P&L: +₹23,450 (+1.92%) Total P&L: +₹2,34,567 (+23.2%)
Holdings: 32 positions Cash: ₹1,23,456 ```
``` Agent: Analyze my options positions
NIFTY 24200 CE: ₹125 | Delta: 0.52 | Theta: -₹8.5/day BANKNIFTY 49000 PE: ₹180 | Delta: -0.38 | Theta: -₹12.2/day
Total Options P&L: +₹15,678 Weekly Exposure: ₹8,50,000 ```
Replace `YOUR_MCP_TOKEN_HERE` with your actual token: ``` mcp_Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ```
Get your MCP token from Alphabots portal.
- Portfolio Insights: Complete summary with advanced analytics
- Options Analysis: Intelligent CE/PE detection with Greeks
- Enhanced Symbol Processing: NSE:/BSE: prefixed symbols
- Weekly Expiry Support: YYMDD format parsing
- Real-time Data: Yahoo Finance integration for live prices
- Indian Market Focus: Optimized for NSE, BSE, derivatives
- INR Currency: All values in Indian Rupees (₹)
- 30+ Holdings: Comprehensive tracking
- Indian Formatting: Proper locale formatting
Before sending an order, verify:
- ✅ Symbol format is correct (NSE: or BSE: prefix)
- ✅ Quantity is valid (> 0)
- ✅ Segment matches symbol type (EQ/FUT/OPT)
- ✅ Required fields for order type are present
- ✅ Limit/stop prices are valid for order type
```python try: response = requests.post(webhook_url, json=order, timeout=10) if response.status_code == 200: print("Order sent successfully") else: print(f"Error: {response.status_code} - {response.text}") except requests.RequestException as e: print(f"Request failed: {e}") ```
- Webhook: Respect any rate limits returned by the API
- MCP: Tools are rate-limited per connection
If your system uses internal symbols (e.g., "NIFTY-I"), map them to Alphabots format:
```json { "NIFTY-I": "NSE:NIFTY25APRFUT", "BANKNIFTY-I": "NSE:BANKNIFTY25APRFUT", "SBIN": "NSE:SBIN-EQ" } ```
Always test with paper trading or small quantities first:
```json { "order": [{ "type": "ENTRY", "symbol": "NSE:NIFTY25APRFUT", "quantity": 1, "side": "B", "ordertype": "MARKET", "segment": "FUT", "product": "I" }] } ```
- Documentation: See `mcp-server/README.md` for MCP setup
- Examples: `tradingview/strategies/` for Pine Script examples
- Website: alphabots.in
- Support: help@alphabots.in
- Blog: Webhook Integration Guide
For agents new to Alphabots:
- Get webhook UUID from Alphabots portal
- Get MCP token (if using MCP)
- Configure MCP in your IDE (optional)
- Test with a sample order
- Integrate webhook calls into your agent logic
- Set up error handling and logging
- Test with small quantities first
Last updated: February 2026