pub struct ServerCapabilities {
pub completions: Option<JsonObject>,
pub experimental: Option<BTreeMap<String, JsonObject>>,
pub extensions: Option<BTreeMap<String, JsonObject>>,
pub logging: Option<JsonObject>,
pub prompts: Option<ServerCapabilitiesPrompts>,
pub resources: Option<ServerCapabilitiesResources>,
pub tools: Option<ServerCapabilitiesTools>,
}Expand description
Latest MCP Protocol 2026_07_28 Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
JSON schema
{
"description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.",
"type": "object",
"properties": {
"completions": {
"description": "Present if the server supports argument autocompletion suggestions.",
"$ref": "#/$defs/JSONObject"
},
"experimental": {
"description": "Experimental, non-standard capabilities that the server supports.",
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/JSONObject"
}
},
"extensions": {
"description": "Optional MCP extensions that the server supports. Keys are extension identifiers\n(e.g., \"io.modelcontextprotocol/tasks\"), and values are per-extension settings\nobjects. An empty object indicates support with no settings.\n\nKeys MUST follow the {@link MetaObject_meta key naming rules}, with a\nmandatory prefix.",
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/JSONObject"
}
},
"logging": {
"description": "Present if the server supports sending log messages to the client.",
"$ref": "#/$defs/JSONObject"
},
"prompts": {
"description": "Present if the server offers any prompt templates.",
"type": "object",
"properties": {
"listChanged": {
"description": "Whether this server supports notifications for changes to the prompt list.",
"type": "boolean"
}
}
},
"resources": {
"description": "Present if the server offers any resources to read.",
"type": "object",
"properties": {
"listChanged": {
"description": "Whether this server supports notifications for changes to the resource list.",
"type": "boolean"
},
"subscribe": {
"description": "Whether this server supports subscribing to resource updates.",
"type": "boolean"
}
}
},
"tools": {
"description": "Present if the server offers any tools to call.",
"type": "object",
"properties": {
"listChanged": {
"description": "Whether this server supports notifications for changes to the tool list.",
"type": "boolean"
}
}
}
}
}Fields§
§completions: Option<JsonObject>Present if the server supports argument autocompletion suggestions.
experimental: Option<BTreeMap<String, JsonObject>>Experimental, non-standard capabilities that the server supports.
extensions: Option<BTreeMap<String, JsonObject>>Optional MCP extensions that the server supports. Keys are extension identifiers (e.g., “io.modelcontextprotocol/tasks”), and values are per-extension settings objects. An empty object indicates support with no settings. Keys MUST follow the {@link MetaObject_meta key naming rules}, with a mandatory prefix.
logging: Option<JsonObject>Present if the server supports sending log messages to the client.
prompts: Option<ServerCapabilitiesPrompts>§resources: Option<ServerCapabilitiesResources>§tools: Option<ServerCapabilitiesTools>Implementations§
Source§impl ServerCapabilities
impl ServerCapabilities
pub fn can_handle_request( &self, client_request: &ClientJsonrpcRequest, ) -> Result<(), RpcError>
Sourcepub fn can_accept_notification(
&self,
notification_method: &str,
) -> Result<(), RpcError>
pub fn can_accept_notification( &self, notification_method: &str, ) -> Result<(), RpcError>
Asserts that the server supports the requested notification.
Verifies that the server advertises support for the notification type, allowing callers to avoid sending notifications that the server does not support. This can be used to prevent issuing requests to peers that lack the required capability.
Trait Implementations§
Source§impl Clone for ServerCapabilities
impl Clone for ServerCapabilities
Source§fn clone(&self) -> ServerCapabilities
fn clone(&self) -> ServerCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more