KDIGI CMS is an AI-native CMS: a Model Context Protocol server is built in at POST /api/mcp, so AI agents (Claude Code, Codex, Cursor, VS Code, OMP, …) read, write, schedule, publish and SEO-check content directly in the CMS. The agent works as the user who owns the API key: same role, same assigned sites, exactly as when that person signs in to the admin.
The MCP server and the
kcmsCLI ship in KDIGI CMS 1.2.0. The public demo account cannot create an API key, so try it on a self-hosted install.
What an agent can do
Section titled “What an agent can do”| Group | Tools |
|---|---|
| Identity, sites | whoami, list_sites, get_site |
| Find and read | search_content, get_content (Markdown body, SEO, updatedAt) |
| Write | create_post, create_page (draft by default), update_post, update_page |
| Publish | set_status: publish, unpublish, schedule with a future publishedAt |
| Undo | trash_content, restore_from_trash, list_versions, restore_version |
| Categories, tags | list_taxonomies, create_taxonomy |
| Media | search_media, import_media_from_url, update_media_alt |
| SEO | seo_audit, get_seo_report (the same scorer as the admin) |
| Other | list_shortcodes, get_content_urls |
Plus the resource kcms://guide/content (Markdown, shortcode and SEO rules) and two prompts, write-post and refresh-seo.
1. Create an API key for the agent
Section titled “1. Create an API key for the agent”Give each agent or person its own account with the lowest role that does the job: an author only creates drafts, an editor can publish and schedule. Avoid super-admin keys.
- A super admin opens Users, creates the account (e.g.
ai-writer@example.com) and picks the role and sites. - Open that account, tick Enable API Key, copy the key and Save.
- Put the key in an environment variable where the agent runs:
export KCMS_API_KEY=change-me.
API-key sessions are restricted on every REST, GraphQL and MCP route: they cannot change the account's email, password, API key, role or sites, cannot create users and cannot delete permanently (only move to the trash). If a key leaks, untick Enable API Key.
2. Connect your AI tool
Section titled “2. Connect your AI tool”The quickest path is the kcms CLI: it writes the right config file for each tool and never copies the key into it.
npm install -g @kdigi/kcms-cliexport KCMS_API_KEY=change-mekcms setup claude-code --url https://cms.example.com --write --with-skillReplace claude-code with codex, cursor, vscode, omp or json. Drop --write to only print the config. --with-skill also installs the agent skill that teaches a safe editorial workflow: read before editing, draft first, publish only when asked.
To configure it yourself, for example Claude Code's .mcp.json:
{ "mcpServers": { "kdigi": { "type": "http", "url": "https://cms.example.com/api/mcp", "headers": { "Authorization": "Bearer ${KCMS_API_KEY}" } } }}Configs for Codex, Cursor, VS Code, OMP and the stdio bridge (kcms mcp) for stdio-only tools are in the AI integration reference.
3. How the agent stays safe
Section titled “3. How the agent stays safe”- Drafts first. New documents are drafts; drafts have no public URL, so the agent returns an admin link for you to review.
- No overwriting someone's fresh edit. Every update carries
expectedUpdatedAtfrom the last read; if someone saved in between, the call fails withconflictand changes nothing. - Admin edit locks are respected. If an editor has the document open, the agent gets
lockedand never steals the lock. - Right role, right site. An author cannot publish; sites the key is not a member of are invisible.
- Undoable. Trash and version history work as in the admin.
- Logged. Each tool call writes one
agent-oplog line (tool, user, site, document, outcome), never bodies or keys.
4. Use the CLI without an agent
Section titled “4. Use the CLI without an agent”kcms is also a command-line tool: fetch a post as a Markdown file with frontmatter, edit it in your usual editor and push it back.
kcms login --url https://cms.example.comkcms posts get my-post -o my-post.mdkcms posts update my-post.mdkcms media upload ./cover.webp --alt "Cover"kcms seo auditOperating it
Section titled “Operating it”- The MCP server is on by default; set
MCP_ENABLED=falseto turn it off (the route answers 404). See configuration. - Give
/api/mcpat least a 30-second proxy timeout and a rate limit at the reverse proxy (the CMS has none). - Use HTTPS only: the key travels in a header.
- ChatGPT and Claude.ai on the web require OAuth, which is not supported yet; use the desktop/CLI tools above or the stdio bridge.
Full tool list, error handling and connection tests: AI integration reference. What each role may do: Roles and permissions.