Skip to content

Commit 3c5595b

Browse files
committed
fix: proper deprecation messaging for WithHTTPContextFunc
1 parent 35f8a89 commit 3c5595b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/custom_context/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func NewMCPServer() *MCPServer {
125125
func (s *MCPServer) ServeSSE(addr string) *server.SSEServer {
126126
return server.NewSSEServer(s.server,
127127
server.WithBaseURL(fmt.Sprintf("http://%s", addr)),
128-
server.WithSSEContextFunc(authFromRequest),
128+
server.WithHTTPContextFunc(authFromRequest),
129129
)
130130
}
131131

server/sse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func WithSSEEndpoint(endpoint string) SSEOption {
185185
// WithSSEContextFunc sets a function that will be called to customise the context
186186
// to the server using the incoming request.
187187
//
188-
// Deprecated: Use WithContextFunc instead. This will be removed in a future version.
188+
// Deprecated: Use WithHTTPContextFunc instead. This will be removed in a future version.
189189
//
190190
//go:deprecated
191191
func WithSSEContextFunc(fn SSEContextFunc) SSEOption {

server/sse_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ func TestSSEServer(t *testing.T) {
579579
return mcp.NewToolResultText(testVal), nil
580580
})
581581

582-
testServer := NewTestServer(mcpServer, WithSSEContextFunc(setTestValFromRequest))
582+
testServer := NewTestServer(mcpServer, WithHTTPContextFunc(setTestValFromRequest))
583583
defer testServer.Close()
584584

585585
// Connect to SSE endpoint

0 commit comments

Comments
 (0)