Sponsored by Deepsite.site

Upstox Mcp Server

Created By
ravikant19189 days ago
A Model Context Protocol (MCP) server for the Upstox Trading API that allows AI agents to access Indian stock market data, perform technical analysis, and view account information in a strictly read-only mode.
Content

Upstox MCP Server 📈

A Model Context Protocol (MCP) server that integrates with the Upstox Trading API, enabling AI agents to securely access Indian stock market data, perform technical analysis, and view account information in read-only mode.


🚀 Features

📊 Market Data

  • Live quotes (LTP, OHLC, volume)
  • Intraday candles (1m, 5m, 15m, 30m)
  • Historical candle data

📈 Technical Analysis

  • RSI, EMA, SMA, MACD, VWAP
  • Candlestick pattern detection
  • Trend context (Bullish / Bearish / Sideways)
  • Support & resistance levels

👤 Account (Read-Only)

  • Profile details
  • Funds & margin summary
  • Holdings
  • Open positions

🤖 MCP Native

  • Designed for AI agents
  • Tool-first architecture
  • Supports Claude Desktop, Cursor, and custom agents

⚠️ Safety Notice

This MCP server is STRICTLY READ-ONLY
❌ No order placement
❌ No order modification
❌ No trading actions

Trading endpoints are intentionally excluded for safety.


📦 Installation

1️⃣ Clone Repository

git clone https://github.com/your-username/upstox-mcp.git
cd upstox-mcp

2️⃣ Install Dependencies

pip install -e .

🔐 Configuration

Create a .env file in the project root:

UPSTOX_ACCESS_TOKEN=your_access_token_here

The access token must be generated using Upstox OAuth and should have read-only scopes.


▶️ Running the Server

Once installed, use the upstox-mcp command to start the server.

Option A — Standard IO (for Claude Desktop)

Default mode for local agent usage.

upstox-mcp

Option B — HTTP (Streamable)

Recommended for Cursor or remote MCP clients.

upstox-mcp --transport http

Option C — Deployment via Docker

Run the server in a containerized environment.

  1. Using Docker Compose (Recommended):

    docker-compose up -d
    
  2. Using Docker CLI:

    docker build -t upstox-mcp .
    docker run -d -p 8000:8000 --env-file .env upstox-mcp
    

Server will be available at: http://localhost:8000/mcp


🔌 MCP Client Configuration

Claude Desktop

Config path: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "upstox": {
      "command": "upstox-mcp",
      "env": {
        "UPSTOX_ACCESS_TOKEN": "your_access_token_here"
      }
    }
  }
}

Note: Ensure the directory containing upstox-mcp is in your PATH.

Cursor (HTTP)

Open Cursor Settings → Features → MCP. Add a new server:

  • Name: Upstox
  • Type: http
  • URL: http://localhost:8000/mcp

🧠 Example Prompts (AI Agent)

Market Data

  • "What's the current price of RELIANCE?"
  • "Show 1-minute candles for INFOSYS"

Technical Analysis

  • "Run RSI and EMA-20 analysis on TATAMOTORS"
  • "Is SBIN trending bullish or bearish today?"

Account

  • "Show my available margin in Upstox"
  • "List my current holdings"
  • "What are my open positions and P&L?"

🧰 Available Tools

Tool NameDescription
get_live_quoteLive price, OHLC, volume
get_intraday_candlesIntraday OHLCV data
get_historical_candlesHistorical market data
get_technical_analysisRSI, EMA, MACD, trend, S/R
get_account_summaryFunds + overview
get_holdings_listAll equity holdings
get_positions_listActive positions

🏗️ Architecture

AI Agent (Claude / Cursor) ↓ MCP ↓ FastMCP Server ↓ Upstox API (Read-Only)


📄 License

MIT License

🙌 Credits

  • FastMCP —MCP framework
  • Upstox — Trading & market data API
  • Pandas-TA — Technical indicators

📬 Disclaimer

This project is not affiliated with Upstox. Use at your own risk. Ensure compliance with Upstox API terms.

Server Config

{
  "mcpServers": {
    "Upstox-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp-server-upstox.onrender.com/mcp"
      ],
      "env": {
        "UPSTOX_API_KEY": "",
        "UPSTOX_API_SECRET": "",
        "UPSTOX_ACCESS_TOKEN": ""
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
CursorThe AI Code Editor
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。