Skip to content

MCP Server

The Alokai CMS MCP server exposes every CMS operation as an AI-callable tool. This lets AI assistants like Claude Code, Claude Desktop, Cursor, and others create pages, manage content models, publish entries, upload assets, and more — all through natural language.

Installation

The MCP server is part of the @alokai/cms-mcp package. Build it from the monorepo:

Terminal window
yarn build:mcp

This produces two entry points:

FileRuntimeUse case
bin/index.mjsNode.jsLocal use with Claude Code, Cursor, etc. (stdio + SSE)
bin/worker.mjsCloudflare WorkersRemote deployment (HTTP)

Local setup (stdio)

Add the MCP server to your AI tool’s configuration. For Claude Code, add to your project’s .claude/settings.json or global settings:

{
"mcpServers": {
"alokai-cms": {
"command": "node",
"args": ["/path/to/packages/cms-mcp/bin/index.mjs"],
"env": {
"ALOKAI_CMS_API_KEY": "alokai-cms_sk_xxx",
"ALOKAI_CMS_ORG_ID": "your-org-id",
"ALOKAI_CMS_SPACE_ID": "your-space-id",
"ALOKAI_CMS_ENVIRONMENT_ID": "your-environment-id",
"ALOKAI_CMS_BASE_URL": "https://cms.alokai.com"
}
}
}
}

For Cursor, add the same config to .cursor/mcp.json.

Environment variables

VariableRequiredDescription
ALOKAI_CMS_API_KEYYesAPI key (find in Settings > API Keys)
ALOKAI_CMS_ORG_IDYesOrganization ID
ALOKAI_CMS_SPACE_IDYesSpace ID
ALOKAI_CMS_ENVIRONMENT_IDYesEnvironment ID
ALOKAI_CMS_BASE_URLNoAPI base URL (default: https://cms.alokai.com)

Local setup (SSE)

For browser-based or remote MCP clients, start the server in SSE mode:

Terminal window
ALOKAI_CMS_API_KEY=... \
ALOKAI_CMS_ORG_ID=... \
ALOKAI_CMS_SPACE_ID=... \
ALOKAI_CMS_ENVIRONMENT_ID=... \
node packages/cms-mcp/bin/index.mjs --transport sse --port 3100

The server exposes:

  • GET /sse — SSE connection endpoint
  • POST /messages?sessionId=... — message endpoint

Remote server (Cloudflare Workers)

A hosted instance is deployed at https://alokai-cms-mcp.alokai-inc.workers.dev. Credentials are passed per-request via headers from your MCP client config — nothing is stored on the server.

For Claude Code (remote MCP server):

{
"mcpServers": {
"alokai-cms": {
"type": "url",
"url": "https://alokai-cms-mcp.alokai-inc.workers.dev/mcp",
"headers": {
"X-Alokai-CMS-Api-Key": "alokai-cms_sk_xxx",
"X-Alokai-CMS-Org-Id": "your-org-id",
"X-Alokai-CMS-Space-Id": "your-space-id",
"X-Alokai-CMS-Environment-Id": "your-environment-id"
}
}
}
}

Request headers

HeaderRequiredDescription
X-Alokai-CMS-Api-KeyYesAPI key
X-Alokai-CMS-Org-IdYesOrganization ID
X-Alokai-CMS-Space-IdYesSpace ID
X-Alokai-CMS-Environment-IdYesEnvironment ID
X-Alokai-CMS-Base-UrlNoOverride API base URL

Self-hosting

To deploy your own instance:

Terminal window
cd packages/cms-mcp
yarn build:mcp
wrangler deploy

Endpoints

MethodPathDescription
GET/Health check
POST/mcpMCP Streamable HTTP endpoint

Available tools

The MCP server exposes 70 tools covering every CMS API endpoint:

Entries (pages & layouts)

list_entries, get_entry, create_entry, update_entry, update_entry_metadata, publish_entry, unpublish_entry, schedule_entry, archive_entry, delete_entry, duplicate_entry, list_entry_versions, get_entry_version, restore_entry_version, list_layouts, list_entry_scheduled_actions

Content Models

list_content_models, get_content_model, create_content_model, update_content_model, duplicate_content_model, delete_content_model

Components

list_components, get_component, create_component, update_component, delete_component, publish_component, unpublish_component, publish_components_batch, list_component_versions, get_component_version, restore_component_version

Assets

list_assets, get_asset, upload_asset, update_asset, delete_asset

Spaces

list_spaces, get_space, create_space, update_space, delete_space, list_space_members, add_space_member, update_space_member, remove_space_member

Environments

list_environments, get_environment, create_environment, clone_environment, delete_environment

Locales

list_locales, create_locale, update_locale, delete_locale, get_locale_detection_settings, update_locale_detection_settings

Webhooks

list_webhooks, create_webhook, update_webhook, delete_webhook, test_webhook

Preview URLs

list_preview_urls, create_preview_url, update_preview_url, delete_preview_url

Delivery

get_page_by_path, get_page_by_id, get_layout

Example usage

Once configured, you can ask your AI assistant things like:

  • “List all pages in the CMS”
  • “Create a new page at /about with a Hero and a TextBlock component”
  • “Publish the homepage”
  • “Add a new content model called BlogPost with title, body, and image fields”
  • “Upload the logo from ./assets/logo.png”
  • “Show me version history for the homepage and restore version 3”

Uploading assets

The upload_asset tool supports two modes:

  • Local file path (Node.js stdio mode): pass file_path with an absolute path
  • Base64 content (any runtime, including Workers): pass file_base64 + filename

Supported formats: jpg, png, gif, webp, svg, avif, ico, mp4, webm, pdf.