@extenshi/mcp
Version:
Extenshi MCP server — bring the extension catalog (search, security, market research) and pre-publish scanning into your AI tools
94 lines • 4.03 kB
TypeScript
/**
* The Extenshi agent skills, served over MCP.
*
* The skills are the ones the Claude plugin installs (plugins/extenshi/skills in
* the monorepo), compiled into this package by scripts/generate-mcp-skills.mjs.
* A client with no plugin reaches them here in two ways:
*
* - the Skills extension of MCP (`io.modelcontextprotocol/skills`, SEP-2640):
* every file is a `skill://<name>/<file>` resource, `skills/list` returns the
* catalog with a SHA-256 digest and size per file, `skills/get` one entry;
* - the `get_skill` tool (tools.ts), for clients that do not implement the
* extension, which on 2026-11-18 is most of them.
*
* fastmcp has no API for either extension capabilities or custom methods, and it
* builds a session itself, answering `initialize` before its `connect` event
* fires. So `attachSkillsExtension` wraps the session class's `connect`: the
* capability and the two handlers are registered on the SDK server of each
* session before its transport is attached, which is the last moment the SDK
* accepts a capability.
*
* Spec: https://modelcontextprotocol.io/seps/2640-skills-extension
*/
export declare const SKILLS_EXTENSION = "io.modelcontextprotocol/skills";
export interface SkillResource {
uri: string;
/** `sha256:` and 64 lowercase hex characters, over the UTF-8 bytes of the file. */
digest: string;
/** Length of the file in bytes. */
size: number;
}
/** One entry of `skills/list`, and the `skill` of `skills/get`. */
export interface SkillEntry {
/** The resource URI of the skill's SKILL.md. */
uri: string;
frontmatter: Record<string, unknown>;
/** Every file of the skill, SKILL.md included. */
resources: SkillResource[];
}
/** A skill file as an MCP resource. */
export interface SkillFile {
uri: string;
/** The skill name for SKILL.md, `<skill>/<path>` for a supporting file. */
name: string;
description?: string;
mimeType: string;
text: string;
}
export declare const skillUri: (name: string) => string;
/** Every file of every skill, in catalog order. */
export declare const SKILL_FILES: readonly SkillFile[];
/** The catalog `skills/list` returns: complete, since the set is fixed at build time. */
export declare const SKILL_ENTRIES: readonly SkillEntry[];
export declare const SKILL_NAMES: readonly string[];
/** The name and one-line purpose of every skill, for the get_skill listing. */
export declare function skillSummaries(): {
name: string;
description: string;
uri: string;
}[];
/** The SKILL.md of a skill, byte for byte as `skill://<name>/SKILL.md` serves it. */
export declare function skillText(name: string): string | undefined;
export declare function listSkills(): {
resultType: 'complete';
skills: readonly SkillEntry[];
};
export declare function getSkill(uri: unknown): {
resultType: 'complete';
skill: SkillEntry;
};
/** The part of a FastMCP server this module uses; both physical copies of fastmcp fit it. */
interface ResourceServer {
addResource(resource: {
uri: string;
name: string;
description?: string;
mimeType: string;
load: () => Promise<{
text: string;
mimeType: string;
}>;
}): void;
}
/** The session class of the fastmcp copy the server was built from (`FastMCPSession`). */
export interface SessionClass {
prototype: object;
}
/** Registers every skill file as a `skill://` resource. Call before `server.start()`. */
export declare function addSkillResources(server: ResourceServer): void;
/** Makes every session of `sessionClass` declare the Skills extension and answer `skills/list` and `skills/get`. */
export declare function attachSkillsExtension(sessionClass: SessionClass): void;
/** Both halves at once: the `skill://` resources and the extension. Call before `server.start()`. */
export declare function registerSkills(server: ResourceServer, sessionClass: SessionClass): void;
export {};
//# sourceMappingURL=skills.d.ts.map