Upstox MCP server
A MCP server for integrating with the Upstox trading API by Upstox.
mcp-server-upstox-api
A MCP server for integrating with the Upstox trading API.
Quick Start
Setup
- Clone the repository:
git clone https://github.com/yourusername/mcp-server-upstox-api.git
cd mcp-server-upstox-api
- Install dependencies:
npm install
Running locally
-
Create an Upstox API app
Create a regular Upstox API app in the Upstox developer portal (Apps → My apps → + New App). Set the Redirect URL to:http://localhost:8787/callback -
Configure credentials
Create a file named.dev.varsin the project root and add your API key (Client ID) and Client Secret:UPSTOX_CLIENT_ID=your_app_api_key UPSTOX_CLIENT_SECRET=your_app_api_secret -
Start the application
npm start
Your MCP server will be running at http://localhost:8787.
Run the Server
To start the MCP server (after completing the steps above):
npm run start
MCP Configuration
Claude Desktop Configuration
To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop settings:
{
"mcpServers": {
"mcp-server-upstox-api": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/mcp"
]
}
}
}
Cursor MCP Configuration
To use this MCP server with Cursor, add the following configuration to your Cursor MCP settings (usually located at ~/.cursor/mcp.json):
{
"mcpServers": {
"mcp-server-upstox-api": {
"url": "http://localhost:8787/mcp"
}
}
}
These configurations allow Claude Desktop and Cursor to connect to your local MCP server and use the Upstox API endpoints.
Using with Claude and Cursor
You can interact with the Upstox API through natural language prompts. Here are some example prompts for each command:
Profile Information
- "What's my Upstox profile information?"
- "Show me my active segments and products in Upstox"
- "What's my user ID and email in Upstox?"
Funds and Margin
- "What's my available margin in Upstox?"
- "Show me my equity segment funds and margin details"
- "What's my commodity segment margin availability?"
Holdings
- "What stocks do I currently hold in Upstox?"
- "Show me my long-term holdings with their current values"
- "What's the total value of my holdings in Upstox?"
Positions
- "What are my current open positions in Upstox?"
- "Show me my intraday positions with their P&L"
- "What's my total unrealized P&L from current positions?"
MTF Positions
- "What are my Margin Trade Funding positions?"
- "Show me my MTF positions with their current values"
- "What's the total MTF exposure in my account?"
Order Book
- "Show me my current day's orders in Upstox"
- "What are my pending orders in Upstox?"
- "Show me my order history for today"
- "What's the status of my recent orders?"
- "List all my completed orders for today"
Order Details
- "Show me the details of order ID xxxxxxxxxxxxxxx"
- "What's the status of my order with ID xxxxxxxxxxxxxxx"
- "Get the complete information for order xxxxxxxxxxxxxxx"
- "Check the execution status of order xxxxxxxxxxxxxxx"
- "View the details of my recent order xxxxxxxxxxxxxxx"
Order History
- "Show me the history of order ID xxxxxxxxxxxxxxx"
- "Get all status updates for order xxxxxxxxxxxxxxx"
- "What's the progression of order xxxxxxxxxxxxxxx"
- "Show me all stages of order xxxxxxxxxxxxxxx"
- "Get order history for tag xxxxxxxxxxxxxxx"
Order Trades
- "Show me the trades for order ID xxxxxxxxxxxxxxx"
- "What trades were executed for order xxxxxxxxxxxxxxx"
- "Get the trade details for my order xxxxxxxxxxxxxxx"
- "List all trades associated with order xxxxxxxxxxxxxxx"
- "Show me the execution details for order xxxxxxxxxxxxxxx"
Trades
- "Show me my trades for today"
- "What trades have I executed today?"
- "Get my daily trade history"
- "List all my completed trades for the day"
- "Show me my trade details with execution prices"
Available Endpoints
| Endpoint | Method | Description |
|---|---|---|
/get-profile | GET | Fetch user profile information |
/get-funds-margin | GET | Fetch user funds and margin information. Optional segment parameter can be 'SEC' (Equity) or 'COM' (Commodity) |
/get-holdings | GET | Fetch user long-term holdings information |
/get-positions | GET | Fetch user short-term positions information |
/get-mtf-positions | GET | Fetch user Margin Trade Funding (MTF) positions information |
/get-order-book | GET | Fetch user's current day orders and their status |
/get-order-details | GET | Fetch detailed information about a specific order using order ID |
/get-order-trades | GET | Fetch trades executed for a specific order using order ID |
/get-order-history | GET | Fetch order history using either order ID or tag |
/get-trades | GET | Fetch user's trades executed for the current day |
Похожие серверы
NebulaFinger MCP
An MCP server interface for the NebulaFinger fingerprint recognition tool.
maven-indexer-mcp
A Model Context Protocol (MCP) server that indexes your local Maven repository (~/.m2/repository) and Gradle cache ( ~/.gradle/caches/modules-2/files-2.1) to provide AI agents with tools to search for Java classes, method signatures, and source code.
CostPlusDrugs.com
A Model Context Protocol (MCP) server that provides AI agents with affordable access to Cost Plus Drugs pharmacy services, offering transparent medication pricing and comprehensive drug information.
Greetwell Travel Experiences
Greetwell curates authentic local experiences in over 500 destinations, and its MCP server lets you search, explore details, check availability, get complementary recommendations, and book activities.
Weather
Provides real-time weather data, forecasts, and alerts using the OpenWeatherMap API.
Volume Wall Detector
Provides real-time stock trading volume analysis, detects significant price levels (volume walls), and tracks trading imbalances.
Send247 Human Logistics
Human Logistics in the AI Layer
YouTube Playlist Generator MCP Server
A Model Context Protocol (MCP) server that enables AI applications to search for YouTube music videos and manage playlists using the official YouTube Data API v3.
BASTION
Risk Intelligence MCP Server for crypto agents — 52 tools, 72B AI model, 560+ signals, derivatives, on-chain, autonomous trading
alphavantage stock mcp
stock data, stock analytics