MCP TypeScript SDK (V2) / @modelcontextprotocol/server / ext/skills/extension
ext/skills/extension
Classes
SkillCatalog
Defined in: packages/server/src/ext/skills/extension.ts:268
A catalog the SDK built from storage. It holds metadata only: every file read goes through the adapter and is checked against the published entry.
Extends
Properties
id
readonlyid:"io.modelcontextprotocol/skills"=SKILLS_EXTENSION_ID
Defined in: packages/server/src/ext/skills/extension.ts:78
Inherited from
Accessors
entries
Get Signature
get entries(): readonly
object[]
Defined in: packages/server/src/ext/skills/extension.ts:308
The skills this catalog serves, sorted by URI. Frozen (deeply): they are exactly what clients receive.
Returns
readonly object[]
Methods
attach()
attach(
mcp):void
Defined in: packages/server/src/ext/skills/extension.ts:119
Serves these skills on mcp: registers the skill resource template and the skills methods, then declares the capability. Must run before connecting. Calling it again for the same server does nothing. One skills extension per server: attaching another one throws and leaves the server as it was, as does attaching to a server that already handles one of the skills methods.
Parameters
mcp
Returns
void
Inherited from
reload()
reload():
Promise<SkillCatalogChanges>
Defined in: packages/server/src/ext/skills/extension.ts:326
Scans the storage again and swaps the new catalog in at once. All or nothing: on failure the old catalog keeps serving. Overlapping calls run one after another.
When skills are added or removed, or a SKILL.md's name or description changes, the result has listChanged: true and resources/list_changed goes out through every attached server that is still connected (stdio, stateful 2025-11-25 HTTP sessions). Servers that createMcpHandler builds per request are closed by then, so publish the change on the handler: if (changes.listChanged) handler.notify.resourcesChanged(). Where the runtime has no WeakRef (Cloudflare Workers with a compatibility date before 2025-05-05), attached servers are not tracked and nothing is sent.
Returns
Promise<SkillCatalogChanges>
load()
staticload(files,options?):Promise<SkillCatalog>
Defined in: packages/server/src/ext/skills/extension.ts:284
Builds a catalog from storage through a SkillFiles adapter (memorySkillFiles, nodeSkillFiles, or your own).
Parameters
files
options?
SkillCatalogOptions = {}
Returns
Promise<SkillCatalog>
Overrides
SkillsExtension
Defined in: packages/server/src/ext/skills/extension.ts:77
The MCP Skills extension (SEP-2640) for one catalog of skills. One instance serves any number of servers: call SkillsExtension.attach on each (before connecting). Build it from a SkillSource, or with SkillsExtension.load(files) from storage.
Extended by
Constructors
Constructor
new SkillsExtension(
options):SkillsExtension
Defined in: packages/server/src/ext/skills/extension.ts:96
Parameters
options
Returns
Properties
id
readonlyid:"io.modelcontextprotocol/skills"=SKILLS_EXTENSION_ID
Defined in: packages/server/src/ext/skills/extension.ts:78
Methods
attach()
attach(
mcp):void
Defined in: packages/server/src/ext/skills/extension.ts:119
Serves these skills on mcp: registers the skill resource template and the skills methods, then declares the capability. Must run before connecting. Calling it again for the same server does nothing. One skills extension per server: attaching another one throws and leaves the server as it was, as does attaching to a server that already handles one of the skills methods.
Parameters
mcp
Returns
void
load()
staticload(files,options?):Promise<SkillCatalog>
Defined in: packages/server/src/ext/skills/extension.ts:92
Builds a catalog from storage through a SkillFiles adapter (memorySkillFiles, nodeSkillFiles, or your own).
Parameters
files
options?
Returns
Promise<SkillCatalog>