Skip to main content

MCP Server

Access the official remote MCP server for fcontext market data.

Overview

Your AI assistant can use the fcontext MCP server to access authenticated, metered market data through your fcontext account. The first version exposes tools for realtime quotes, static instrument data, calculated quote indexes, candlesticks, market news, finance calendars, and top movers. The remote MCP endpoint is:
https://mcp.fcontext.com/mcp

Authentication

The MCP server uses OAuth 2.1. When an interactive MCP client connects for the first time, it redirects you to sign in and approve market-data access. No API key is needed for MCP clients. The authorization server is:
https://openapi.fcontext.com/api/auth
MCP access tokens are JWTs bound to the MCP resource audience:
https://mcp.fcontext.com/mcp
Tokens must include the market_data scope.
API keys are for the HTTP Market Data API at https://openapi.fcontext.com/api/market-data. MCP clients should use OAuth unless you are building your own server-side integration.

Getting Started

Choose a client that supports remote MCP servers and add the fcontext endpoint:
Add a remote MCP server with this URL:
https://mcp.fcontext.com/mcp
Complete the OAuth sign-in flow when Codex prompts you, then enable the server for chats that need market data.

MCP Tools

Once connected, your AI assistant can call these tools:
ToolDescription
fcontext_getCall a permitted fcontext market-data GET endpoint by relative path after /api/market-data.
fcontext_quoteFetch realtime quotes for one or more symbols.
fcontext_static_infoFetch static instrument information.
fcontext_calc_indexFetch calculated quote indexes.
fcontext_candlestickFetch historical candlestick data for a symbol.
fcontext_newsFetch market news.
fcontext_finance_calendarFetch financial calendar events.
fcontext_top_moversFetch top market movers.
All tools reuse the same account billing, usage analytics, and upstream credential isolation as the HTTP Market Data API. Caller bearer tokens, cookies, and API keys are never forwarded to the market-data provider.

Example Usage

After connecting, try asking your AI assistant:
  • “What is Apple’s latest quote?”
  • “Show me one month of daily candlesticks for Nvidia.”
  • “What are today’s top US market movers?”
  • “Find recent news for Tesla.”
  • “Check upcoming finance calendar events for this week.”
  • “Compare static information for AAPL.US and MSFT.US.”

Troubleshooting

ProblemWhat to check
Client cannot discover authorization metadataConfirm it can reach https://openapi.fcontext.com/api/auth/.well-known/oauth-authorization-server or https://openapi.fcontext.com/.well-known/oauth-authorization-server/api/auth.
MCP request returns 401Reconnect the MCP server and complete OAuth again. The response includes WWW-Authenticate with the protected resource metadata URL.
MCP request returns 403The token is valid but does not include the market_data scope. Re-authorize the client.
Tool call fails with a path errorUse relative paths with fcontext_get, such as quote or content/news; absolute URLs and path traversal are rejected.