Advertise only the capability this server actually has

The gem's default_capabilities advertises tools, prompts, resources and
logging. This server has only tools; logging is additionally deprecated as of
2026-07-28 (SEP-2577).

Passing capabilities: { tools: {} } makes server/discover honest. No
listChanged flag, because change notifications at this revision are delivered
over subscriptions/listen and this server does not serve it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
olaservo 2026-08-01 16:08:48 -07:00
commit b8b3289475

View file

@ -206,7 +206,12 @@ end
server = MCP::Server.new(
name: "weather",
version: "1.0.0",
tools: [GetAlerts, GetForecast]
tools: [GetAlerts, GetForecast],
# The gem otherwise advertises prompts, resources and logging as well. This
# server has only tools, and logging is deprecated as of 2026-07-28
# (SEP-2577). No listChanged: change notifications are delivered over
# `subscriptions/listen`, which this server does not serve.
capabilities: { tools: {} }
)
transport = MCP::Server::Transports::StdioTransport.new(server)