Add StashGamma's daily OHLCV stock data to your AI assistant over MCP, then ask about any U.S.-listed symbol in plain language. Setup takes one URL.
Every StashGamma account gets its own API key (it starts with sg_live_). The key is how the server knows a request is yours: it identifies your account and counts the request against your plan's limits. Wherever this guide shows YOUR_API_KEY, your own key goes there.
Sign in and this page fills your key into every URL and snippet, ready to copy. The key is free — no card required.
Your connection URL
https://www.stashgamma.com/api/dataapi/mcp/YOUR_API_KEY
Replace YOUR_API_KEY with your key, or sign in and it is filled in for you.
How the key works
StashGamma and paste your connection URL from Step 1 into the server URL field.One command. Claude Code can send a header, so the key stays out of the URL:
claude mcp add --transport http stashgamma https://www.stashgamma.com/api/dataapi/mcp --header "X-Api-Key: YOUR_API_KEY"
Or add it to a project's .mcp.json:
{
"mcpServers": {
"stashgamma": {
"url": "https://www.stashgamma.com/api/dataapi/mcp",
"headers": { "X-Api-Key": "YOUR_API_KEY" }
}
}
}The Messages API can call remote MCP servers directly. Use https://www.stashgamma.com/api/dataapi/mcp as the server URL and your key as its authorization token — see Anthropic's MCP connector documentation for the current request format.
StashGamma, paste your connection URL from Step 1 as the MCP server URL, and set Authentication to No authentication — the key is already in the URL.A Custom GPT uses an OpenAPI schema rather than MCP. In GPT Builder → Configure → Actions, paste the contents of stashgamma-eod.openapi.yaml, then set Authentication to API Key, Auth Type Custom, header name X-Api-Key, and your key as the value.
The Responses API accepts a remote MCP server as a built-in tool. The key goes in a header here, not the URL:
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-4.1",
tools=[{
"type": "mcp",
"server_label": "stashgamma",
"server_url": "https://www.stashgamma.com/api/dataapi/mcp",
"headers": {"X-Api-Key": "YOUR_API_KEY"},
"require_approval": "never",
}],
input="What did QQQ close at, and how does that compare to a month ago?",
)
print(response.output_text)Once connected, the assistant picks the right tool by itself. Some things to try:
| Tool | What it returns | Counts as a request |
|---|---|---|
| get_latest_quote | Most recent daily bar plus change vs the previous close | Yes |
| get_eod_data | Daily OHLCV bars for a date range (default: last 30 days) | Yes |
| get_api_usage | Your plan and remaining requests per hour/day/week | No |
Data is end-of-day: daily bars, updated after the U.S. market close. It is not a real-time or intraday feed. All three tools are read-only.
BRK.B, not a company name).Building your own agent? See the MCP server page for SDK code samples and the API documentation for the protocol reference.
Free Stock Data API
Start here — the free tier, no card required, 300 requests/hour.
EOD Data API Quickstart Guide
Get a key and pull your first end-of-day bars in under 5 minutes.
Historical Stock Data API
15 years of daily OHLCV across U.S.-listed tickers, for backtesting & research.
Free Stock Market APIs Compared
How the free tier stacks up against Alpha Vantage, IEX, and others.
OHLCV Data API
What OHLCV data is and exactly how the response is shaped.
MCP Server for Stock Data
Connect Claude, OpenAI, ChatGPT, or another MCP-capable agent directly to the data.
Full API Documentation
Auth, endpoint reference, rate-limit headers, and error codes.
Ready to try it? Get your free API key — no card required.