@withpica/mcp-server-directory 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/lib/changelog.d.ts +16 -0
- package/dist/lib/changelog.d.ts.map +1 -0
- package/dist/lib/changelog.generated.d.ts +4 -0
- package/dist/lib/changelog.generated.d.ts.map +1 -0
- package/dist/lib/changelog.generated.js +6 -0
- package/dist/lib/changelog.generated.js.map +1 -0
- package/dist/lib/changelog.js +84 -0
- package/dist/lib/changelog.js.map +1 -0
- package/dist/prompts/public-question-atlas.d.ts.map +1 -1
- package/dist/prompts/public-question-atlas.js +30 -0
- package/dist/prompts/public-question-atlas.js.map +1 -1
- package/dist/server.d.ts +20 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +129 -10
- package/dist/server.js.map +1 -1
- package/dist/skills/index.d.ts +32 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +50 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/skills.generated.d.ts +18 -0
- package/dist/skills/skills.generated.d.ts.map +1 -0
- package/dist/skills/skills.generated.js +14 -0
- package/dist/skills/skills.generated.js.map +1 -0
- package/dist/tools/__tests__/release-notes.test.d.ts +2 -0
- package/dist/tools/__tests__/release-notes.test.d.ts.map +1 -0
- package/dist/tools/__tests__/release-notes.test.js +49 -0
- package/dist/tools/__tests__/release-notes.test.js.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/release-notes.d.ts +22 -0
- package/dist/tools/release-notes.d.ts.map +1 -0
- package/dist/tools/release-notes.js +102 -0
- package/dist/tools/release-notes.js.map +1 -0
- package/dist/tools/skills.d.ts +19 -0
- package/dist/tools/skills.d.ts.map +1 -0
- package/dist/tools/skills.js +127 -0
- package/dist/tools/skills.js.map +1 -0
- package/package.json +4 -2
- package/scripts/build-changelog.ts +25 -0
- package/scripts/build-skills.ts +192 -0
- package/src/__tests__/skills/skills-registry.test.ts +63 -0
- package/src/__tests__/skills/skills-tools.test.ts +74 -0
- package/src/lib/changelog.ts +119 -0
- package/src/prompts/public-question-atlas.ts +36 -10
- package/src/server.ts +142 -11
- package/src/skills/find-music-for-sync-brief/SKILL.md +89 -0
- package/src/skills/index.ts +63 -0
- package/src/skills/skills.generated.ts +33 -0
- package/src/tools/__tests__/release-notes.test.ts +62 -0
- package/src/tools/index.ts +5 -0
- package/src/tools/release-notes.ts +148 -0
- package/src/tools/skills.ts +146 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
export const SKILLS = {
|
|
3
|
+
"find-music-for-sync-brief": {
|
|
4
|
+
name: "find-music-for-sync-brief",
|
|
5
|
+
description: "Find music in the PICA public directory for a sync brief — translate a mood/vibe/scene description into audio search parameters, run the search, and return a rights-aware shortlist with credit details for licensing.",
|
|
6
|
+
triggers: ["find music for a sync brief", "find me a track for a film scene", "music for this brief", "find an uplifting indie folk track", "I need music that sounds like"],
|
|
7
|
+
audience: "sync supervisor / music library / ad agency / film & TV music team",
|
|
8
|
+
tools_required: ["directory_search_recordings", "directory_lookup_work", "directory_lookup_person"],
|
|
9
|
+
output: "A rights-aware shortlist — each result with title, artist, audio characteristics (BPM, key, energy), credits summary for licensing contact, and any flags (unattested credits, low registration score, missing ISRC).",
|
|
10
|
+
body: "# find-music-for-sync-brief\n\nHelp the user find music in PICA's public directory for a sync brief. Translate their description (mood, vibe, scene, era, vocal style) into search parameters, run the search, and return a shortlist that includes the information they need to license — not just the track.\n\nThis is a public skill — any AI agent connected to the directory MCP can use it. The directory only contains works from organisations that have opted in.\n\n## Step 1 — Translate the brief\n\nMost sync briefs are described in natural language. Translate before searching:\n\n| User says | Search parameters |\n|---|---|\n| upbeat / uplifting / driving | `min_energy: 0.6`, `min_danceability: 0.5` |\n| dark / moody / brooding | `max_energy: 0.4`, `key_mode: minor` |\n| chill / ambient / background | `max_energy: 0.4`, `max_bpm: 100` |\n| epic / cinematic | `min_energy: 0.7`, often longer durations |\n| specific BPM (\"around 120bpm\") | `min_bpm: 115`, `max_bpm: 125` |\n| acoustic / sparse | typically lower `danceability` and `energy` |\n| vocal / instrumental | filter on `has_vocals` if available |\n\nIf the user gives an artist or song reference (\"something like X\"), look up that reference first via `directory_lookup_work` or `directory_search_recordings` by title — then mimic its audio profile in the new search.\n\n## Step 2 — Search\n\nCall `directory_search_recordings` with the parameters from step 1. Default limit is fine for an initial scan.\n\nIf the brief is vague, do two searches with slightly different parameters and compare. If too many results, narrow on BPM or key. If too few, widen the BPM range first, then drop key_mode.\n\n## Step 3 — Lookup full details\n\nFor the top 5-10 promising results, call `directory_lookup_work` to get:\n\n- **Who wrote it** — credits with IPI numbers (essential for the licensing contact path)\n- **Whether credits are attested** — an unattested credit means the ownership claim hasn't been verified; flag this\n- **DSP links** (Spotify, Apple Music) — the user wants to listen before shortlisting\n- **Registration score** — higher score = cleaner rights chain = easier to license\n\nFor high-value matches where the user wants to know more about the creator, call `directory_lookup_person` with the IPI to see the writer's broader catalog and collaborator network.\n\n## Step 4 — Present the shortlist\n\nPresent each shortlisted track with:\n\n- **Title, artist** — what the user listens for\n- **Audio profile** — BPM, key, energy (one line, the supervisor's quick filter)\n- **Credits summary** — writers with IPI, publisher if known (this is the licensing path)\n- **DSP links** — so the user can listen\n- **Flags** — unattested credits, low registration score, missing ISRC, multiple writers (= multi-party clearance needed)\n\nIf a track has all green flags (attested credits, high registration score, ISRC present, single or low-count writers), call it out as \"clean to clear.\"\n\n## Step 5 — If no results\n\nIf the search returns nothing, walk the user back through the brief:\n- Widen the BPM range first (most supervisors don't actually mind ±10 BPM)\n- Drop the key filter (key matching matters less than mood for most placements)\n- Drop the energy bounds and search by genre/mood text only\n- Suggest the user expand to adjacent moods (\"uplifting\" → also try \"warm\" or \"hopeful\")\n\nBe honest if the directory is small for a specific style — PICA's directory grows with org opt-ins; some niches are sparse.\n\n## What not to do\n\n- Don't claim to license tracks — this skill returns a shortlist, not a license. The user contacts the rights holder via the credits summary.\n- Don't speculate about pricing — sync fees are negotiated per-placement\n- Don't return results from outside the directory (no general web search, no Spotify metadata directly) — the directory is the source of truth for this skill\n- Don't return tracks with no attested credits without flagging them as \"rights chain unverified\"\n\n## Follow-on skills\n\n- `due-diligence-on-creator` (Stage 2 candidate) — for deeper research on a specific writer before reaching out\n",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export const SKILL_NAMES = ["find-music-for-sync-brief"];
|
|
14
|
+
//# sourceMappingURL=skills.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.generated.js","sourceRoot":"","sources":["../../src/skills/skills.generated.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAoB7D,MAAM,CAAC,MAAM,MAAM,GAA0B;IAC3C,2BAA2B,EAAE;QAC3B,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,yNAAyN;QACtO,QAAQ,EAAE,CAAC,6BAA6B,EAAC,kCAAkC,EAAC,sBAAsB,EAAC,oCAAoC,EAAC,+BAA+B,CAAC;QACxK,QAAQ,EAAE,oEAAoE;QAC9E,cAAc,EAAE,CAAC,6BAA6B,EAAC,uBAAuB,EAAC,yBAAyB,CAAC;QACjG,MAAM,EAAE,uNAAuN;QAC/N,IAAI,EAAE,ijIAAijI;KACxjI;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAA0B,CAAC,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-notes.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/release-notes.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { DirectoryReleaseNotesTools } from "../release-notes.js";
|
|
3
|
+
describe("DirectoryReleaseNotesTools.directory_release_notes", () => {
|
|
4
|
+
const client = {};
|
|
5
|
+
const tools = new DirectoryReleaseNotesTools(client).getTools();
|
|
6
|
+
const tool = tools.find((t) => t.definition.name === "directory_release_notes");
|
|
7
|
+
it("registers as a single tool named directory_release_notes", () => {
|
|
8
|
+
expect(tools).toHaveLength(1);
|
|
9
|
+
expect(tool).toBeDefined();
|
|
10
|
+
});
|
|
11
|
+
it("returns the last 3 releases by default", async () => {
|
|
12
|
+
const result = await tool.executor({});
|
|
13
|
+
const data = JSON.parse(result.content[0].text);
|
|
14
|
+
expect(data.package).toBe("@withpica/mcp-server-directory");
|
|
15
|
+
expect(data.current_version).toMatch(/^\d+\.\d+\.\d+$/);
|
|
16
|
+
expect(Array.isArray(data.releases)).toBe(true);
|
|
17
|
+
expect(data.releases.length).toBeLessThanOrEqual(3);
|
|
18
|
+
expect(data.releases.length).toBeGreaterThan(0);
|
|
19
|
+
expect(data.resource_uri).toBe("release-notes://withpica/mcp-server-directory/latest");
|
|
20
|
+
});
|
|
21
|
+
it("respects since_version (strictly greater)", async () => {
|
|
22
|
+
const result = await tool.executor({ since_version: "0.0.1" });
|
|
23
|
+
const data = JSON.parse(result.content[0].text);
|
|
24
|
+
expect(data.releases.length).toBeGreaterThan(0);
|
|
25
|
+
for (const r of data.releases) {
|
|
26
|
+
expect(r.version).not.toBe("0.0.1");
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
it("filters to specified sections", async () => {
|
|
30
|
+
const result = await tool.executor({ sections: ["Added"] });
|
|
31
|
+
const data = JSON.parse(result.content[0].text);
|
|
32
|
+
for (const r of data.releases) {
|
|
33
|
+
for (const k of Object.keys(r.sections)) {
|
|
34
|
+
expect(k).toBe("Added");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
it("returns empty releases array when since_version exceeds current_version", async () => {
|
|
39
|
+
const result = await tool.executor({ since_version: "99.0.0" });
|
|
40
|
+
const data = JSON.parse(result.content[0].text);
|
|
41
|
+
expect(data.releases).toEqual([]);
|
|
42
|
+
});
|
|
43
|
+
it("clamps limit to max 20", async () => {
|
|
44
|
+
const result = await tool.executor({ limit: 9999 });
|
|
45
|
+
const data = JSON.parse(result.content[0].text);
|
|
46
|
+
expect(data.releases.length).toBeLessThanOrEqual(20);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=release-notes.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-notes.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/release-notes.test.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGjE,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAClE,MAAM,MAAM,GAAG,EAAqB,CAAC;IACrC,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;IAChE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CACrB,CAAC,CAAmC,EAAE,EAAE,CACtC,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,yBAAyB,CACjD,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,I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Root":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAU/C;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAEvE,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAGX;gBAEU,MAAM,EAAE,eAAe;IAoBnC,SAAS,IAAI,cAAc,EAAE;IAIvB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgBzE"}
|
package/dist/tools/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import { DirectoryPeopleTools } from "./people.js";
|
|
|
4
4
|
import { DirectorySearchTools } from "./search.js";
|
|
5
5
|
import { DirectoryRecordingsTools } from "./recordings.js";
|
|
6
6
|
import { DirectoryChainTools } from "./chain.js";
|
|
7
|
+
import { DirectorySkillsTools } from "./skills.js";
|
|
8
|
+
import { DirectoryReleaseNotesTools } from "./release-notes.js";
|
|
7
9
|
import { formatError, logError, ToolExecutionError } from "../utils/errors.js";
|
|
8
10
|
export class ToolRegistry {
|
|
9
11
|
tools;
|
|
@@ -15,6 +17,8 @@ export class ToolRegistry {
|
|
|
15
17
|
new DirectorySearchTools(client),
|
|
16
18
|
new DirectoryRecordingsTools(client),
|
|
17
19
|
new DirectoryChainTools(client),
|
|
20
|
+
new DirectorySkillsTools(),
|
|
21
|
+
new DirectoryReleaseNotesTools(client),
|
|
18
22
|
];
|
|
19
23
|
for (const group of groups) {
|
|
20
24
|
for (const tool of group.getTools()) {
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,mBAAmB,EAA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AAC;IAClE,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,IAAyB;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,kBAAkB,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,mBAAmB,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;YAC3C,OAAO;gBACL,OAAO,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;gBAC7B,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* directory_release_notes — what shipped in the PICA directory MCP.
|
|
3
|
+
*
|
|
4
|
+
* Reads CHANGELOG.md embedded at build time via scripts/build-changelog.ts.
|
|
5
|
+
* Sister of pica_release_notes (creator MCP) and team_release_notes (team MCP).
|
|
6
|
+
*
|
|
7
|
+
* Public-facing MCP — no trade-secret content in the description (per
|
|
8
|
+
* .claude/rules/ip-protection.md). The CHANGELOG body is the same file
|
|
9
|
+
* shipped in the npm tarball, already vetted as public.
|
|
10
|
+
*/
|
|
11
|
+
import { DirectoryClient } from "../client.js";
|
|
12
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
13
|
+
export declare class DirectoryReleaseNotesTools {
|
|
14
|
+
private client;
|
|
15
|
+
constructor(client: DirectoryClient);
|
|
16
|
+
getTools(): Array<{
|
|
17
|
+
definition: ToolDefinition;
|
|
18
|
+
executor: ToolExecutor;
|
|
19
|
+
}>;
|
|
20
|
+
private releaseNotes;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=release-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-notes.d.ts","sourceRoot":"","sources":["../../src/tools/release-notes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAyBtE,qBAAa,0BAA0B;IACzB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,eAAe;IAE3C,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IA6CzE,OAAO,CAAC,YAAY,CAyDlB;CACH"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { parseChangelogText, CHANGELOG_SECTION_NAMES, } from "../lib/changelog.js";
|
|
3
|
+
import { CHANGELOG_MD, PACKAGE_NAME, PACKAGE_VERSION, } from "../lib/changelog.generated.js";
|
|
4
|
+
const RESOURCE_URI = "release-notes://withpica/mcp-server-directory/latest";
|
|
5
|
+
const DEFAULT_LIMIT = 3;
|
|
6
|
+
const MAX_LIMIT = 20;
|
|
7
|
+
function compareSemver(a, b) {
|
|
8
|
+
const parse = (v) => v.split(".").map((n) => parseInt(n, 10) || 0);
|
|
9
|
+
const [a1, a2, a3] = parse(a);
|
|
10
|
+
const [b1, b2, b3] = parse(b);
|
|
11
|
+
if (a1 !== b1)
|
|
12
|
+
return a1 - b1;
|
|
13
|
+
if (a2 !== b2)
|
|
14
|
+
return a2 - b2;
|
|
15
|
+
return a3 - b3;
|
|
16
|
+
}
|
|
17
|
+
export class DirectoryReleaseNotesTools {
|
|
18
|
+
client;
|
|
19
|
+
constructor(client) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
}
|
|
22
|
+
getTools() {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
definition: {
|
|
26
|
+
name: "directory_release_notes",
|
|
27
|
+
tier: "read",
|
|
28
|
+
description: "Use when the user asks: 'what's new in the directory mcp', " +
|
|
29
|
+
"'what changed in the directory', 'directory release notes', " +
|
|
30
|
+
"'what version is the directory on'. " +
|
|
31
|
+
"Returns recent releases of the PICA directory MCP server — " +
|
|
32
|
+
"what shipped in the public catalogue surface itself. " +
|
|
33
|
+
"NOT for catalogue content searches (use directory_search / " +
|
|
34
|
+
"directory_list_works / directory_chain for those). " +
|
|
35
|
+
"Returns { package, current_version, releases: [{ version, date, sections, markdown }], resource_uri }. " +
|
|
36
|
+
"Defaults to the last 3 releases; use `since_version` to bound the output " +
|
|
37
|
+
"or `sections` to filter to Added/Fixed/etc.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
since_version: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "If set, returns only releases strictly greater than this version " +
|
|
44
|
+
"(semver-compared). Versions equal to since_version are excluded.",
|
|
45
|
+
},
|
|
46
|
+
limit: {
|
|
47
|
+
type: "number",
|
|
48
|
+
description: `Maximum number of releases to return. Default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}.`,
|
|
49
|
+
},
|
|
50
|
+
sections: {
|
|
51
|
+
type: "array",
|
|
52
|
+
items: { type: "string", enum: [...CHANGELOG_SECTION_NAMES] },
|
|
53
|
+
description: "Filter each release's sections to only these names " +
|
|
54
|
+
"(e.g. ['Added', 'Fixed']). Sections not in the list are omitted from output.",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
executor: this.releaseNotes.bind(this),
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
releaseNotes = async (args) => {
|
|
64
|
+
const sinceVersion = typeof args.since_version === "string" ? args.since_version : null;
|
|
65
|
+
const rawLimit = typeof args.limit === "number" ? args.limit : DEFAULT_LIMIT;
|
|
66
|
+
const limit = Math.max(1, Math.min(MAX_LIMIT, Math.floor(rawLimit)));
|
|
67
|
+
const sectionFilter = Array.isArray(args.sections)
|
|
68
|
+
? args.sections.filter((s) => CHANGELOG_SECTION_NAMES.includes(s))
|
|
69
|
+
: null;
|
|
70
|
+
const all = parseChangelogText(CHANGELOG_MD);
|
|
71
|
+
let filtered = all;
|
|
72
|
+
if (sinceVersion) {
|
|
73
|
+
filtered = all.filter((e) => compareSemver(e.version, sinceVersion) > 0);
|
|
74
|
+
}
|
|
75
|
+
filtered = filtered.slice(0, limit);
|
|
76
|
+
const releases = filtered.map((e) => {
|
|
77
|
+
const sections = sectionFilter
|
|
78
|
+
? Object.fromEntries(Object.entries(e.sections).filter(([k]) => sectionFilter.includes(k)))
|
|
79
|
+
: e.sections;
|
|
80
|
+
return {
|
|
81
|
+
version: e.version,
|
|
82
|
+
date: e.date,
|
|
83
|
+
sections,
|
|
84
|
+
markdown: e.markdown,
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: JSON.stringify({
|
|
92
|
+
package: PACKAGE_NAME,
|
|
93
|
+
current_version: PACKAGE_VERSION,
|
|
94
|
+
releases,
|
|
95
|
+
resource_uri: RESOURCE_URI,
|
|
96
|
+
}, null, 2),
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=release-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-notes.js","sourceRoot":"","sources":["../../src/tools/release-notes.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAiB7D,OAAO,EACL,kBAAkB,EAElB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,GAChB,MAAM,+BA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YAAY,EAAE,CAAC;YACjB,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3E,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEpC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAClC,MAAM,QAAQ,GAAG,aAAa;gBAC5B,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CACxC,aAAa,CAAC,QAAQ,CAAC,CAAyB,CAAC,CAClD,CACF;gBACH,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,QAAQ;gBACR,QAAQ,EAAE,CAAC,CAAC,QAAQ;aACrB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;wBACE,OAAO,EAAE,YAAY;wBACrB,eAAe,EAAE,eAAe;wBAChC,QAAQ;wBACR,YAAY,EAAE,YAAY;qBAC3B,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CAAC;CACH"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory MCP skill tools — ADR-140 Phase 2b
|
|
3
|
+
*
|
|
4
|
+
* Sister of mcp-server/src/tools/skills.ts. Two meta-tools — list and get —
|
|
5
|
+
* named `directory_skill_*` to match the directory MCP's `directory_*` prefix
|
|
6
|
+
* convention. Same lazy-loading shape as the creator MCP variant.
|
|
7
|
+
*/
|
|
8
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
9
|
+
export declare class DirectorySkillsTools {
|
|
10
|
+
private registry;
|
|
11
|
+
constructor();
|
|
12
|
+
getTools(): Array<{
|
|
13
|
+
definition: ToolDefinition;
|
|
14
|
+
executor: ToolExecutor;
|
|
15
|
+
}>;
|
|
16
|
+
private listSkills;
|
|
17
|
+
private getSkill;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/tools/skills.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAiB;;IAMjC,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YA4C3D,UAAU;YAsBV,QAAQ;CA2DvB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { SkillsRegistry, SkillNotFoundError } from "../skills/index.js";
|
|
3
|
+
export class DirectorySkillsTools {
|
|
4
|
+
registry;
|
|
5
|
+
constructor() {
|
|
6
|
+
this.registry = new SkillsRegistry();
|
|
7
|
+
}
|
|
8
|
+
getTools() {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
definition: {
|
|
12
|
+
name: "directory_skill_list",
|
|
13
|
+
tier: "read",
|
|
14
|
+
description: "Use when the user asks: 'what skills do you have?', 'what can you do?', 'show me your methodologies', 'how do I find music here?'. " +
|
|
15
|
+
"Returns the list of downloadable directory skill methodologies — name, description, trigger phrases. " +
|
|
16
|
+
"Cheap to call. Use directory_skill_get(name) to load a specific skill's full methodology body.",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {},
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
executor: this.listSkills.bind(this),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
definition: {
|
|
27
|
+
name: "directory_skill_get",
|
|
28
|
+
tier: "read",
|
|
29
|
+
description: "Use when the user asks: 'what skills do you have?', 'what can you do?', 'show me your methodologies'. " +
|
|
30
|
+
"Returns the full methodology body for one directory skill — markdown with step-by-step instructions and tool chains. " +
|
|
31
|
+
"Call directory_skill_list first to see available skill names, then directory_skill_get to load one. Read once at the start of the workflow; do not re-fetch on every step.",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
name: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Kebab-case skill name from directory_skill_list (e.g. 'find-music-for-sync-brief').",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ["name"],
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
executor: this.getSkill.bind(this),
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
async listSkills(_args) {
|
|
49
|
+
const skills = this.registry.listSkills();
|
|
50
|
+
return {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: skills.length
|
|
55
|
+
? `Available directory skills (${skills.length}):\n\n` +
|
|
56
|
+
skills
|
|
57
|
+
.map((s) => `- ${s.name} — ${s.description}\n triggers: ${s.triggers.join(", ")}\n audience: ${s.audience}`)
|
|
58
|
+
.join("\n\n") +
|
|
59
|
+
"\n\nCall directory_skill_get(name) to load a skill's full methodology."
|
|
60
|
+
: "No directory skills available.",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
structuredContent: { skills },
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
async getSkill(args) {
|
|
67
|
+
const name = String(args?.name ?? "").trim();
|
|
68
|
+
if (!name) {
|
|
69
|
+
return {
|
|
70
|
+
isError: true,
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: "text",
|
|
74
|
+
text: "Missing required argument: name. Call directory_skill_list to see available skill names.",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
let skill;
|
|
80
|
+
try {
|
|
81
|
+
skill = this.registry.getSkill(name);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
if (err instanceof SkillNotFoundError) {
|
|
85
|
+
return {
|
|
86
|
+
isError: true,
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: "text",
|
|
90
|
+
text: `Skill not found: ${name}. Call directory_skill_list to see available skill names.`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
throw err;
|
|
96
|
+
}
|
|
97
|
+
const frontmatterSummary = [
|
|
98
|
+
`# ${skill.name}`,
|
|
99
|
+
"",
|
|
100
|
+
`**Description:** ${skill.description}`,
|
|
101
|
+
`**Audience:** ${skill.audience}`,
|
|
102
|
+
`**Triggers:** ${skill.triggers.join(", ")}`,
|
|
103
|
+
`**Tools used:** ${skill.tools_required.join(", ")}`,
|
|
104
|
+
`**Output:** ${skill.output}`,
|
|
105
|
+
"",
|
|
106
|
+
"---",
|
|
107
|
+
"",
|
|
108
|
+
].join("\n");
|
|
109
|
+
return {
|
|
110
|
+
content: [
|
|
111
|
+
{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: frontmatterSummary + skill.body,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
structuredContent: {
|
|
117
|
+
name: skill.name,
|
|
118
|
+
description: skill.description,
|
|
119
|
+
triggers: skill.triggers,
|
|
120
|
+
audience: skill.audience,
|
|
121
|
+
tools_required: skill.tools_required,
|
|
122
|
+
output: skill.output,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/tools/skills.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAW7D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExE,MAAM,OAAO,oBAAoB;IACvB,QAAQ,CAAiB;IAEjC;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;IACvC,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,sBAAsB;oBAC5B,IAAI,EAAE,MAAM;oBACZ,WAAW,EACT,qIAAqI;wBACrI,uGAAuG;wBACvG,gGAAgG;oBAClG,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,EAAE;wBACd,oBAAoB,EAAE,KAAK;qBAC5B;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACrC;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,qBAAqB;oBAC3B,IAAI,EAAE,MAAM;oBACZ,WAAW,EACT,wGAAwG;wBACxG,uHAAuH;wBACvH,4KAA4K;oBAC9K,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,qFAAqF;6BACxF;yBACF;wBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;wBAClB,oBAAoB,EAAE,KAAK;qBAC5B;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAA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EAAE,MAAM;4BACZ,IAAI,EAAE,oBAAoB,IAAI,2DAA2D;yBAC1F;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,kBAAkB,GAAG;YACzB,KAAK,KAAK,CAAC,IAAI,EAAE;YACjB,EAAE;YACF,oBAAoB,KAAK,CAAC,WAAW,EAAE;YACvC,iBAAiB,KAAK,CAAC,QAAQ,EAAE;YACjC,iBAAiB,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC5C,mBAAmB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpD,eAAe,KAAK,CAAC,MAAM,EAAE;YAC7B,EAAE;YACF,KAAK;YACL,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,kBAAkB,GAAG,KAAK,CAAC,IAAI;iBACtC;aACF;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withpica/mcp-server-directory",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MCP Server for PICA Public Directory — enables AI assistants to search verified works and creators",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
"pica-directory-mcp": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
+
"prebuild": "tsx scripts/build-changelog.ts && tsx scripts/build-skills.ts",
|
|
11
12
|
"build": "tsc",
|
|
12
13
|
"dev": "tsx src/index.ts",
|
|
13
14
|
"start": "node dist/index.js",
|
|
14
15
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
15
16
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
|
|
16
17
|
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
17
|
-
"
|
|
18
|
+
"lint:changelog": "tsx ../scripts/lint-changelog.ts --package=.",
|
|
19
|
+
"prepublishOnly": "npm run build && npm run lint:changelog"
|
|
18
20
|
},
|
|
19
21
|
"author": "PICA Platform",
|
|
20
22
|
"license": "MIT",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
4
|
+
import { resolve, dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const root = resolve(__dirname, "..");
|
|
9
|
+
const changelogPath = resolve(root, "CHANGELOG.md");
|
|
10
|
+
const outPath = resolve(root, "src/lib/changelog.generated.ts");
|
|
11
|
+
const pkg = JSON.parse(readFileSync(resolve(root, "package.json"), "utf8"));
|
|
12
|
+
|
|
13
|
+
const md = readFileSync(changelogPath, "utf8");
|
|
14
|
+
const escaped = JSON.stringify(md);
|
|
15
|
+
|
|
16
|
+
writeFileSync(
|
|
17
|
+
outPath,
|
|
18
|
+
`// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.\n` +
|
|
19
|
+
`// Generated by scripts/build-changelog.ts — do not edit.\n\n` +
|
|
20
|
+
`export const CHANGELOG_MD = ${escaped};\n` +
|
|
21
|
+
`export const PACKAGE_NAME = ${JSON.stringify(pkg.name)};\n` +
|
|
22
|
+
`export const PACKAGE_VERSION = ${JSON.stringify(pkg.version)};\n`,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
console.log(`Wrote ${outPath} (${md.length} chars).`);
|