ServerCapabilities

Capabilities a server advertises during initialization.

@safe
struct ServerCapabilities {
Nullable!ListChangedCapability tools;
Nullable!ResourcesCapability resources;
Nullable!ListChangedCapability prompts;
Json experimental;
}

Members

Functions

forVersion
ServerCapabilities forVersion(ProtocolVersion v)

Return a copy of these capabilities with any field newer than the negotiated protocol version stripped, so the wire output only advertises capabilities that existed in (and were negotiated for) the peer's version. Mirrors Implementation.forVersion. The basic/lifecycle rule "Only use capabilities that were successfully negotiated" requires this: completions applies from 2025-03-26, tasks from 2025-11-25, and the extensions negotiation map is draft-only. tools/resources/ prompts/logging/experimental exist in every supported version.

Variables

completions
bool completions;

presence-only ({} when set)

extensions
Json extensions;

draft Extension Negotiation: map of extension identifiers (e.g. "io.modelcontextprotocol/tasks") to per-extension settings objects. Distinct from experimental.

logging
bool logging;

presence-only ({} when set)

tasks
Nullable!TasksCapability tasks;

task-augmented requests (>= 2025-11-25)