feat(mcp): say what this server is for on the handshake #306

Merged
coilysiren merged 2 commits from aos/claude/bk79-eco-instructions into main 2026-08-16 06:44:01 +00:00
Owner

Refs coilyco-gaming/sirens-echo#647, which made a consumer able to read this.

Why now

sirens-echo now reads InitializeResult.Instructions off each rostered server and renders it into the model's prompt, so a server can say which questions it answers. Measuring that, I found eco publishes nothing - the server Echo's entire gaming purpose rests on told the model nothing about what it is for.

What it says

What distinguishes this server rather than that it exposes tools: world state, market prices, trades, recipes, skills, civics, climate, species. Plus two things a consumer gets wrong otherwise - it reads the game and never changes it, and prices move so a fresh call beats an earlier answer in the same conversation.

499 bytes.

Both transports

Set on the Server object and in build_initialization_options. Those are separate code paths - Streamable-HTTP derives options from the Server, stdio builds its own - and the existing comment says they are kept in parity by hand. A test now pins them together rather than trusting that.

Tests

844 pass, up from 841. The three new ones cover transport parity, that the text names what this server actually answers, and that it stays short enough to be carried on every turn by a consumer that inlines it.

Refs `coilyco-gaming/sirens-echo#647`, which made a consumer able to read this. ## Why now sirens-echo now reads `InitializeResult.Instructions` off each rostered server and renders it into the model's prompt, so a server can say which questions it answers. Measuring that, I found **eco publishes nothing** - the server Echo's entire gaming purpose rests on told the model nothing about what it is for. ## What it says What distinguishes this server rather than that it exposes tools: world state, market prices, trades, recipes, skills, civics, climate, species. Plus two things a consumer gets wrong otherwise - it reads the game and never changes it, and prices move so a fresh call beats an earlier answer in the same conversation. 499 bytes. ## Both transports Set on the `Server` object **and** in `build_initialization_options`. Those are separate code paths - Streamable-HTTP derives options from the Server, stdio builds its own - and the existing comment says they are kept in parity by hand. A test now pins them together rather than trusting that. ## Tests 844 pass, up from 841. The three new ones cover transport parity, that the text names what this server actually answers, and that it stays short enough to be carried on every turn by a consumer that inlines it.
A client sees several servers on a roster and has to choose one. The tool
list says what each tool does; nothing said what this server answers.

InitializationOptions carries instructions for exactly this, described by
the protocol as a hint a client may add to its system prompt. Set on both
transports, because the Streamable-HTTP path reads the Server object and
stdio builds its own options, and a test pins the two together rather
than trusting the existing parity comment.

The text names what distinguishes this server - world state, market
prices, recipes, skills, civics, climate - rather than restating that it
exposes tools. It also says prices move, because a consumer that caches
an earlier answer in the same conversation gets stale numbers.

Kept short deliberately. A consumer inlines this on every turn, so it is
a permanent per-turn cost rather than a one-off, and a test bounds it.

Refs coilyco-gaming/sirens-echo#647

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/eco-app!306
No description provided.