Skip to main content
MacroFeed is delivered through Context Protocol. Your application authenticates with Context, and Context makes the authorized MCP request to MacroFeed. All calls go through Context API endpoints.
If you are adding MacroFeed to Cursor, Claude Code, OpenClaw, or another MCP client, start with Connect in 60 seconds. This page is for applications that call the Context SDK from their own server code.

Prerequisites

  1. Sign in to Context to create the embedded wallet.
  2. Set the USDC spending cap and fund the wallet. The official MCP prerequisites describe the current setup order.
  3. Open Context Settings and create an API key beginning with sk_live_.
  4. Install the TypeScript or Python SDK in your server-side application.

TypeScript

Python

Store the key in a server-side environment variable. The examples use CONTEXT_API_KEY; the variable name itself is your choice.
Never expose the Context API key in browser code or a public NEXT_PUBLIC_* environment variable.

Choose a mode

Discovery is free. MacroFeed’s current Query listing price is $0.00, but a Query can still incur Context model/orchestration cost. Always inspect the returned cost object. Execute sessions provide the clearest hard spend envelope for deterministic integrations.

Execute a tool

This example discovers MacroFeed, opens a session capped at $0.01, fetches the next USD CPI release, and closes the session so accrued calls can settle.
get_next_release currently costs $0.0004 per Execute call. The response contains MacroFeed’s structured event object in response.result, plus method-price and session-spend metadata.
Use health_check for a minimal connection test. Its current Execute price is $0.0001.

Run a managed Query

Use Query when the caller has a question rather than a predetermined tool call. Context can discover, select, call, and combine MacroFeed methods before returning an answer with evidence.
Passing the MacroFeed listing ID in tools constrains the managed run to this product. includeDeveloperTrace is useful during development for inspecting tool-call counts, retries, and fallback behavior.

Use Python

The Python SDK exposes the same Query product surface. This example pins every run to MacroFeed.
See the official Python SDK reference for Execute sessions, streaming, error handling, and response types.

Build a recurring MacroFeed routine

For a daily brief, alert, or scheduled research job, keep the MacroFeed listing ID pinned so every run uses the same product surface. When your own agent will write the report, request evidence rather than a second synthesized answer.
Start by validating the question interactively, then schedule the same pinned Query in your agent framework or server job. The official Agent Data Routines guide covers routine recipes, evidence_only, and full-data references.

Production guidance

  • Prefer Execute when your application already knows the MacroFeed method and arguments.
  • Use a fresh, appropriately sized Execute session for each bounded workflow and close it in finally.
  • Prefer Query for user-facing natural-language answers where synthesis is worth the additional model cost.
  • Log method.executePriceUsd, session.spent, and Query cost metadata for billing visibility.
  • Keep indicator keys stable in application code. Call list_indicators when users need discovery or taxonomy lookup.
  • Treat null actual, previous, or change values as explicit data availability states, not zero.
  • Forecast and surprise fields are reserved for compatibility; primary indicator response objects focus on official timing, actuals, previous values, and derived changes.
  • For long Query jobs, follow the current polling guidance in the official CTX MCP documentation rather than starting the same paid query twice.

Request flow

Your users do not need a separate MacroFeed API key. Context handles authorization, routing, and settlement between the calling application and MacroFeed.