Connect over MCP
The Foresight API runs a hosted MCP server. There is nothing to install.
| URL | https://api.creativeforesight.io/api/mcp |
| Transport | Streamable HTTP (stateless, JSON responses) |
| Auth | Optional header Authorization: Bearer cf_live_... |
| Registry name | io.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.
| Tool | Without a key | With a key |
|---|---|---|
search_indicators | Yes | Yes |
list_sources | Yes | Yes |
list_regions | Yes | Yes |
get_observations | Payment instructions | Yes, within your tier |
get_latest | Payment instructions | Yes, within your tier |
get_insights | Payment instructions | Yes, within your tier |
get_active_signals | Payment instructions | Yes, within your tier |
ask | Payment instructions | Yes, 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/mcpWith 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.
- Open Customize → Connectors.
- Click +, then Add custom connector.
- Name it
Foresight APIand pastehttps://api.creativeforesight.io/api/mcpas the URL. - 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
- Use with AI Agents: call the REST API from your own tool-use code instead of MCP.
- Pay per request (402): how a keyless agent pays for a data call.
- Pricing & Limits: what each tier includes.