UNPKG

@withpica/mcp-server

Version:

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

96 lines • 3.06 kB
/** * Resource Registry for MCP Server * Manages read-only data resources that AI assistants can access */ import { PicaClient } from "@withpica/mcp-sdk"; import { type SkillEntry } from "../skills/index.js"; import { ServerConfig } from "../config.js"; export interface ResourceDefinition { uri: string; name: string; description: string; mimeType: string; } export interface ResourceContent { contents: Array<{ uri: string; mimeType: string; text: string; }>; } export type ResourceResult = any; export declare class ResourceRegistry { private pica; private config?; private skills; constructor(pica: PicaClient | null, config?: ServerConfig); /** * List all available resources */ listResources(): ResourceDefinition[]; /** * Read a resource by URI */ readResource(uri: string): Promise<any>; /** * Resolve a skill:// URI to its content. Two URI shapes are accepted: * - skill://withpica/index.json → enumeration JSON * - skill://withpica/<name>/SKILL.md → per-skill markdown (frontmatter + body) * * ADR-140 Phase 2b; ADR-328. SKILL.md text is renderSkillMd's output — the * bytes the skills/list digest covers. index.json is the pre-Final * enumeration, kept for hosts that do not speak the skills extension. */ private readSkillResource; /** * ADR-328 — SEP-2640 `skills/list`. Empty without a PICA client or in lobby * mode; readResource refuses skill:// reads without a client (its "not * available in lobby mode" throw checks !this.pica). */ listSkillEntries(): SkillEntry[]; /** * ADR-328 — SEP-2640 `skills/get`. Throws SkillEntryNotFoundError for an * unknown URI, and in lobby mode, where no skill is served. */ getSkillEntry(uri: string): SkillEntry; /** * Get OpenAPI specification resource */ private getOpenAPISpec; /** * Get works list resource. * * ⚠️ A resource takes no arguments, so it cannot page: it returns the FIRST * page and says so. `total` is the real catalogue count from * `/admin/catalog/stats` (SQL counts), never the length of the page. Until * 2026-10-06 this asked for `limit: 1000`, the route clamped that to 100, * and `total` reported the page length — an org with 2,239 works was told * it had 100. */ private getWorksList; /** * Get people list resource */ private getPeopleList; /** * Get recordings list resource */ private getRecordingsList; /** * Get catalog statistics resource */ private getCatalogStats; /** * Get catalog health (PICA Score) resource */ private getCatalogHealth; /** * Get workspace context resource — aggregated orientation for agents */ private getWorkspaceContext; /** * Get recent events resource — webhook deliveries */ private getRecentEvents; } //# sourceMappingURL=index.d.ts.map