A production-ready Model Context Protocol (MCP) server that provides real-time market data from Massive API for ChatGPT integration. Built specifically for the OPTION TRADER ChatGPT project.
This MCP server exposes 5 powerful tools for accessing live market data:
- get_stock_quote - Real-time stock quotes
- get_options_chain - Options chain data with Greeks and IV
- get_historical_bars - Historical OHLCV price data
- get_market_snapshot - Comprehensive market snapshots
- search_ticker - Search for ticker symbols
- β Built with FastMCP framework for optimal performance
- β Async/await for concurrent requests
- β Comprehensive error handling
- β Detailed logging
- β Production-ready deployment to Render.com
- β Environment-based configuration
- β Type hints and documentation
- β ChatGPT Developer Mode compatible
- Python 3.10 or higher
- Massive API key (from trademassive.com)
- Render.com account (for deployment)
- ChatGPT Plus subscription with Developer Mode access
-
Clone or navigate to the project directory:
cd /home/ubuntu/massive-mcp-server -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\\Scripts\\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env
Edit
.envand add your Massive API key:MASSIVE_API_KEY=FbDpcHDdxr8qQAH0BQZToWkyxEqU9ead -
Run the server locally:
python server.py
-
Push your code to GitHub:
git init git add . git commit -m "Initial commit: Massive API MCP Server" git branch -M main git remote add origin https://github.com/YOUR_USERNAME/massive-mcp-server.git git push -u origin main
-
Create a new Web Service on Render:
- Go to Render Dashboard
- Click "New +" β "Web Service"
- Connect your GitHub repository
- Select the
massive-mcp-serverrepository
-
Configure the service:
- Name:
massive-mcp-server - Region: Oregon (US West)
- Branch:
main - Runtime: Python 3
- Build Command:
pip install -r requirements.txt - Start Command:
python server.py - Instance Type: Free
- Name:
-
Add Environment Variables: In the "Environment" section, add:
- Key:
MASSIVE_API_KEY - Value:
FbDpcHDdxr8qQAH0BQZToWkyxEqU9ead
- Key:
-
Deploy:
- Click "Create Web Service"
- Wait for deployment to complete (usually 2-3 minutes)
- Your server URL will be:
https://massive-mcp-server.onrender.com
-
Push your code to GitHub (same as Method 1, step 1)
-
Create from Blueprint:
- Go to Render Dashboard
- Click "New +" β "Blueprint"
- Connect your repository
- Render will auto-detect
render.yaml - Add the
MASSIVE_API_KEYenvironment variable - Click "Apply"
Once deployed, connect your MCP server to ChatGPT:
After deployment on Render, your server URL will be:
https://massive-mcp-server.onrender.com
-
Open ChatGPT Settings:
- Go to ChatGPT
- Click your profile β Settings
- Navigate to Beta Features
- Enable "Developer Mode"
-
Add MCP Server:
- Go to "Customize ChatGPT" β "Create new GPT" or open your existing "OPTION TRADER" project
- In the "Configure" tab, scroll to "Actions"
- Click "Create new action"
-
Configure MCP Connection:
- Server URL:
https://massive-mcp-server.onrender.com - The server will automatically expose its tools via MCP protocol
- Server URL:
In ChatGPT, try these test queries:
Get me a quote for AAPL
Show me the options chain for SPY expiring on 2026-02-20
Get historical daily bars for TSLA from 2026-01-01 to 2026-01-27
Search for Microsoft ticker
Get real-time stock quote.
Parameters:
symbol(string, required): Stock ticker symbol (e.g., 'AAPL', 'TSLA', 'SPY')
Returns:
- Current price, bid/ask, volume, and other quote data
Example:
get_stock_quote('AAPL')
# Returns: {"symbol": "AAPL", "price": 192.50, "bid": 192.48, "ask": 192.52, ...}Get options chain data.
Parameters:
symbol(string, required): Stock ticker symbolexpiration(string, optional): Expiration date in YYYY-MM-DD format
Returns:
- Options chain with calls/puts, strikes, Greeks, IV, volume, OI
Example:
get_options_chain('SPY', '2026-02-20')
# Returns full options chain for SPY expiring Feb 20, 2026Get historical OHLCV data.
Parameters:
symbol(string, required): Stock ticker symboltimeframe(string, optional): Bar size - '1Min', '5Min', '15Min', '1H', '1D' (default: '1D')from_date(string, optional): Start date YYYY-MM-DDto_date(string, optional): End date YYYY-MM-DDlimit(integer, optional): Max bars to return (default: 100, max: 10000)
Returns:
- Historical OHLCV bars with timestamps
Example:
get_historical_bars('AAPL', '1D', '2026-01-01', '2026-01-27')
# Returns daily bars for January 2026Get comprehensive market snapshot.
Parameters:
symbol(string, required): Stock ticker symbol
Returns:
- Quote, daily stats, trading statistics, market status
Example:
get_market_snapshot('TSLA')
# Returns comprehensive Tesla market dataSearch for ticker symbols.
Parameters:
query(string, required): Search term (company name or partial symbol)limit(integer, optional): Max results (default: 10)
Returns:
- List of matching symbols with names and exchanges
Example:
search_ticker('apple')
# Returns: [{"symbol": "AAPL", "name": "Apple Inc.", "exchange": "NASDAQ", ...}]| Variable | Description | Required | Default |
|---|---|---|---|
MASSIVE_API_KEY |
Your Massive API key | Yes | - |
PORT |
Server port | No | 8000 |
HOST |
Server host | No | 0.0.0.0 |
LOG_LEVEL |
Logging level | No | INFO |
The Massive API base URL is:
https://api.trademassive.com/v1
# Activate virtual environment
source venv/bin/activate
# Run server
python server.py
# In another terminal, test with curl or Python
python -c "
import asyncio
from server import get_stock_quote
async def test():
result = await get_stock_quote('AAPL')
print(result)
asyncio.run(test())
"Once deployed, your server will be accessible at:
https://massive-mcp-server.onrender.com
Once connected, you can ask ChatGPT natural language questions:
Stock Quotes:
- "What's the current price of Apple stock?"
- "Get me a quote for SPY"
- "Show me Tesla's current trading data"
Options Analysis:
- "Show me the options chain for AAPL expiring next month"
- "What are the call options available for SPY at 500 strike?"
- "Analyze the put options for TSLA"
Historical Data:
- "Get me the last 30 days of daily bars for NVDA"
- "Show me AAPL's 5-minute bars from today"
- "What was the trading volume for SPY last week?"
Market Snapshots:
- "Give me a complete market snapshot for Amazon"
- "Show me all trading data for Microsoft"
Ticker Search:
- "Find the ticker symbol for Nvidia"
- "Search for tech companies"
1. "MASSIVE_API_KEY not configured" error
- Ensure you've set the
MASSIVE_API_KEYenvironment variable - Check that your API key is valid and active
2. Server won't start locally
- Verify Python version (3.10+)
- Check all dependencies are installed:
pip install -r requirements.txt - Ensure port 8000 is not already in use
3. Render deployment fails
- Check build logs in Render dashboard
- Verify
requirements.txtis in root directory - Ensure environment variable is set correctly
4. ChatGPT can't connect to server
- Verify server is running (check Render logs)
- Confirm server URL is correct
- Check that server is publicly accessible
View logs in real-time on Render:
- Go to your service in Render Dashboard
- Click on "Logs" tab
- Monitor for any errors or issues
massive-mcp-server/
βββ server.py # Main MCP server with all tools
βββ requirements.txt # Python dependencies
βββ render.yaml # Render deployment configuration
βββ .env.example # Example environment variables
βββ .gitignore # Git ignore rules
βββ README.md # This file
- Never commit your
.envfile or API keys to Git - Keep your API key secure and rotate it regularly
- Use environment variables for all sensitive data
- The
.gitignorefile is configured to exclude.env
This project is provided as-is for use with the OPTION TRADER ChatGPT project.
For issues with:
- Massive API: Contact Massive Support
- Render Deployment: Check Render Documentation
- MCP Protocol: See MCP Documentation
- ChatGPT Integration: Visit OpenAI Help
- Python 3.10+ installed
- Massive API key obtained
- Dependencies installed (
pip install -r requirements.txt) -
.envfile created with API key - Server tested locally (
python server.py) - Code pushed to GitHub
- Render account created
- Service deployed on Render
- Environment variable set on Render
- Server URL obtained from Render
- ChatGPT Developer Mode enabled
- MCP server connected to ChatGPT
- Tools tested in ChatGPT
Built with β€οΈ for the OPTION TRADER ChatGPT Project
Massive API MCP Server - Bringing real-time market data to your AI trading assistant