Everything on the MCP (Model Context Protocol) side of tools: authenticating
to a server, speaking its session protocol, the spec format that constrains what
an agent may call, and the runtime validator that enforces it. The directory
root holds no code of its own — only a cross-package integration test.
The Streamable-HTTP MCP client, backed by the official MCP Go SDK. Reachability probes, tool discovery, tool-call dispatch, and the per-AgentSession SessionCache.
httptest-backed fake MCP servers for probe, dispatch, controller and CLI tests.
Constraints
probe speaks the full session protocol (initialize → Mcp-Session-Id →
notifications/initialized). A bare stateless JSON-RPC POST is rejected by
spec-compliant servers, so nothing here hand-rolls one.
A server URL is agent-influenceable — it comes from
MCPServer.spec.server.url. probe.Client defaults to the SSRF-guarded
pkg/x/safehttp client; only tests and
operator-controlled targets (a sidecar pod IP, loopback) set HTTP
explicitly.
A tool's Description reaches the model verbatim unless a spec overrides
it. Treat it as untrusted prompt text.
pkg/tools/mcp/testing shadows the stdlib testing package name; import it
aliased as mcptest.
The MCP and toolspec validators are deliberately parallel
and share their Decision / Trace / redaction machinery through
pkg/authz/validator/core. Keep them so.
Package probe is the Streamable-HTTP MCP client used by the runner (sidecar + MCPServer tool synthesis and dispatch), the operator controllers (MCPServer / SidecarToolbox reachability), and the oap CLI.
Package probe is the Streamable-HTTP MCP client used by the runner (sidecar + MCPServer tool synthesis and dispatch), the operator controllers (MCPServer / SidecarToolbox reachability), and the oap CLI.
Package validator orchestrates per-tool-call validation of MCP server invocations against an MCPServer spec, producing a Decision that mirrors the shape of pkg/tools/toolspec/validator.Decision.
Package validator orchestrates per-tool-call validation of MCP server invocations against an MCPServer spec, producing a Decision that mirrors the shape of pkg/tools/toolspec/validator.Decision.
Click to show internal directories.
Click to hide internal directories.
go.dev uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic. Learn more.