Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/custom_context/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func NewMCPServer() *MCPServer {
func (s *MCPServer) ServeSSE(addr string) *server.SSEServer {
return server.NewSSEServer(s.server,
server.WithBaseURL(fmt.Sprintf("http://%s", addr)),
server.WithSSEContextFunc(authFromRequest),
server.WithHTTPContextFunc(authFromRequest),
)
}

Expand Down
2 changes: 1 addition & 1 deletion server/sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func WithSSEEndpoint(endpoint string) SSEOption {
// WithSSEContextFunc sets a function that will be called to customise the context
// to the server using the incoming request.
//
// Deprecated: Use WithContextFunc instead. This will be removed in a future version.
// Deprecated: Use WithHTTPContextFunc instead. This will be removed in a future version.
//
//go:deprecated
func WithSSEContextFunc(fn SSEContextFunc) SSEOption {
Expand Down
2 changes: 1 addition & 1 deletion server/sse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func TestSSEServer(t *testing.T) {
return mcp.NewToolResultText(testVal), nil
})

testServer := NewTestServer(mcpServer, WithSSEContextFunc(setTestValFromRequest))
testServer := NewTestServer(mcpServer, WithHTTPContextFunc(setTestValFromRequest))
defer testServer.Close()

// Connect to SSE endpoint
Expand Down