Skip to content
OkamiStocks
Appearance
Get API key

API documentation

Use OkamiStocks from your AI assistant (MCP)

The Model Context Protocol (MCP) is an open standard that lets an AI assistant or agent call outside tools. The OkamiStocks MCP server gives your assistant thirteen tools, one for each kind of API request. Each tool takes the same fields as its endpoint, returns the same JSON, and follows your plan and your rate limit exactly as a direct API call does.

It is for anyone who wants to ask an assistant about stock and crypto prices in plain language, or let a coding agent pull market data while it builds your trading bot, dashboard or backtest, without writing the HTTP calls yourself.

Connect

MCP server URL

https://okamistocks.io/mcp

Authenticate with your API key, sent as this header on every request:

Authorization header

Authorization: Bearer <your API key>

Your key is on your dashboard, in the API Key panel (sign up free to get one). This is the one place the key goes in a header: the REST API reads it from the token body field. Never put the key in the URL. Generating a new key on the dashboard disconnects every assistant that still has the old one, so update each client's configuration afterwards.

Connect your client

Claude Code

claude mcp add --transport http okamistocks https://okamistocks.io/mcp \
  --header "Authorization: Bearer $OKAMI_API_TOKEN"

Claude Desktop

Customize > Connectors > + Add > Add custom connector
Connector name: OkamiStocks
Remote MCP server URL: https://okamistocks.io/mcp
Request headers: Authorization = Bearer <your API key>

Cursor

{
    "mcpServers": {
        "okamistocks": {
            "url": "https://okamistocks.io/mcp",
            "headers": {
                "Authorization": "Bearer ${env:OKAMI_API_TOKEN}"
            }
        }
    }
}

VS Code (GitHub Copilot)

{
    "mcpServers": {
        "okamistocks": {
            "type": "http",
            "url": "https://okamistocks.io/mcp",
            "headers": {
                "Authorization": "Bearer ${OKAMI_API_TOKEN}"
            }
        }
    }
}

Codex CLI

codex mcp add okamistocks --url https://okamistocks.io/mcp --bearer-token-env-var OKAMI_API_TOKEN

Other clients

Transport: Streamable HTTP
URL: https://okamistocks.io/mcp
Header: Authorization: Bearer <your API key>

Claude Desktop, the Claude web app and its mobile apps share custom connectors: on a Free, Pro or Max plan, add it yourself with the Claude Desktop steps above, putting the header under Request headers. Claude connects from its own cloud, not from your computer.

On a Team or Enterprise plan, members can't add a custom connector themselves: an organization owner adds it once with the same URL and header, and members then connect to the organization's connector. The header holds one API key, so everyone who connects to it uses that one key, its plan and its rate limit.

The other examples read the key from the OKAMI_API_TOKEN environment variable (for VS Code with GitHub Copilot, save the example as .mcp.json in your workspace root: the portable format with an mcpServers key, not .vscode/mcp.json, which uses servers). Set the variable where the client itself runs: an app started from the dock or start menu, a container or a remote session doesn't see a variable you only exported in your terminal. Claude Code saves the header in your own configuration. To share the server with a team through a project's .mcp.json file, use the form below: Claude Code expands the variable when it starts, so the key never lands in the repository.

.mcp.json (Claude Code, project scope)

{
    "mcpServers": {
        "okamistocks": {
            "type": "http",
            "url": "https://okamistocks.io/mcp",
            "headers": {
                "Authorization": "Bearer ${OKAMI_API_TOKEN}"
            }
        }
    }
}

Clients that only offer OAuth sign-in and can't send a request header can't connect yet.

Tools

Every plan sees all thirteen tools once connected; a tool your plan doesn't include returns an error when it is called, naming the plan it needs.

Tool What it returns Same as Plans
stock_quote The latest quote, minute bar or daily bar for one stock or ETF (snapshot: real-time, minute, daily) Real-time quote, Minute bar, Daily bar All (Free: the Free ticker list)
stock_quote_batch The same for 1 to 5 tickers, each with its own status Batch Standard, Supreme
stock_historical_bars Daily or intraday bars over a date range Historical bars Supreme
stock_corporate_actions Dividends, splits and other actions over a date range Corporate actions Supreme
stock_news One page of news articles, 10 unless you ask for up to 50 News Supreme
stock_range_stats The 52-week high and low with their dates, and 10- and 50-day average volume 52-week range Standard, Supreme
stock_top_movers The stocks with the biggest gains and losses since the previous close, up to 50 each Top movers Standard, Supreme
stock_most_active The most traded stocks so far today, by volume or trade count, up to 100 Most active Standard, Supreme
crypto_quote The latest quote, minute bar or daily bar for one crypto pair Crypto quote Standard, Supreme
crypto_quote_batch The same for 1 to 5 pairs Crypto batch Standard, Supreme
crypto_historical_bars Daily or intraday bars for a pair over a date range Historical crypto bars Supreme
crypto_top_movers The crypto pairs with the biggest gains and losses over the day, up to 50 each Crypto top movers Standard, Supreme
list_symbols What your plan can request for stocks or crypto List symbols All (crypto: Standard, Supreme)

Limits

Each tool call counts as one request against your plan's per-minute limit, shared with your direct API calls: Free 10, Standard 60 and Supreme 600 requests a minute (see Rate limits). As there, if the allowance can't be checked for a moment, the call is served rather than refused. Connecting and listing tools don't count.

A client may send at most 1,200 MCP requests a minute of any kind; past that it gets a 429 with X-Mcp-Request-* headers. A tool result can carry at most 50 KB of JSON. That is a size limit, not a token count: what a result costs your assistant depends on what is in it. A bigger result is refused with an error that says how big it was: ask for a shorter range, a larger timeframe or fewer articles. One news article with its full text can be over the limit by itself, so if a news result is refused even with a small limit, leave with_content off.

Errors

When a tool can't answer, its result is marked as an error and the text is JSON. status is the HTTP status the same API request would return and message its message (see Errors & recovery). A 422 adds errors, one list of messages per field; a 429 or 503 adds retry_after_seconds; a 403 for a tool your plan doesn't include adds upgrade_url. Problems with the connection itself are plain HTTP responses, covered below.

Example tool error 403

{"status":403,"message":"Historical data requires a Supreme subscription.","upgrade_url":"https://okamistocks.io/#pricing"}

Troubleshooting

401 when connecting
The key is missing or wrong. Check the header reads exactly Authorization: Bearer followed by the key on your dashboard, that the environment variable is set where the client runs, and that you haven't generated a new key since. Repeated wrong keys are slowed down with a 429; wait a minute before trying again.
403 when connecting
Your email address isn't verified yet: use the link in the verification email, then reconnect. A 403 also comes back when the request carries a browser Origin from another website; connect from an MCP client, not a web page's script.
403 from a tool
The tool isn't on your plan. The error names the plan it needs and carries an upgrade_url. On Free, a ticker outside the Free list is a 422 instead; list_symbols returns the list.
429
A tool error with retry_after_seconds means your plan's per-minute limit is used up, by tool calls and direct API calls together: wait that long. A plain HTTP 429 on the connection means the client sent more than 1,200 MCP requests in a minute, or too many wrong keys.

Keep the key out of shared files

Use the environment variable or the client's secret prompt, as above. A key committed to a repository or pasted into a shared configuration is public: anyone holding it can spend your quota.

News articles come from third-party publishers. Your assistant should treat their text as information, not as instructions.