go-sdk/examples/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Guglielmo Colombo 65ece59643
mcp: Allow registration of custom JSON-RPC methods (#956)
## Description

This PR introduces support for custom (non-standard) JSON-RPC methods in
the MCP Go SDK.
This feature enables servers to handle arbitrary JSON-RPC methods and
clients to invoke them, all while maintaining full type safety and
integrating seamlessly with the SDK's existing middleware and session
management.

- Server-Side Registration: Added AddReceivingCustomMethod to allow
servers to register handlers for custom methods. Incoming requests are
automatically unmarshaled into user-defined parameter structs.
- Client-Side Calling: Added AddSendingCustomMethod which returns a
strongly-typed caller function that clients can use to invoke custom
methods and receive strongly-typed results.
- Helper Structs: Provided ParamsBase and ResultBase for users to embed
in their custom structs. This allows them to easily satisfy the SDK's
internal Params and Result interfaces.

Fixes #954
2026-06-25 23:13:17 +02:00
..
auth-middleware auth: issuer mix-up mitigation (#859) 2026-05-27 11:39:08 +02:00
basic mcp/examples: move server example into example folder (#357) 2025-08-26 09:13:30 -04:00
completion docs: document completion support (#495) 2025-09-18 14:27:35 -04:00
custom-method mcp: Allow registration of custom JSON-RPC methods (#956) 2026-06-25 23:13:17 +02:00
custom-transport all: remove ServerRequest[T] for concrete T (#342) 2025-08-21 12:10:53 -04:00
distributed mcp: Deprecate roots, sampling and logging (SEP-2577) (#1017) 2026-06-23 11:11:08 +02:00
elicitation mcp/examples: move elicitation example into example folder (#354) 2025-08-22 11:01:48 -04:00
everything mcp: Deprecate roots, sampling and logging (SEP-2577) (#1017) 2026-06-23 11:11:08 +02:00
hello examples: add an everything example, and simplify hello 2025-08-22 14:00:37 -04:00
memory all: fix typos (#869) 2026-03-30 18:43:01 +02:00
middleware examples/server/middleware: log tool result (#400) 2025-09-03 11:34:02 -04:00
proxy examples: add an example that display header forwarding. (#836) 2026-03-10 10:57:55 +01:00
rate-limiting auth: issuer mix-up mitigation (#859) 2026-05-27 11:39:08 +02:00
sequentialthinking mcp: use rand.Text and slog.DiscardHandler over internal implementation (#773) 2026-02-03 14:23:59 +01:00
sse SSE: Add support for SSE handler options (#508) 2025-09-19 13:01:57 -04:00
toolschemas all: fix typos (#869) 2026-03-30 18:43:01 +02:00