Upstox

Provides read-only access to Upstox market data, historical data, technical indicators, and account views for AI agents.
  • python

0

GitHub Stars

python

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ravikant1918-mcp-server-upstox": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp-server-upstox.onrender.com/mcp",
        "--header",
        "X-Upstox-API-Key:YOUR_API_KEY",
        "--header",
        "X-Upstox-API-Secret:YOUR_API_SECRET",
        "--header",
        "X-Upstox-Access-Token:YOUR_ACCESS_TOKEN"
      ],
      "env": {
        "UPSTOX_API_KEY": "your_api_key",
        "UPSTOX_API_SECRET": "YOUR_API_SECRET",
        "UPSTOX_ACCESS_TOKEN": "your_access_token_here"
      }
    }
  }
}

You will set up and use a read-only MCP server that connects to Upstox market data to power AI agents with real-time quotes, historical data, technical indicators, and account views. This MCP server enables safe access for AI assistants to analyze Indian equity markets without placing trades, making it ideal for algorithmic research, portfolio analysis, and market insight workflows.

How to use

You connect your MCP client (such as Claude Desktop, Cursor IDE, or other MCP-compatible agents) to the Upstox MCP Server to retrieve live market data, perform technical analysis, and inspect read-only account information. Use the remote BYOK setup to run the server in a cloud or shared environment and pass access tokens safely via HTTP headers. You can also run a local instance for development and testing.

How to install

Prerequisites: ensure you have Python 3.10 or higher installed on your system. You should also have an Upstox trading account with API credentials.

  1. Clone the repository and navigate into the project directory.
git clone https://github.com/ravikant1918/mcp-server-upstox.git
cd mcp-server-upstox
  1. Create a virtual environment and activate it.
python -m venv venv

# macOS/Linux
source venv/bin/activate

# Windows
venv\Scripts\activate
  1. Install the package in editable mode.
pip install -e .
  1. Verify the installation.
upstox-mcp --version

Additional sections

Configuration covers how to obtain Upstox API credentials, set environment variables, and secure token management. You may use BYOK to run the server remotely and pass credentials via HTTP headers.

Configuration

Getting Upstox API credentials involves creating an app in the Upstox Developer Console, generating an API key and secret, and obtaining an access token through the OAuth flow. Tokens are valid for 24 hours and must be refreshed regularly.

Environment configuration example for a local setup.

# .env
UPSTOX_ACCESS_TOKEN=your_access_token_here

# Optional for automatic token refresh
UPSTOX_API_KEY=your_api_key
UPSTOX_API_SECRET=your_api_secret

Running the server

You can run the server in standard IO mode for local AI agents or in HTTP mode for web-based clients. You may also deploy via Docker.

Standard IO mode (Claude Desktop): run the server with the default IO transport.

upstox-mcp
# or
upstox-mcp --transport stdio

HTTP mode (for web-based agents like Cursor IDE or remote access): run the server in HTTP transport.

upstox-mcp --transport http
# Server will start on http://localhost:8000

Optional custom port:

upstox-mcp --transport http --port 8080

BYOK remote configuration example

For remote deployments, you can pass credentials via HTTP headers using the BYOK method. Use a remote command that launches the mcp-remote client pointing at the server URL.

{
  "mcpServers": {
    "Upstox-Remote": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp-server-upstox.onrender.com/mcp",
        "--header", "X-Upstox-API-Key:YOUR_API_KEY",
        "--header", "X-Upstox-API-Secret:YOUR_API_SECRET",
        "--header", "X-Upstox-Access-Token:YOUR_ACCESS_TOKEN"
      ]
    }
  }
}

Safety and access

This MCP server is strictly read-only. It does not support placing orders, modifying orders, transferring funds, or executing trades. Trading endpoints are excluded to protect your accounts.

Troubleshooting

Common issues include token expiry, missing CLI tooling, and client configuration mismatches. Ensure tokens are refreshed every 24 hours, confirm the upstox-mcp command is accessible in your environment, and verify the MCP client configuration paths.

Notes

The server targets read-only access to live market data (quotes, historical data, intraday candles), technical analysis, and account view endpoints for safe AI-driven exploration and research.

Available tools

market_get_live_quote

Fetch the latest market quote including price, OHLC, and volume.

market_search_instruments

Search for trading instruments by name or symbol.

market_get_instrument_details

Retrieve detailed instrument metadata.

market_get_historical_data

Obtain historical candle data with custom time ranges.

market_get_intraday_candles

Get real-time intraday candle data.

analysis_calculate_rsi

Calculate the RSI momentum indicator.

analysis_calculate_macd

Compute MACD for trend and momentum.

analysis_calculate_adx

Measure trend strength with ADX.

analysis_calculate_moving_averages

Compute SMA and EMA moving averages.

analysis_calculate_bollinger_bands

Analyze volatility using Bollinger Bands.

analysis_calculate_support_resistance

Determine pivot-based support and resistance levels.

analysis_calculate_volatility_metrics

Assess volatility metrics like ATR.

analysis_calculate_stochastic

Calculate stochastic momentum oscillator.

analysis_calculate_williams_r

Compute Williams %R momentum.

analysis_calculate_fibonacci_levels

Calculate Fibonacci retracement levels.

analysis_analyze_candlestick_patterns

Detect candlestick patterns in price data.

analysis_get_technical_analysis

Generate a holistic multi-indicator technical analysis report.

account_get_summary

Provide a portfolio snapshot including holdings and margins.

account_get_user_margin

Show available user margin.

account_get_holdings_list

List equity holdings in the account.

account_get_positions_list

List active positions.

account_get_order_book

Return daily order book data.

account_get_trade_history

Return daily trade history.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational