list_tools and call_tool.
Connect it in one step
The fastest way to give an agent an API: run the CLI and paste the printed line. It comprehends the spec, serves it over Streamable-HTTP MCP, and prints a one-click “add” string for each host app.- Claude Code — paste the printed
claude mcp add …line. - Cursor / VS Code — open the printed deeplink (click it, or paste it into the address bar).
--public-url https://<tunnel> so the add strings and
the DNS-rebinding Host/Origin guard use your public URL. (For an embedded, in-process
server there’s also a stdio variant — see Using it in code below.)
What the agent sees
The surface lists every usable, question-shaped tool for the API plus one synthetic tool,search_capabilities, so the agent can go from plain-language intent to the
right endpoint and then call it.
name, description, and inputSchema — auth
plumbing and invocation metadata stay internal. Operations the current
session can’t satisfy are not listed at all.
The agent loop
1
Discover
Call
search_capabilities with the goal in plain language → ranked tool names.2
Inspect
Read the question-shaped
description and inputSchema of the top tool.3
Call
Call the tool by name with the inputs. Gecko builds the correct request,
injects auth, and returns the result.
Using it in code
McpSurface wraps an AgentApiClient and is testable without any MCP SDK installed:
Running a real stdio server
For a live MCP server,serve_stdio wraps the surface with the mcp SDK. It is
import-guarded, so the surface and its tests work without the SDK installed.
The MCP server is thin transport. All comprehension logic lives in the engine; the
server just parses input, calls the package, and formats output. Run it in
recorded
mode for a $0 surface, or live once a session is in place.