Skip to Content
GuidesConnect over MCP

Connect over MCP

The Foresight API runs a hosted MCP server. There is nothing to install.

URLhttps://api.creativeforesight.io/api/mcp
TransportStreamable HTTP (stateless, JSON responses)
AuthOptional header Authorization: Bearer cf_live_...
Registry nameio.creativeforesight/foresight-api

With or without a key

Catalog tools work without a key. The data tools need a key. Called without one, they return an error that names the equivalent REST endpoint, which an agent can pay for per request instead.

ToolWithout a keyWith a key
search_indicatorsYesYes
list_sourcesYesYes
list_regionsYesYes
get_observationsPayment instructionsYes, within your tier
get_latestPayment instructionsYes, within your tier
get_insightsPayment instructionsYes, within your tier
get_active_signalsPayment instructionsYes, within your tier
askPayment instructionsYes, within your tier

Get a free key with one request (see Signup), then export it so the configs below can read it:

export FORESIGHT_API_KEY=cf_live_...

If you don’t have a key, leave the Authorization header out. An empty or invalid key returns INVALID_API_KEY instead of the payment instructions.

Claude Code

Without a key:

claude mcp add --transport http foresight https://api.creativeforesight.io/api/mcp

With a key, add the header. Your shell expands $FORESIGHT_API_KEY when you run the command, so the key is saved in your Claude Code config:

claude mcp add --transport http foresight https://api.creativeforesight.io/api/mcp \ --header "Authorization: Bearer $FORESIGHT_API_KEY"

To share the server with a team without committing a key, put it in the project’s .mcp.json. Claude Code expands ${FORESIGHT_API_KEY} from each person’s environment:

{ "mcpServers": { "foresight": { "type": "http", "url": "https://api.creativeforesight.io/api/mcp", "headers": { "Authorization": "Bearer ${FORESIGHT_API_KEY}" } } } }

Check it with claude mcp get foresight, then ask Claude something like “What is the latest US unemployment rate?”

Claude Desktop and claude.ai

Claude Desktop connects to remote MCP servers as custom connectors. claude_desktop_config.json is only for local servers.

  1. Open Customize → Connectors.
  2. Click +, then Add custom connector.
  3. Name it Foresight API and paste https://api.creativeforesight.io/api/mcp as the URL.
  4. Leave the OAuth fields empty and save.

A custom connector can’t send an API key, so it gets the keyless behavior above. For keyed access from Claude, use Claude Code.

On Team and Enterprise plans an Owner adds the connector under Organization settings → Connectors, and members then click Connect.

Cursor

Add the server to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{ "mcpServers": { "foresight": { "url": "https://api.creativeforesight.io/api/mcp", "headers": { "Authorization": "Bearer ${env:FORESIGHT_API_KEY}" } } } }

Without a key, delete the headers block. Cursor reads ${env:FORESIGHT_API_KEY} from the environment it was launched from.

Any streamable HTTP client

Every client needs the same two values: the URL, plus the Authorization header when you have a key. Pick the streamable HTTP transport; some clients label it “HTTP”. The field names vary by client, so check its MCP docs.

With the official TypeScript SDK (npm install @modelcontextprotocol/sdk):

import { Client } from '@modelcontextprotocol/sdk/client/index.js' import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js' const apiKey = process.env.FORESIGHT_API_KEY const transport = new StreamableHTTPClientTransport( new URL('https://api.creativeforesight.io/api/mcp'), { requestInit: { headers: apiKey ? { Authorization: `Bearer ${apiKey}` } : {} } }, ) const client = new Client({ name: 'my-agent', version: '1.0.0' }) await client.connect(transport) const { tools } = await client.listTools() console.log(tools.map((tool) => tool.name)) const result = await client.callTool({ name: 'search_indicators', arguments: { query: 'unemployment rate', limit: 3 }, }) console.log(result.content)

The server is stateless, so plain JSON-RPC over HTTP works too:

curl -X POST "https://api.creativeforesight.io/api/mcp" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Next steps

Last updated on