Skip to content

v0.x: MCP publishes progressively, on the estate's own module

Spec 0201, consuming go/mcp spec 0001.

What changed

The mcp command in every tool built on GTB is now the estate's go/mcp module, wired through pkg/mcp. The ophis dependency is gone.

The default tool list a client sees is different. Compact publication is the default: a client lists search_tools, get_tool_details and call_tool and finds your commands through them, rather than one native tool per command. Every command is still callable, with the same flags and args input and the same stdout, stderr, exitCode output; only how the client discovers it has changed.

What is retained

  • Every command spelling: mcp start, mcp stream (--host, --port, --log-level), mcp tools, and mcp claude|cursor|vscode enable|disable|list.
  • Exposure rules (spec 0089): mcp_enabled, setup.ExcludeFromMCP and setup.IncludeInMCP mean what they did.
  • The mcp tools export as the full offline catalogue, whatever the mode.
  • Tool names (<tool>_<path>) and the annotation keys (readOnlyHint and the rest), so client entries and gtb annotate carry across unchanged.

If you want the old shape

Set the project's publication mode and rebuild:

gtb set mcp.mode direct

That publishes one native tool per exposed command, with each tool's own annotations in the client's approval UI, and is recorded in the manifest as properties.mcp.mode: direct. Existing manifests say nothing and so publish compactly.

Smaller differences

  • Pure command groups are not published. A group whose RunE is setup.GroupRunE only prints usage; it is no longer a tool.
  • GTB's global flags are not tool parameters. --config, --debug, --ci and --accessible steer the process and are withheld from every tool's schema (--config would let a client point the tool at another configuration file). --output stays.
  • A custom pflag.Value type needs a codec. Ophis published unknown types as strings; the binding refuses to start until a codec is registered or the command is excluded, naming the command, flag and type. Every standard pflag kind is covered; keryx's 151 flags needed nothing.
  • mcp start --debug is mcp start --log-level debug; the root's own --debug still moves the same level.
  • In the export, title is the tool's own field, not annotations.title, matching the MCP specification. mcp stream now refuses browser origins other than its own unless listed with --origin.
  • Execution is bounded: one command at a time (a second call gets a retryable busy), a five-minute timeout, one MiB of retained output, and a cancelled call stops the command and everything it started.