Serves MCP's tools over one server connection (spec 8 §11).
It answers initialize, tools/list, tools/call and ping, and refuses every other request with JSON-RPC error -32601; a notification, which carries no id, gets no reply.
- Tools. One per action the catalog lists as permitted for the session, named by the action id, whose inputSchema is the action's schema from schemas. A keyed model's tool also takes the instance key as the argument instance, and runs on the shared instance with that key. Any other model's tool runs on one private instance per model type, registered on the adapter's connection at its first call. A tool evaluate, taking {action, body}, is a dry run through ui-evaluate.
- A call's result is the action's result JSON as text content, or the server's err message with isError.
- The connection is opened when the adapter is made and closed when it is destroyed, which releases its private instances. The server treats it like any other connection, so its changes reach every watching GUI.
handle is called on the owner, McpOptions::callbacks, and its completion is delivered there.
Definition at line 79 of file agent.hpp.