ServerCapabilities class

Server capabilities configuration for MCP 2025-03-26 protocol

Annotations
  • @immutable

Constructors

ServerCapabilities({ToolsCapability? tools, ResourcesCapability? resources, PromptsCapability? prompts, LoggingCapability? logging, CompletionsCapability? completions, SamplingCapability? sampling, RootsCapability? roots, ProgressCapability? progress, Map<String, Map<String, dynamic>>? extensions})
const
ServerCapabilities.simple({bool tools = false, bool toolsListChanged = false, bool resources = false, bool resourcesListChanged = false, bool prompts = false, bool promptsListChanged = false, bool sampling = false, bool logging = false, bool completions = false, bool roots = false, bool rootsListChanged = false, bool progress = false})
Create a simple capabilities configuration with boolean flags
factory

Properties

completions → CompletionsCapability?
Completions support (spec: argument autocompletion via completion/complete).
final
extensions → Map<String, Map<String, dynamic>>?
Extensions framework (MCP 2026-07-28). Keys are reverse-DNS extension identifiers (e.g. io.modelcontextprotocol/tasks, following the _meta key naming rules with a mandatory prefix); values are per-extension settings objects (an empty object = supported with no settings). Advertised via server/discover / initialize capabilities.extensions. Additive — absent/empty for peers that do not use extensions.
final
hasCompletions → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasLogging → bool
no setter
hasProgress → bool
no setter
hasPrompts → bool
no setter
hasResources → bool
no setter
hasRoots → bool
no setter
hasSampling → bool
no setter
hasTools → bool
Helper getters for backward compatibility with old boolean-based API
no setter
logging → LoggingCapability?
Logging support capabilities
final
progress → ProgressCapability?
Progress support capabilities
final
prompts → PromptsCapability?
Prompt support capabilities
final
promptsListChanged → bool
no setter
resources → ResourcesCapability?
Resource support capabilities
final
resourcesListChanged → bool
no setter
roots → RootsCapability?
Roots support capabilities
final
rootsListChanged → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampling → SamplingCapability?
Sampling support capabilities
final
tools → ToolsCapability?
Tool support capabilities
final
toolsListChanged → bool
no setter

Methods

hasExtension(String id) → bool
Whether this capability set advertises the extension id (reverse-DNS key), e.g. io.modelcontextprotocol/tasks.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Convert capabilities to JSON
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited