This skill guides AI agents to connect to BCMS, manage templates, entries, and media while following security and localization best practices.
npx playbooks add skill bcms/ai --skill bcms
Canonical copy: edit this file at ai/skills/bcms/SKILL.md. Claude Code and Cursor plugins package it via symlinks under ai/providers/*/plugin/skills/bcms/ (see ai/AGENTS.md). On Windows without symlinks, use npm run package and publish from dist/packages/.
This skill is a router: keep it loaded for goals and constraints; open files under references/ only when that topic is needed. Prefer official docs for volatile API surface: [thebcms.com/docs](https://thebcms.com/docs) · [MCP](https://thebcms.com/docs/mcp) · [agents setup](https://thebcms.com/agents).
This skill (bcms) is guidance. The companion bcms-content skill is an executable CLI. They are not interchangeable.
| You want to… | Use |
|---|---|
| Model content, integrate a framework, write app code | This skill + @thebcms/client SDK |
| Operate content/schema interactively with BCMS tools configured | MCP — references/mcp.md |
| Scripted, deterministic entry/media ops in terminal, CI, or agent loops | bcms-content CLI (npx skills add bcms/ai --skill bcms-content) |
| Fetch or mutate content from application code, builds, or servers | SDK (@thebcms/client) |
| Topic | Load |
|---|---|
| Client init, env keys, API basics | references/bcms-api-basics.md |
| Templates | references/templates.md |
| Entries (CRUD, locales) | references/entries.md |
| Groups | references/groups.md |
| Widgets | references/widgets.md |
| Media | references/media.md |
| Property / field types | references/properties.md |
| Functions & webhooks | references/functions-webhooks.md |
| Permissions (API key scopes vs MCP keys) | references/permissions.md |
| Framework pick → per-framework guide | references/frameworks.md |
| MCP tools, session, pointer links, rich-text nodes | references/mcp.md |
bcms/types/ts after bcms --pull types; some projects import @thebcms/types or an alias — match the repo.@thebcms/cli) before hand-rolling; then references/frameworks.md.BCMSContentManager, BCMSImage / framework equivalents) instead of custom rich-text parsers unless there is a clear need.BCMS_API_KEY, plus public key vars where framework docs require); separate keys per env; least privilege for API keys (especially media delivery). MCP uses a separate MCP key — per-project, not scoped (see below).meta / content per locale when multi-lingual.references/bcms-api-basics.md, references/permissions.md).whereIsItUsed / usage first).meta/content when a property, group, or widget fits.BCMSContentManager is available.references/functions-webhooks.md).Official: [thebcms.com/docs/mcp](https://thebcms.com/docs/mcp). Agent gotchas and payload shapes: references/mcp.md (discover live tool names/schemas from the MCP client — not a hand-maintained tool catalog).
Agent-only gotchas (easy to get wrong):
mcpKey — not an API key, and not least-privilege scoped.https://app.thebcms.com/api/v3/mcp?mcpKey=<keyId.secret.instanceId> (param is mcpKey; custom app host if needed).initialize, clients must send mcp-session-id on follow-ups.paragraph, heading, lists, text, widget, media, … — no image node). Internal links: get-entry-pointer-link / get-media-pointer-link.dashboardUrl, show it to the user. Pattern (if missing): https://app.thebcms.com/d/i/{instanceId}/bcms/template/{templateId}/entry/{entryId} — see references/mcp.md. Not the same as pointer links.Env-held three-part key; options-only Client (matches current integration docs):
import { Client } from '@thebcms/client';
export const bcmsPrivate = new Client({ injectSvg: true }); // reads BCMS_API_KEY
export const bcmsPublic = new Client({
apiKey: process.env.NEXT_PUBLIC_BCMS_API_KEY,
injectSvg: true,
});
Scripts/servers: see [ai/scripts/init-client.ts](https://github.com/bcms/ai/blob/main/scripts/init-client.ts) and references/bcms-api-basics.md.
Stop when the goal matches one of these — verify before claiming success:
| Goal | Verify |
|---|---|
| Framework / SDK integrate | Client constructs; types resolve (or documented import path); one successful entry or template read |
| Content model change | Template/group/widget matches intent; required props present; no silent destructive delete |
| MCP content write | Read-back shows expected meta/content (or statuses); when available, surface dashboardUrl (or the known dashboard path) so the user can open the entry |
| MCP / schema delete | Usage checked first; target gone on read-back; dependents accounted for |
| Permissions / keys | API keys: env only, scopes match the SDK/CLI operation. MCP keys: user MCP config only, never scoped — expect full project access; never in git or client bundles |
On errors: for MCP check URL/host, MCP key, and session header (not template scopes). For SDK/CLI check API key scopes.
After a confusing failure, missing gotcha, or outdated instruction, propose a concrete edit to this file or the relevant references/*.md (and a catalog/changelog bump if releasing) instead of only patching the one-off task.
Repo automation notes: ai/AGENTS.md. Pack history: ai/CHANGELOG.md.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.