Backplane.McpProtocol.Server.Modern.Executor (backplane_mcp_protocol v0.5.0)

Copy Markdown

Executes one modern MCP request without creating or retaining session state.

Application initialization and dispatch run inside a supervised request task. Result normalization is deliberately kept outside that failure boundary.

Summary

Functions

Executes a validated modern request and returns its JSON-RPC response envelope.

Types

execute_result()

@type execute_result() :: {:response, map()} | {:response, map(), [map()]}

server_snapshot()

@type server_snapshot() :: %{
  supported_versions: [String.t()],
  capabilities: map(),
  server_info: map(),
  instructions: String.t() | nil
}

Functions

execute(server_module, request, transport_context, opts \\ [])

@spec execute(module(), map(), map(), keyword()) :: execute_result()

Executes a validated modern request and returns its JSON-RPC response envelope.

The production-safe isolation: :caller_supervised mode runs server snapshot and callback work directly in the process calling execute/4. Use it only when that caller is itself a supervised, cancellable task that enforces the request deadline. This lets cancellation and timeout terminate the actual callback instead of only an intermediate task.

The :inline isolation value remains available only in tests. All other calls retain Executor's default per-callback supervised isolation.