Stop advertising the deprecated logging capability
go-sdk defaults ServerCapabilities to {"logging":{}} when ServerOptions is
nil — "for historical reasons", as its own doc comment puts it. This server
does no logging, and logging is deprecated as of 2026-07-28 (SEP-2577), so an
example for that revision should not be advertising it.
Passing an empty Capabilities suppresses the default. The tools capability is
still inferred from the registered tools, so server/discover now reports
{"tools":{"listChanged":true}} rather than logging alongside it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
88beed0069
commit
8ec30b939c
1 changed files with 9 additions and 2 deletions
|
|
@ -260,11 +260,18 @@ func alertsOutputSchema() *jsonschema.Schema {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Create MCP server
|
// Create MCP server.
|
||||||
|
//
|
||||||
|
// Passing an empty Capabilities suppresses the SDK's historical default of
|
||||||
|
// advertising {"logging":{}} — this server does no logging, and the logging
|
||||||
|
// feature is deprecated as of 2026-07-28 (SEP-2577). The tools capability is
|
||||||
|
// still inferred from the tools registered below.
|
||||||
server := mcp.NewServer(&mcp.Implementation{
|
server := mcp.NewServer(&mcp.Implementation{
|
||||||
Name: "weather",
|
Name: "weather",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
}, nil)
|
}, &mcp.ServerOptions{
|
||||||
|
Capabilities: &mcp.ServerCapabilities{},
|
||||||
|
})
|
||||||
|
|
||||||
// Add get_forecast tool
|
// Add get_forecast tool
|
||||||
mcp.AddTool(server, &mcp.Tool{
|
mcp.AddTool(server, &mcp.Tool{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue