NSE & BSE API Gateway

Connect AI Agents to Indian Stock Markets.

A Model Context Protocol (MCP) server delivering sub-millisecond NSE & BSE spot quotes, option chains, futures context, and volume metrics directly to Cursor, Claude, and your AI workflow.

cursor.json config
{
  "mcpServers": {
    "optioncontext-mcp": {
      "command": "uvx",
      "args": ["optioncontext-mcp"],
      "env": {
        "OPTIONCONTEXT_API_KEY": "oc_live_..."
      }
    }
  }
}
claude_desktop_config.json
{
  "mcpServers": {
    "optioncontext-mcp": {
      "command": "uvx",
      "args": ["optioncontext-mcp"],
      "env": {
        "OPTIONCONTEXT_API_KEY": "oc_live_..."
      }
    }
  }
}
python code example
from optioncontext import MCPClient

async with MCPClient(api_key="oc_live_...") as client:
    # Fetch option chain telemetry
    chain = await client.get_option_chain("NIFTY")
    print(chain.spot_price, chain.ohlc)

Query Option Chains

Test the interface in real-time. Hit fetch to query the NIFTY option chain context.

claude-3.5-sonnet ~ agent-session
User: Fetch current quote and option chain context.
Agent: [Calling Tool] get_option_chain(symbol: "NIFTY") ...
Agent: [Success] Rendered NIFTY SPOT (NSE): LTP: 24,320.50, Vol: 14.5M, PCR: 0.95.
Agent: Context formatted successfully. Displaying strike details.

Built for Machine Consumption

Standard financial data APIs dump massive, nested JSON payloads containing UI styling, exchange logs, and redundant metadata. This drains LLM context windows and spikes token cost.

OptionContext filters and compresses raw exchange pipelines into a custom space-separated key-value telemetry block, saving up to 80% on prompt footprint.

Relative Prompt Cost per Request
Standard REST API 8,500 tokens
OptionContext MCP 1,100 tokens (-87%)

Designed for Agent Workflows

🧩

MCP Protocol Standard

Expose stock markets to IDEs like Cursor and agents like Claude Desktop natively via Model Context Protocol JSON-RPC connections.

Cursor -> [REQ] get_option_chain { "symbol": "NIFTY" }
OptionContext -> [RES] Spot: 24,320.50 | Strikes: 7
🔋

Token-Efficient Payloads

Optimized option chains and quotes returned in custom light-text formats rather than massive raw JSONs, saving up to 80% on LLM input token costs.

-80% Tokens

Dual-Exchange Support

Access telemetry for both NSE and BSE in a single unified API pipeline.

NSE
BSE
🔑

Pre-Paid Credit Wallet

Pay only for what your agent actually reads. 1 credit for standard stock quotes, 10 credits for entire option chain slices. Linear top-ups with ₹0 monthly minimums.

Balance: 7,500 / 10,000 Credits
🔄

Stateful Retry Idempotency

Prevent double charges. Timed-out agent retries within 5 minutes serve fresh data with zero extra debits.

05:00
Active Lock
📊

Spot OHLC & Volume

Underlying indices and stock derivatives are returned complete with real-time Open, High, Low, Close, and Volume telemetry calculations.

O: 1,278
H: 1,292
L: 1,260
C: 1,278

Pre-paid Credit Packages

Simple pay-as-you-go pricing. 1 Quote = 1 Credit. 1 Option Chain = 10 Credits.

Free Trial

1,000 Credits
  • 1,000 free requests
  • Full access to MCP tools
  • Shared cluster access
  • Standard rate-limit (60 RPM)
Start Free (1,000 Credits)

Developer Starter

₹499 / 10,000 cr.
  • 10,000 active credits
  • High-priority Redis ticks
  • OHLC & Volume enrichments
  • Linear top-ups via Razorpay
  • Valid for 3 months
Buy Credits

Developer Pro

₹1,999 / 45,000 cr.
  • 45,000 active credits (5k bonus)
  • Isolated Redis read pathways
  • Unlimited API key generations
  • Priority email & Slack support
  • Valid for 6 months
Buy Credits