ruby-sdk/docs/_server/index.md
Koichi ITO 6f0b85486b [Doc] Mark the deprecated features on the server overview
The overview's Key Features and Supported Methods listed `roots`, `sampling`, and `logging/setLevel` with no deprecation marking,
while their own pages carry the SEP-2577 warnings, presenting a current-looking feature surface to a reader skimming the overview.
The five entries now carry the pages' "deprecated as of 2026-07-28" wording; `elicitation/create` stays unmarked - it is not deprecated,
and the modern lifecycle keeps carrying it as requests embedded per the multi round-trip requests pattern.
2026-09-01 01:14:59 +09:00

3 KiB

layout title nav_order permalink redirect_from
default Overview 1 /server/
/building-servers.html
/building-servers/

Building an MCP Server

The MCP::Server class is the core component that handles JSON-RPC requests and responses. It implements the Model Context Protocol specification, handling model context requests and responses.

Key Features

  • Implements JSON-RPC 2.0 message handling
  • Supports protocol initialization and capability negotiation
  • Manages tool registration and invocation
  • Supports prompt registration and execution
  • Supports resource registration and retrieval
  • Supports stdio and Streamable HTTP (including SSE) transports
  • Supports notifications for list changes (tools, prompts, resources)
  • Supports roots (server-to-client filesystem boundary queries; deprecated as of 2026-07-28)
  • Supports sampling (server-to-client LLM completion requests; deprecated as of 2026-07-28)
  • Supports cursor-based pagination for list operations
  • Supports cancellation of in-flight requests on both server and client (notifications/cancelled)

Supported Methods

  • initialize - Initializes the protocol and returns server capabilities
  • server/discover - Sessionless capability discovery (MCP 2026-07-28, SEP-2575): returns the server's capabilities before initialize and without an Mcp-Session-Id, and anchors the stateless modern lifecycle; see Discovery
  • subscriptions/listen - Long-lived notification subscription stream (MCP 2026-07-28, SEP-2575), replacing the legacy HTTP GET listening stream; see Subscriptions
  • Multi round-trip input_required results (MCP 2026-07-28, SEP-2322): handlers return MCP::Server::InputRequiredResult to ask the client for additional input instead of performing a server-initiated request; see Multi Round-Trip Requests
  • ping - Simple health check
  • logging/setLevel - Configures the minimum log level for the server (deprecated as of 2026-07-28)
  • tools/list - Lists all registered tools and their schemas
  • tools/call - Invokes a specific tool with provided arguments
  • prompts/list - Lists all registered prompts and their schemas
  • prompts/get - Retrieves a specific prompt by name
  • resources/list - Lists all registered resources and their schemas
  • resources/read - Retrieves a specific resource by name
  • resources/templates/list - Lists all registered resource templates and their schemas
  • resources/subscribe - Subscribes to updates for a specific resource
  • resources/unsubscribe - Unsubscribes from updates for a specific resource
  • completion/complete - Returns autocompletion suggestions for prompt arguments and resource URIs
  • roots/list - Requests filesystem roots from the client (server-to-client; deprecated as of 2026-07-28)
  • sampling/createMessage - Requests LLM completion from the client (server-to-client; deprecated as of 2026-07-28)
  • elicitation/create - Requests user input from the client (server-to-client)