LEARN/THE MCP SERVER

The MCP server

Eleven tools over the simulator. A coding agent can ask whether momentum beats buy-and-hold here, and whether the difference is real.

pip install "tradefloor[mcp]"

claude mcp add tradefloor -- tradefloor-mcp

# then ask it a question in plain words

Inside the market, or outside it

An LLM agent trades The model is inside the market. It sends orders and the book answers.
An MCP client studies The model is outside the market. It composes a question, reads the answer, and writes no code.

Two places a model can sit

Both are supported and they answer different questions. Pick by what you want out.

OUTSIDE

The model studies the market

It writes no code Strategies, universes and scenarios arrive as data. There is no path from a tool argument to code execution.
It can not move a price No orders reach the book, so nothing the model asks changes the market it is asking about.
It gets the caveats Each result carries computed caveats and provenance, so a summary can not lose them.
It is cheap to be wrong check_envelope answers before you spend anything, and refuses a question the model can not support.
this page
INSIDE

The model trades the market

It sends orders The model reads an observation and answers with target weights at each step.
It pays for size Orders match against the engine's own depth, so the reward already carries the cost of the footprint.
It needs a harness Any object with an act method works. The model call sits inside that method.
It is slower and it costs One model call per decision. A 20-day run at three decisions a day is 60 calls.
the agents page
# outside: the model asks
check_envelope(days=252,
               roster="sp_like")
rank_strategies(
    specs=[momentum, hold],
    seeds=12)
# inside: the model decides
class LLMTrader:
    def act(self, obs):
        reply = ask_model(obs)
        return reply["weights"]
A model that trades pays for its own orders, so its score carries its footprint. A model that studies pays nothing and can not move a price. Neither one adapts to another agent: you trade against a market maker and aggregate flow.

The eleven tools

describe_simulator What is this, what is it certified to reproduce, what can it not do
check_envelope Is my question inside the certified envelope, before I spend anything
validate_strategy Is this spec well-formed, and what is its fingerprint
build_universe What roster shall I run against: generated, concentrated, or hand-authored
build_scenario What macro path shall I run through, and what does it look like day by day
evaluate_strategies How do these strategies do on one identical market
rank_strategies Which is really better, across seeds, with a paired sign test
run_stress_scenario What a shock does, always against the same market unshocked
explain_price_move Why did this price move, via the nine factors that sum to it
start_job Run something too slow to answer inline, including a full certified year
check_job Is it done, and what did it find

Strategies are data, never code

A client composes a strategy as JSON. There is no path from a tool argument to code execution.

{
  "spec_version": 1,
  "signal":    {"kind": "momentum", "lookback_days": 1.0},
  "portfolio": {"gross": 1.0, "top_k": 5},
  "execution": {"cadence": "step", "max_participation": 0.02},
  "seed": null
}

Universes and scenarios are data in the same way. Each result carries a fingerprint, so a second client can check the first one.

The limits, and why they exist

60 max_days, direct An inline call must answer while the client waits.
252 max_days, job The certified horizon, and no further.
120 max_universe Keeps one question inside one machine.
8 max_strategies Enough to compare, few enough to read.
12 max_seeds Enough for a paired sign test to mean something.

A direct call answers inline and caps at 60 days. A background job runs to 252 days, which is the certified horizon. Ask for more than that and the server refuses rather than returns a number it can not support.

Every result carries its own caveats

A model that summarises a result has the tool output and nothing else. Without the caveats in the payload it will report return_pct: 88.7 as "the strategy made 88.7%". So each result ships with computed caveats and full provenance: package version, preset, seed, universe fingerprint, and the strategy fingerprint.

One seed is not an answer

A single market is one sample. rank_strategies runs many seeds and compares them with a paired sign test. On the twelve-market grid the docs measure, mean-reversion wins 9 to 3 at p = 0.15. One seed picks the pooled leader eight times in twelve.

All pages

Back to the front door

All pages