Optionalicons?: { mimeType?: string; sizes?: string; src: string; [key: string]: unknown }[]An optional list of icons for this implementation.
This can be used by clients to display the implementation in a user interface.
Each icon should have a kind property that specifies whether it is a data representation or a URL source, a src property that points to the icon file or data representation, and may also include a mimeType and sizes property.
The mimeType property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
The sizes property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
The sizes property is optional, and if not provided, the client should assume that the icon can be used at any size.
Intended for programmatic or logical use, but used as a display name in past specs or fallback
Optionaltitle?: stringIntended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology.
If not provided, the name should be used for display (except for Tool,
where annotations.title should be given precedence over using name,
if present).
OptionalwebsiteUrl?: stringAn optional URL of the website for this implementation.
Optionaloptions: ServerOptionsReadonlyserverThe underlying Server instance, useful for advanced operations like sending notifications.
Closes the connection.
Attaches to the given transport, starts it, and starts listening for messages.
The server object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
Checks if the server is connected to a transport.
True if the server is connected
Registers a zero-argument prompt name, which will run the given function when the client calls it.
Registers a zero-argument prompt name (with a description) which will run the given function when the client calls it.
Registers a prompt name accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments.
Registers a prompt name (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments.
Registers a prompt with a config object and callback.
Registers a resource with a config object and callback. For static resources, use a URI string. For dynamic resources, use a ResourceTemplate.
Registers a resource with a config object and callback. For static resources, use a URI string. For dynamic resources, use a ResourceTemplate.
Registers a tool with a config object and callback.
Registers a resource name at a fixed URI, which will use the given callback to respond to read requests.
Registers a resource name at a fixed URI with metadata, which will use the given callback to respond to read requests.
Registers a resource name with a template pattern, which will use the given callback to respond to read requests.
Registers a resource name with a template pattern and metadata, which will use the given callback to respond to read requests.
Sends a logging message to the client, if connected. Note: You only need to send the parameters object, not the entire JSON RPC message
Optional_meta?: { [key: string]: unknown }See MCP specification for notes on _meta usage.
Optionaldata?: unknownThe data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
The severity of this log message.
Optionallogger?: stringAn optional name of the logger issuing this message.
OptionalsessionId: stringoptional for stateless and backward compatibility
Sends a prompt list changed event to the client, if connected.
Sends a resource list changed event to the client, if connected.
Sends a tool list changed event to the client, if connected.
Registers a zero-argument tool name, which will run the given function when the client calls it.
Registers a zero-argument tool name (with a description) which will run the given function when the client calls it.
Registers a tool taking either a parameter schema for validation or annotations for additional metadata.
This unified overload handles both tool(name, paramsSchema, cb) and tool(name, annotations, cb) cases.
Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types.
OptionaldestructiveHint?: booleanIf true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates.
(This property is meaningful only when readOnlyHint == false)
Default: true
OptionalidempotentHint?: booleanIf true, calling the tool repeatedly with the same arguments will have no additional effect on the its environment.
(This property is meaningful only when readOnlyHint == false)
Default: false
OptionalopenWorldHint?: booleanIf true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. For example, the world of a web search tool is open, whereas that of a memory tool is not.
Default: true
OptionalreadOnlyHint?: booleanIf true, the tool does not modify its environment.
Default: false
Optionaltitle?: stringA human-readable title for the tool.
Registers a tool name (with a description) taking either parameter schema or annotations.
This unified overload handles both tool(name, description, paramsSchema, cb) and
tool(name, description, annotations, cb) cases.
Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types.
OptionaldestructiveHint?: booleanIf true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates.
(This property is meaningful only when readOnlyHint == false)
Default: true
OptionalidempotentHint?: booleanIf true, calling the tool repeatedly with the same arguments will have no additional effect on the its environment.
(This property is meaningful only when readOnlyHint == false)
Default: false
OptionalopenWorldHint?: booleanIf true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. For example, the world of a web search tool is open, whereas that of a memory tool is not.
Default: true
OptionalreadOnlyHint?: booleanIf true, the tool does not modify its environment.
Default: false
Optionaltitle?: stringA human-readable title for the tool.
Registers a tool with both parameter schema and annotations.
OptionaldestructiveHint?: booleanIf true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates.
(This property is meaningful only when readOnlyHint == false)
Default: true
OptionalidempotentHint?: booleanIf true, calling the tool repeatedly with the same arguments will have no additional effect on the its environment.
(This property is meaningful only when readOnlyHint == false)
Default: false
OptionalopenWorldHint?: booleanIf true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. For example, the world of a web search tool is open, whereas that of a memory tool is not.
Default: true
OptionalreadOnlyHint?: booleanIf true, the tool does not modify its environment.
Default: false
Optionaltitle?: stringA human-readable title for the tool.
Registers a tool with description, parameter schema, and annotations.
OptionaldestructiveHint?: booleanIf true, the tool may perform destructive updates to its environment. If false, the tool performs only additive updates.
(This property is meaningful only when readOnlyHint == false)
Default: true
OptionalidempotentHint?: booleanIf true, calling the tool repeatedly with the same arguments will have no additional effect on the its environment.
(This property is meaningful only when readOnlyHint == false)
Default: false
OptionalopenWorldHint?: booleanIf true, this tool may interact with an "open world" of external entities. If false, the tool's domain of interaction is closed. For example, the world of a web search tool is open, whereas that of a memory tool is not.
Default: true
OptionalreadOnlyHint?: booleanIf true, the tool does not modify its environment.
Default: false
Optionaltitle?: stringA human-readable title for the tool.
High-level MCP server that provides a simpler API for working with resources, tools, and prompts. For advanced usage (like sending notifications or setting custom request handlers), use the underlying Server instance available via the
serverproperty.