@withpica/mcp-server
Version:
MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog
99 lines • 4.13 kB
JavaScript
// Copyright (c) 2025-2026 Withpica Ltd. All rights reserved.
/**
* ADR-180 Rule 9 (2026-05-02 amendment) — description hygiene.
*
* Two filter lists govern what's allowed in tool descriptions:
*
* PUBLIC_FORBIDDEN_KEYWORDS: broad. Bans data-source names + concept
* vocabulary so the unauthenticated lobby surface (anon `tools/list`,
* directory tools) gives no architectural intel to callers who haven't
* authenticated yet. Used by `public-filter.ts` to sanitise descriptions
* before they cross the lobby boundary.
*
* AUTHENTICATED_FORBIDDEN_KEYWORDS: narrow. Bans only infra / vendor /
* library names whose presence is always wrong regardless of audience —
* they leak hosting + integration choices that aren't load-bearing for
* any agent. Used by the lint at `scripts/lint-mcp-tools.ts` to enforce
* on every tool description, authenticated or not.
*
* Concept vocabulary that legitimately helps the agent (Tier A/B, cascade,
* "→ then:", MCP Apps) stays permitted on the authenticated surface — those
* are user-facing concepts the agent can reason about, not implementation
* leakage. Data-source names (MLC, ISNI, MusicBrainz, etc.) similarly stay
* permitted on the authenticated surface because the agent benefits from
* knowing which sources resolved a query.
*
* The two lists are explicitly disjoint by design — sanitisation for the
* lobby surface uses the union (PUBLIC ∪ AUTHENTICATED) since everything
* banned for authenticated surfaces is also banned for unauthenticated.
*/
/**
* Banned on the unauthenticated lobby surface (also banned on authenticated
* via union — see PUBLIC_FORBIDDEN_KEYWORDS_FULL below).
*
* Notably absent: "Spotify" and "YouTube" are public product surface that
* customers see in tool names like `pica_import_youtube_link` — hiding
* them in lobby descriptions would gut the utility-signal of those tools
* without protecting any algorithm.
*/
export const PUBLIC_FORBIDDEN_KEYWORDS = [
"MLC",
"ISNI",
"MusicBrainz",
"Wikidata",
"Discogs",
"ACRCloud",
"cascade",
"Tier A",
"Tier B",
"ADR-164",
"ADR-179",
"identity graph",
"identity-graph",
"CAR scoring",
];
/**
* Banned on every tool description, authenticated or not. These are infra /
* vendor / library names whose presence in a tool description is always
* implementation leakage — agents derive zero useful signal from knowing
* the email vendor, audio analysis library, or hosting platform.
*
* Stripe and Telegram are intentionally NOT banned — those are user-facing
* product surfaces (Stripe Checkout, Telegram reminders) the agent must
* reference in tool descriptions to drive correct behaviour.
*/
export const AUTHENTICATED_FORBIDDEN_KEYWORDS = [
"Railway",
"Postmark",
// SendGrid + Resend intentionally omitted:
// - SendGrid: not in use. CLAUDE.md still lists it as "legacy" but
// this is stale per a 2026-05-02 confirmation; the codebase
// transactional email path is Postmark-only.
// - "Resend" the email vendor collides with the English verb "resend"
// used in tool names (`pica_collaborators_invite_resend`,
// `pica_send_resend`) and their descriptions ("Resend a pending
// collaboration invite"). Too close to the verb to lint safely;
// PR review catches the rare vendor-name leakage.
"Librosa",
"Groq",
"Whisper",
"Supabase",
"Sentry",
"Vercel",
];
/**
* The full lobby filter is the union of both lists — anything banned on
* authenticated surfaces is also banned on unauthenticated.
*/
export const PUBLIC_FORBIDDEN_KEYWORDS_FULL = [
...PUBLIC_FORBIDDEN_KEYWORDS,
...AUTHENTICATED_FORBIDDEN_KEYWORDS,
];
/**
* Pattern matching any ADR reference (`ADR-123`, `ADR-1`, `ADR-9999` ...).
* The `\b` word boundaries prevent false matches on substrings like
* `LADRADR-`. ADR references are forbidden in every tool description on
* every surface.
*/
export const ADR_REFERENCE_REGEX = /\bADR-\d+\b/;
//# sourceMappingURL=forbidden-keywords.js.map