u/cocopierlab

I built a macro MCP for trading agents — the hardest part was deciding when it should refuse to answer

I built a macro MCP for trading agents — the hardest part was deciding when it should refuse to answer

https://preview.redd.it/ke7yxip8m8uh1.png?width=1200&format=png&auto=webp&s=5d239548ba55d4afe721c5f4fd84d5a326176c2d

The screenshot is a real example.

I asked FX Context to find historical analogs for the latest US PCE release and show how EURUSD reacted after similar events.

It refused.

The reason was explicit:

  • only 6 usable PCE calibration events
  • 12 are required
  • each event needs at least 3 comparable metrics

So instead of fabricating an analog, it returned what it could verify: the latest PCE release, the absence of a valid pre-release consensus, and the actual EURUSD reaction after the release.

That’s the design philosophy behind FX Context.

It’s an MCP server for FX macro context covering:

  • US CPI, NFP and PCE
  • Fed, ECB, BOE and BOJ statements
  • actual vs. consensus and surprise where provenance is valid
  • historical EURUSD / GBPUSD / USDJPY reaction windows
  • upcoming macro risks
  • historical analogs when there is enough calibration data

A lot of the work has gone into making failure states explicit:

  • not enough historical samples → return the actual sample count and threshold
  • market closed during a reaction window → return MARKET_CLOSED
  • no verified pre-release consensus → say so instead of calculating a fake surprise
  • incomplete data → preserve provenance and timestamps rather than silently filling gaps

No predictions and no trade signals.

The goal is to keep the deterministic parts inside the data layer:

event → actual → consensus → surprise → market reaction → agent reasoning

and let the model focus on interpretation.

Known gaps: PCE consensus coverage is still incomplete, PCE historical analogs are calibration-gated, and NFP consensus coverage is patchy.

I’m the author. It’s closed source, free to use, and there’s no signup:

https://fx.coco-pier.com/mcp

I’m especially interested in feedback on the tool descriptions, response contract, and failure modes — particularly where an agent should refuse to answer instead of trying to infer around missing data.

reddit.com
u/cocopierlab — 7 days ago

Testing Claude with a structured macro context layer after today’s PCE release

I’ve been building FX Context, an MCP service for trading agents.

After today’s US PCE release, I asked Claude:

>Use FX Context to get the latest US PCE.

The screenshot shows the actual response.

The service returned the latest PCE release, including headline/core MoM and YoY values, plus derived values from the underlying index levels.

One useful thing this test exposed: this release didn’t yet have a consensus block in my service, so no surprise could be calculated.

The workflow I’m aiming for is:

actual → consensus → surprise → market reaction → agent reasoning

I’d rather keep those calculations deterministic and let the model focus on interpretation.

One thing I’m still testing: if I simply ask Claude “What’s the latest US PCE?”, it doesn’t always choose the MCP automatically. If I explicitly say “Use FX Context”, it does.

For people building AI trading systems: do you prefer giving the model raw macro data, or a normalized context layer like this?

u/cocopierlab — 15 days ago

Built an MCP server for macro context in trading agents

I’ve been experimenting with LLM-based trading agents and kept running into the same problem: the agent can reason about macro events, but getting reliable context often means separately finding the actual release, consensus, surprise, upcoming risks, and post-release market reaction.

So I built an MCP server around that workflow.

Right now it covers things like:

  • CPI / NFP / PCE
  • actual vs consensus
  • surprise
  • post-release EURUSD reaction
  • upcoming macro risks
  • major central-bank context

The design choice I’m most interested in feedback on is whether a domain-specific MCP should provide this higher-level normalized context, or mostly expose raw economic data and let the agent assemble everything itself.

I’ve leaned toward deterministic preprocessing in the MCP and leaving the actual trading judgment to the LLM.

Screenshot is the current landing page / interaction concept.

Curious how others here are designing domain-specific MCP servers.

u/cocopierlab — 18 days ago