Documentation
¶
Overview ¶
Example: mcp_sse connects an MCP client to a server over the HTTP+SSE transport (MCP 2024-11-05). Unlike the stdio transport, which launches a server subprocess, the SSE transport talks to a remote server over HTTP: the client opens a long-lived Server-Sent Events stream to receive responses and POSTs JSON-RPC requests to an endpoint the server advertises.
To keep the example self-contained and CI-safe, it starts a minimal in-process SSE MCP server, then connects to it, lists its tools, and calls one. In a real deployment you would point the client at a remote URL instead.
go run ./examples/mcp_sse/
Click to show internal directories.
Click to hide internal directories.