Skip to main content

Integrate Upstox Trading Data with AI Assistants via MCP

The Upstox Model Context Protocol (MCP) integration enables AI assistants like Claude, ChatGPT, Cursor, and VS Code to access your trading account data directly. This transforms generic AI tools into personalized financial advisors that understand your specific portfolio, positions, and market context.

What is Model Context Protocol (MCP)?โ€‹

Model Context Protocol (MCP) enables AI assistants to access your account-specific trading data in real-time, creating context-aware conversations about your actual investments. Instead of generic market advice, you get insights based on your holdings, positions, and account status.

MCP provides these capabilities:

  • Account-scoped insights: Analysis of your actual portfolio composition, performance, and risk exposure
  • Real-time market context: Current prices, volumes, and market movements integrated into your conversations
  • Conversational API access: Natural language queries that map to precise API calls and data retrieval
  • Personalized research: Stock analysis that considers how potential investments fit with your existing holdings

The fundamental advantage: traditional AI assistants work with publicly available information only. MCP-enabled assistants understand your specific financial situation, making their guidance relevant to your actual investment decisions.

Compatible AI platforms include Claude Desktop, ChatGPT (with Developer mode), Cursor, and VS Code with GitHub Copilot, giving you flexibility in choosing your preferred development or analysis environment.

Setup Overviewโ€‹

Connect your Upstox account to AI assistants in minutes:

  1. Select AI client: Use the tabs below to choose Claude Desktop, ChatGPT, Cursor, or VS Code with GitHub Copilot
  2. Install dependencies: Download from nodejs.org
  3. Add MCP configuration: Insert Upstox server details in your AI client settings
  4. Authorize account: Complete OAuth flow to securely link your trading account
  5. Begin analysis: Start asking questions about your portfolio and market data
Ready to get started?

Select your client in the tabs below to see setup steps.

Prerequisitesโ€‹

Before setting up MCP integration, ensure you have:

Setting up Upstox MCPโ€‹

Claude Desktopโ€‹

Install Node.js

  • Download and install Node.js from nodejs.org
  • Verify installation by opening Command Prompt/Terminal and typing node --version

Configure Claude Desktop

  • Open Claude Desktop application
  • Go to Settings (gear icon)
  • Click on Developer in the left sidebar
  • Click Edit Config
  • Add the following configuration:
{
"mcpServers": {
"Upstox MCP": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.upstox.com/mcp"]
}
}
}
  • Save and restart Claude Desktop

Verify Connection

  • In Claude Desktop, look for the tools/hammer icon in the chat interface
  • Click it to verify Upstox MCP tools are available
  • Follow the authorization prompts to connect to your Upstox account

You can verify the connection by checking that "Upstox MCP" appears in your connectors list:

Claude Desktop showing the 'Upstox MCP' connector with account-scoped tools enabled for portfolio and quote access

When successfully connected, you should see the Upstox MCP tools available in Claude:

Upstox MCP tools listed in Claude after connecting - portfolio, margins, and market data resources visible in the UI

Capabilities with Upstox MCPโ€‹

Once connected, your AI assistant can provide natural language analysis of your trading account and market data:

Portfolio Insightsโ€‹

  • Position breakdown: Detailed view of current holdings with performance metrics
  • Profit/loss tracking: P&L analysis across custom time periods
  • Diversification analysis: Sector and asset allocation assessment
  • Benchmark comparison: Performance relative to market indices

Account Dataโ€‹

  • Available margins: Real-time buying power and margin utilization - See margin APIs
  • Profile information: Account status and configuration details - User profile APIs
  • Activity summaries: Daily trading and P&L overviews

Market Researchโ€‹

  • Individual stock analysis: Research securities in context of your existing portfolio
  • Technical indicators: Chart analysis and trend identification

Example Use Casesโ€‹

Here are some examples of how you can interact with your AI assistant using Upstox MCP:

Stock Analysis and Hold/Sell Decisionโ€‹

Ask your AI: "Check the stocks based on their current trends, valuations, Technicals etc and tell me if I should continue holding it or not"

Corporate Governance Analysisโ€‹

Ask your AI: "Go through the latest board meetings and AGM/EGMs of the stocks in my company and derive the health of my portfolio"

Professional Investment Model Analysisโ€‹

Ask your AI: "Run investment models of Goldman Sacch and other top PMSs on my Portfolio and give me a deep down of the analysis"

Portfolio Correlation Analysisโ€‹

Ask your AI: "Find the correlation (beta) of my portfolio to the NIFTY index over the last 3 years. Show it to me on a chart with Week on week and QoQ timeframes"

Responsible Usage Guidelinesโ€‹

Best Practices
  • Multiple Sources: Use AI insights as one of many research tools in your investment process
  • Verify Data: Cross-check important information directly with the Upstox platform
  • Independent Research: Conduct your own fundamental and technical analysis
  • Professional Advice: Consult with qualified financial advisors for major investment decisions
  • Risk Management: Maintain proper risk management regardless of AI recommendations
  • Stay Informed: Keep up with market news and developments beyond AI analysis

Authentication and Securityโ€‹

Initial Authorization

First-time setup requires OAuth authorization to securely link your Upstox account. This ensures your trading data access is controlled and authenticated.

Daily Reconnection Policy

Important

For security, you must re-authorize your account connection daily. This prevents unauthorized access and ensures data freshness.

Current Limitationsโ€‹

Read-Only Access: The MCP integration provides read-only access to your account data. You cannot place orders, modify positions, or execute trades through the AI assistant.

