SSE: Add support for SSE handler options (#508)
mcp/sse: add support to provide for options for SSE transport - Add SSEOptions struct to define SSE handler options. - Update Signature of NewSSEHandler to accept SSEOptions [braking change] - Update unit test - Update example test Fixes https://github.com/modelcontextprotocol/go-sdk/issues/507, https://github.com/modelcontextprotocol/go-sdk/issues/503
This commit is contained in:
parent
4e9a387d04
commit
8c42b69817
1 changed files with 17 additions and 7 deletions
|
|
@ -31,7 +31,7 @@ func ExampleSSEHandler() {
|
|||
server := mcp.NewServer(&mcp.Implementation{Name: "adder", Version: "v0.0.1"}, nil)
|
||||
mcp.AddTool(server, &mcp.Tool{Name: "add", Description: "add two numbers"}, Add)
|
||||
|
||||
handler := mcp.NewSSEHandler(func(*http.Request) *mcp.Server { return server })
|
||||
handler := mcp.NewSSEHandler(func(*http.Request) *mcp.Server { return server }, nil)
|
||||
httpServer := httptest.NewServer(handler)
|
||||
defer httpServer.Close()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue