AgentInProcessMcpServer class final
An MCP server, in-process: a JSON-RPC 2.0 message handler a caller invokes directly. It binds nothing and listens on nothing.
It is a presentation of binding's registry: tools/list is generated from
it and tools/call dispatches into it, so an MCP-only tool or an MCP-only
bypass cannot exist. The session is the binding's invocation — there is no
session credential, because there is no remote party.
It stamps its own calls. Every audit entry a tools/call records
carries entry: mcp, whatever context the binding was built with: the
surface a call arrived on is this server's fact, not its caller's.
Constructors
-
AgentInProcessMcpServer(AgentToolBinding<
AgentToolContext> binding, {required String serverName})
Properties
-
binding
→ AgentToolBinding<
AgentToolContext> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverName → String
-
The name
initializereports asserverInfo.name.final
Methods
-
handle(
Map< String, Object?> message) → Future<Map< String, Object?> ?> - Handles one JSON-RPC message: answers a request, or null for a notification.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- protocolVersion → const String
-
The MCP protocol revision this server answers
initializewith.