Daily Re-authorization: Account connections expire daily and require re-authentication for security.

Feature Scope: Supports portfolio analysis, account data, and market research.

Troubleshootingโ€‹

Connection Issuesโ€‹

If you're having trouble connecting:

  1. Verify Node.js is properly installed (node --version)
  2. Check that your Upstox account is active and not dormant
  3. Ensure you're using the correct MCP server URL: https://mcp.upstox.com/mcp
  4. Restart your AI client after configuration changes

Authentication Problemsโ€‹

If authorization fails:

  1. Check your internet connection
  2. Verify your Upstox login credentials work on the main platform
  3. Try disconnecting and reconnecting your account
  4. Clear browser cache if using web-based authentication

AI Response Issuesโ€‹

If AI responses seem incorrect or incomplete:

  1. Remember that AI can make mistakes - always verify important information
  2. Try rephrasing your question more specifically
  3. Cross-check data directly with your Upstox account
  4. Consider asking for clarification or additional details

Daily Reconnectionโ€‹

If you're prompted to reconnect:

  1. This is normal security behavior - reconnect once per day
  2. Use the same authorization process as initial setup
  3. Your AI assistant will regain access to your current data

Support and Communityโ€‹

For technical support with MCP integration or general API questions, visit the Upstox Developer Community.

For account-specific issues, contact Upstox customer support through your trading platform.

Related Documentation:

Frequently Asked Questions (FAQ)โ€‹

How to integrate Upstox API with Claude AI?โ€‹

To integrate Upstox API with Claude AI, install Node.js, configure Claude Desktop with the Upstox MCP server URL (https://mcp.upstox.com/mcp), and authenticate your Upstox trading account through the secure OAuth flow.

How do I connect Upstox MCP to ChatGPT?โ€‹

Enable Developer mode in ChatGPT (Settings โ†’ Apps โ†’ Advanced settings), then create a custom app with the Upstox MCP endpoint (https://mcp.upstox.com/mcp). After the connection is confirmed, select Upstox MCP from Connectors in Chat. See the ChatGPT tab above and the official OpenAI guide for step-by-step instructions.

How do I connect Upstox MCP to Cursor?โ€‹

Open Cursor Settings โ†’ Tools and MCP, click Add custom MCP (or the plus icon if you already have an MCP), add the Upstox MCP config (see the Cursor tab above), then go back to Settings and connect the Upstox MCP. For more on MCP in Cursor, see the official Cursor MCP documentation.

Can I use Upstox MCP with VS Code?โ€‹

Yes, Upstox MCP works with VS Code through the GitHub Copilot extension. Add the MCP server configuration to your VS Code settings.json and use the /mcp command to access Upstox trading data.

Is Upstox MCP integration free?โ€‹

Yes, connecting your Upstox account to AI assistants via MCP is completely free. You only need an active Upstox trading account and one of the supported AI clients.

What Upstox API data can I access through MCP?โ€‹

Through Upstox MCP, you can access portfolio holdings, positions, profit & loss data, account margins, market quotes, and historical trading information in real-time.

How often do I need to reconnect Upstox MCP?โ€‹

For security purposes, you need to reconnect your Upstox account once per day. This ensures your trading data remains secure and prevents unauthorized access.

Can I place trades through Upstox MCP?โ€‹

No, Upstox MCP provides read-only access to your account data. You cannot place orders, modify positions, or execute trades through the AI assistant for security reasons.

What should I do if Upstox MCP authentication fails?โ€‹

If authentication fails, check your internet connection, verify your Upstox credentials work on the main platform, try disconnecting and reconnecting.

How does Upstox MCP compare to other trading API integrations?โ€‹

Upstox MCP offers seamless natural language interaction with your trading data, real-time portfolio analysis, and integration with popular AI assistants, making it more accessible than traditional API implementations.

What are the system requirements for Upstox MCP?โ€‹

You need Node.js installed on your computer, an active Upstox trading account (non-dormant), and one of: Claude Desktop, ChatGPT (with Developer mode), Cursor, or VS Code with GitHub Copilot extension.

What if I have multiple Node.js or npx versions installed (for example via nvm)?โ€‹

If you have multiple versions of node and npx installed (for example via nvm), your AI client might pick the wrong binary when starting the MCP server. This can lead to startup errors similar to those described in this GitHub issue.

In this case, configure your MCP server by pointing directly to the full paths of node and npx instead of relying on the default npx on your PATH. For example:

{
"mcpServers": {
"mcp-server-upstox-api": {
"command": "/Users/name/.nvm/versions/node/v20.19.4/bin/node",
"args": [
"/Users/name/.nvm/versions/node/v20.19.4/bin/npx",
"mcp-remote",
"https://mcp.upstox.com/mcp"
]
}
}
}

Adjust the paths and URL to match your local Node.js installation and MCP endpoint.


Important Disclaimersโ€‹

Investment Decision Responsibility

AI-generated analysis serves as research support, not investment advice. Always:

  • Verify information independently and conduct your own due diligence
  • Cross-check AI outputs with multiple sources and professional analysis
  • Consult qualified financial advisors for major investment decisions
  • Recognize that AI responses may contain errors or incomplete information
  • Treat AI insights as research starting points, not final guidance
Data Verification

Although MCP provides real-time account access, confirm critical information directly through the Upstox platform before taking action.

Usage Terms: This integration offers data access for analytical purposes only. Investment outcomes remain your responsibility. Neither Upstox nor AI platforms bear liability for decisions based on AI-generated insights.