UNPKG

@withpica/mcp-server

Version:

MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog

71 lines • 3.02 kB
import { z } from "zod"; import type { Skill } from "./skills.generated.js"; import type { SkillsRegistry, SkillOrigin } from "./index.js"; export declare const SKILLS_EXTENSION_ID = "io.modelcontextprotocol/skills"; /** Spread into `capabilities.extensions`. No `directoryRead`: every skill is one file. */ export declare const SKILLS_EXTENSION_CAPABILITY: { "io.modelcontextprotocol/skills": {}; }; export interface SkillFrontmatter { name: string; description: string; compatibility: string; metadata: Record<string, string>; } export interface SkillResourceRef { uri: string; digest: string; size: number; } export interface SkillEntry { uri: string; frontmatter: SkillFrontmatter; resources: SkillResourceRef[]; } export declare class SkillEntryNotFoundError extends Error { readonly uri: string; constructor(uri: string); } export declare function skillUri(name: string): string; /** Skill name from a `skill://withpica/<name>/SKILL.md` URI, or null. */ export declare function skillNameFromUri(uri: string): string | null; export declare function skillFrontmatter(skill: Skill, origin: SkillOrigin): SkillFrontmatter; /** The exact text served by `resources/read` for this skill's SKILL.md. */ export declare function renderSkillMd(skill: Skill, origin: SkillOrigin): string; /** * Entries for `skills/list`. A skill whose name or description breaks the * Agent Skills rules (custom-skill names allow `--` and a trailing hyphen — * lib/services/custom-skills.ts NAME_RE) is left out of the * listing — SEP-2640 permits a partial listing — but stays gettable by URI. */ export declare function listSkillEntries(registry: SkillsRegistry): SkillEntry[]; /** Entry for `skills/get`. Throws SkillEntryNotFoundError (→ -32602). */ export declare function getSkillEntry(registry: SkillsRegistry, uri: string): SkillEntry; export declare const SkillsListRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"skills/list">; params: z.ZodOptional<z.ZodObject<{ cursor: z.ZodOptional<z.ZodString>; }, z.core.$loose>>; }, z.core.$strip>; export declare const SkillsGetRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"skills/get">; params: z.ZodOptional<z.ZodObject<{ uri: z.ZodUnknown; }, z.core.$loose>>; }, z.core.$strip>; /** `skills/list` result. One page: PICA's catalog is small and fixed per caller. */ export declare function skillsListResult(entries: SkillEntry[]): { resultType: "complete"; skills: SkillEntry[]; }; /** * `skills/get` result. A missing, unknown or malformed URI is -32602 (Invalid * params), the code SEP-2640 requires; pinned by sep2640-protocol.test.ts. * (PICA's resources/read still answers -32603 for an unknown URI: ResourceError * carries a string code, which the SDK maps to InternalError.) */ export declare function skillsGetResult(uri: unknown, get: (uri: string) => SkillEntry): { resultType: "complete"; skill: SkillEntry; }; //# sourceMappingURL=sep2640.d.ts.map