Directories
¶
| Path | Synopsis |
|---|---|
|
Package client implements a stateless MCP client for protocol revision 2026-07-28.
|
Package client implements a stateless MCP client for protocol revision 2026-07-28. |
|
examples
|
|
|
basic
command
A minimal MCP stdio server: one typed tool, one resource, one prompt.
|
A minimal MCP stdio server: one typed tool, one resource, one prompt. |
|
calculator
command
A calculator MCP server showing typed tools: the input schema (with enum and required constraints) is inferred from the Go struct, arguments are validated against it before the handler runs, and the output schema is derived from the return type.
|
A calculator MCP server showing typed tools: the input schema (with enum and required constraints) is inferred from the Go struct, arguments are validated against it before the handler runs, and the output schema is derived from the return type. |
|
elicitation
command
Elicitation via MRTR (multi round-trip requests), the 2026-07-28 replacement for server-initiated requests: the server answers tools/call with an input_required interim result; the client fulfills the input requests and retries automatically.
|
Elicitation via MRTR (multi round-trip requests), the 2026-07-28 replacement for server-initiated requests: the server answers tools/call with an input_required interim result; the client fulfills the input requests and retries automatically. |
|
file-server
command
A file-serving MCP server: files in a directory are exposed as resources under file:/// URIs, with path traversal blocked by the SDK (filepath.Localize + os.OpenRoot).
|
A file-serving MCP server: files in a directory are exposed as resources under file:/// URIs, with path traversal blocked by the SDK (filepath.Localize + os.OpenRoot). |
|
streamhttp
command
Streamable HTTP demo: a server exposing MCP on a single POST endpoint, and a client mode that exercises it (discover, tool call with progress over SSE, and a live subscription stream).
|
Streamable HTTP demo: a server exposing MCP on a single POST endpoint, and a client mode that exercises it (discover, tool call with progress over SSE, and a live subscription stream). |
|
tasks
command
The official tasks extension (io.modelcontextprotocol/tasks): a tool call becomes a durable task the client polls, including an input_required rendezvous answered via tasks/update.
|
The official tasks extension (io.modelcontextprotocol/tasks): a tool call becomes a durable task the client polls, including an input_required rendezvous answered via tasks/update. |
|
ext
|
|
|
tasks
Package tasks implements the official MCP tasks extension io.modelcontextprotocol/tasks (draft): task-augmented tool execution with polling, input_required rendezvous and status notifications.
|
Package tasks implements the official MCP tasks extension io.modelcontextprotocol/tasks (draft): task-augmented tool execution with polling, input_required rendezvous and status notifications. |
|
internal
|
|
|
headerbind
Package headerbind implements the x-mcp-header annotation of the Streamable HTTP transport: extracting bindings from tool input schemas, validating the spec's constraints, and encoding/decoding header values with the =?base64?...?= sentinel.
|
Package headerbind implements the x-mcp-header annotation of the Streamable HTTP transport: extracting bindings from tool input schemas, validating the spec's constraints, and encoding/decoding header values with the =?base64?...?= sentinel. |
|
Package protocol defines the wire types of the Model Context Protocol, revision 2026-07-28.
|
Package protocol defines the wire types of the Model Context Protocol, revision 2026-07-28. |
|
Package server implements a stateless MCP server for protocol revision 2026-07-28.
|
Package server implements a stateless MCP server for protocol revision 2026-07-28. |
|
Package transport defines the client-side transport abstraction of the stateless MCP 2026-07-28 protocol: a request goes out, a stream of notifications followed by one response comes back.
|
Package transport defines the client-side transport abstraction of the stateless MCP 2026-07-28 protocol: a request goes out, a stream of notifications followed by one response comes back. |
|
mem
Package mem provides an in-process transport that connects a client directly to a server's Handle function — for tests and embedding.
|
Package mem provides an in-process transport that connects a client directly to a server's Handle function — for tests and embedding. |
|
stdio
Package stdio implements the MCP stdio transport: newline-delimited JSON, nothing non-MCP on stdout, notifications/cancelled for cancellation, prompt exit on EOF.
|
Package stdio implements the MCP stdio transport: newline-delimited JSON, nothing non-MCP on stdout, notifications/cancelled for cancellation, prompt exit on EOF. |
|
streamhttp
Package streamhttp implements the MCP Streamable HTTP transport (2026-07-28): a single POST endpoint, standard Mcp-* request headers, JSON or SSE responses, and stream-close cancellation.
|
Package streamhttp implements the MCP Streamable HTTP transport (2026-07-28): a single POST endpoint, standard Mcp-* request headers, JSON or SSE responses, and stream-close cancellation. |
Click to show internal directories.
Click to hide internal directories.