Skip to main content

Official Model Context Protocol (MCP) Server for OptionContext Stock and Options Data APIs

Project description

OptionContext MCP Server

Official Model Context Protocol (MCP) Server for the OptionContext Stock and Options Data APIs. This premium integration delivers rich analytical and structural data for Indian Stock Markets directly into LLM agents and clients supporting the Model Context Protocol.

Installation

You can install the OptionContext MCP package using pip, or run it on-demand with Node and LLM-centric workflows.

Installation via pip

pip install optioncontext_mcp

Direct Run with uvx (Python environment)

uvx optioncontext-mcp

Configuration

To use the OptionContext MCP Server, you must specify your API key and base endpoint URL. You can configure these options via environment variables:

  • OPTIONCONTEXT_API_KEY: Your Agent-as-a-Service API key.
  • OPTIONCONTEXT_BASE_URL: The OptionContext endpoint gateway URL (defaults to https://mcp.optioncontext.com if omitted).

For local or custom API gateway environments, OPTIONCONTEXT_BASE_URL will fallback automatically to FASTAPI_BASE_URL if defined.

Available Tools

The MCP Server exposes the following powerful market analytical tools to any connected client:

  1. suggest_symbols

    • Description: Search and resolve correct ticker symbols (e.g., searching 'Reliance' to get 'RELIANCE').
    • Arguments:
      • query (string): The search text or company name.
  2. get_market_context

    • Description: Fetch live quote details, last traded price (LTP), volume, and context for Stocks, Indices, and Futures.
    • Arguments:
      • symbol (string): Ticker symbol (e.g. 'NIFTY', 'BANKNIFTY', 'RELIANCE').
      • expiry (string, optional): Expiry cycle ('SPOT', 'NEAR', 'FAR', 'NEXT'). Default is 'SPOT'.
      • asset_type (string, optional): Asset category ('stock', 'index', 'future', 'auto'). Default is 'auto'.
      • api_key (string, optional): Override API Key. If omitted, uses environment key.
  3. get_option_chain

    • Description: Fetch complete option chain matrix including PCR, ATM strike, CE/PE quotes, volume, and Greeks.
    • Arguments:
      • symbol (string): Underlying index or stock ticker (e.g. 'NIFTY', 'BANKNIFTY').
      • api_key (string, optional): Override API Key. If omitted, uses environment key.
  4. get_historical_data

    • Description: Fetch historical daily/intraday OHLCV candles (Requires Plan B subscription).
    • Arguments:
      • symbol (string): Ticker symbol.
      • from_date (string): YYYY-MM-DD.
      • to_date (string): YYYY-MM-DD.
      • interval (string, optional): Candle interval ('ONE_MINUTE', 'FIVE_MINUTE', 'FIFTEEN_MINUTE', 'ONE_DAY'). Default is 'ONE_DAY'.
      • api_key (string, optional): Override API Key.

Disclaimer & Risk Warning:

  • Data Delay: All market prices, quotes, and option chains provided represent the last completed minute (minimum 1-minute delayed feed) and are not real-time tick feeds.
  • Accuracy: Data is provided on an 'as-is' basis without warranties of absolute accuracy or timeliness.
  • No Liability: The service is strictly for analytical/educational purposes. We assume no liability for any trading losses or investment decisions.
  • Regulatory Risk Disclosure: Trading in derivatives (options and futures) involves high risk. Past performance is not indicative of future results.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optioncontext_mcp-0.1.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optioncontext_mcp-0.1.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file optioncontext_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: optioncontext_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for optioncontext_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 11402147930089b09746039091393f87c35b7832d91f65ecee460bf8f4c5f082
MD5 0d79f26d1a78db60377858e3dca81b2b
BLAKE2b-256 6b09d08093210cd0d3a8555907976c8e49cd0ee27bb21b590c2e9a8e0801163e

See more details on using hashes here.

File details

Details for the file optioncontext_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for optioncontext_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 712066ba5fa4c190b5b18e84479f07c6332dda752a0c36e9cc4a8e049a7347bf
MD5 333a5cb9ed8892101f1090ed26e18e14
BLAKE2b-256 382a42bb2d782b65d1f9c5f5d766e8f16f23f99fa1e8638177f2d395a4f53179

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page