Insights
Add a Stock-Market MCP Server to Codex
Alphanume Team · August 26, 2026
Add Alphanume to Codex with two OAuth commands, verify the account tier, and inspect a real point-in-time market-cap schema before asking for analysis.
Codex can query structured stock-market data after two shell commands. The first registers Alphanume's hosted MCP server. The second opens the Alphanume sign-in flow and stores the authorization for later Codex sessions. Once connected, Codex can discover 25 read-only data and status tools without an API key in its configuration file.
The important part is not merely seeing a server name in a settings screen. A useful setup proves three things: Codex can discover the tools, the hosted server can resolve the signed-in Alphanume account, and the account receives the expected Free or Pro access. The checks below establish those facts before any research prompt depends on them.
Connect Codex with two commands
Run the current OAuth setup from a terminal where the Codex CLI is available:
codex mcp add alphanume --url https://mcp.alphanume.com/mcp
codex mcp login alphanumeThe login command opens a browser. Sign in with the same Alphanume account used for the subscription, then return to the terminal. Confirm that the server is registered with codex mcp list. Inside the Codex terminal interface, /mcp shows whether the connection is active. The Alphanume MCP guide and official Codex MCP documentation describe the current client controls.
Validate tool discovery and account access
Start with a prompt that asks for inspection, not a market conclusion. It should force Codex to name the tools it can see and make a lightweight status call:
Use the Alphanume MCP server only.
1. List the available Alphanume tool names by category.
2. Call check_api_status.
3. Report whether the call succeeded and quote the returned status fields.
4. Do not infer my account tier from the tool list alone.
5. Query get_historical_market_cap for ticker AAPL and date 2024-06-28.
6. If the call returns 403 DATE_RANGE_RESTRICTED, report that the account does not have full-history access. If it returns data, report that this dated request is available to the account.
7. Make no trading recommendation.All tiers discover the same 25 tools, and check_api_status reports service status and version rather than the account tier. OAuth resolves the API key already attached to the signed-in account, and each call inherits that key's tier and rate limits. Free access covers the trailing 20 trading sessions with a one-trading-session delay, while Pro provides current observations and full history. The dated AAPL request above therefore tests historical entitlement: a 403 DATE_RANGE_RESTRICTED response is an access result, not evidence that the MCP server is offline.
Inspect the Historical Market Cap contract
Historical Market Cap is a good first schema inspection because the fields are compact and the point-in-time requirement is easy to state. The dataset records market capitalization and shares outstanding as they were known on each historical date. It supports ticker and date filters, and broad responses use cursor pagination. Read the Historical Market Cap documentation before building a size screen.
Field | Meaning | Research use |
|---|---|---|
date | Observation date | Align every filter to information available on that date |
ticker | Equity symbol | Join the observation to another Alphanume dataset |
market_cap | Point-in-time market capitalization | Apply a historical size threshold without current-cap leakage |
shares_outstanding | Shares outstanding at the time | Study issuance, buybacks, or changes in capitalization |
Ask Codex to inspect the tool definition before it queries. This catches assumptions such as treating a date range like an exact date or ignoring the two-part cursor required for additional pages.
Run one narrow, auditable query
Inspect get_historical_market_cap, then query ticker AAPL for 2024-06-28.
Return the raw response envelope and a four-column table containing date, ticker, market_cap, and shares_outstanding. State the exact filters used. If access is restricted, report 403 DATE_RANGE_RESTRICTED as evidence that this historical date is outside the account's entitlement. If the date has no row, report the empty result without substituting another date. Do not interpret one observation as a factor signal.The expected response starts with count and data. Larger calls can also return has_more and next_cursor. When has_more is true, both cursor date and cursor ticker must be sent back together. A request with only one cursor component returns a client error rather than a partial continuation.
Know what Codex has not validated
- A successful connection proves access, not data suitability for a particular strategy.
- A point-in-time field reduces future leakage only when every downstream join uses the same information cutoff.
- A model can select the wrong date, omit a page, or summarize a null value incorrectly unless the prompt requires raw fields and filters.
- The MCP layer returns the same deterministic records as REST, but it does not independently test causality, costs, survivorship, or execution feasibility.
If authentication fails after a successful browser sign-in, verify that Codex is using the intended server entry and Alphanume account. If a historical request fails while the status call works, test a recent date before treating it as an outage. That separates connection problems from tier restrictions and empty coverage.
Turn the inspection into a reusable check
Save the validation prompt and the schema table beside the research project. Re-run check_api_status, then the same one-date market-cap query, whenever the connector or account changes. Once the results are stable, use the Historical Market Cap explorer to compare the returned fields visually, or choose access on the pricing page before expanding the query into a historical size study.