MCP Server

MCP Server

The ElmapiCMS MCP Server connects AI-powered editors and agents to your CMS instance through the Model Context Protocol. Install it in Cursor, Claude Code, or any MCP-compatible tool and manage collections, fields, content, assets, and webhooks through natural language.

Package: @elmapicms/mcp-server (1.2+).

What It Does

The MCP server gives AI agents direct access to the ElmapiCMS API:

  • Collections & fields — Create, update, and reorder schema
  • Content — List/filter, create, update, patch, publish/unpublish, discard draft, versions, link translations, bulk ops
  • Assets — Upload, list, metadata, bulk ops
  • Project locales — Add locale / set default (admin)
  • Webhooks — CRUD and delivery logs (admin)
  • Schema-aware resources — Built-in field types, collections guide, and query reference

Installation

npm install -g @elmapicms/mcp-server

Or locally:

npm install @elmapicms/mcp-server

You need Node.js 18 or later.

Configuration

VariableDescription
ELMAPI_BASE_URLInstance API root (e.g. https://your-domain.com/api). ELMAPI_API_URL is accepted as an alias.
ELMAPI_API_KEYProject Sanctum token from Project settings → API Access
ELMAPI_PROJECT_IDProject UUID

Setting Up in Cursor

{
  "mcpServers": {
    "elmapicms": {
      "command": "npx",
      "args": ["-y", "@elmapicms/mcp-server"],
      "env": {
        "ELMAPI_BASE_URL": "https://your-domain.com/api",
        "ELMAPI_API_KEY": "your-project-api-token",
        "ELMAPI_PROJECT_ID": "your-project-uuid"
      }
    }
  }
}

After saving, refresh MCP in Cursor settings. The project detail page also shows copy-ready snippets with your project id and base URL.

Setting Up in Claude Code

claude mcp add elmapicms \
  -e ELMAPI_BASE_URL=https://your-domain.com/api \
  -e ELMAPI_API_KEY=your-project-api-token \
  -e ELMAPI_PROJECT_ID=your-project-uuid \
  -- npx -y @elmapicms/mcp-server

Available Tools (40)

Project

ToolDescription
get_projectProject info (locales, default_locale, …)
add_project_localeAdd a locale (admin)
set_default_project_localeSet default locale (admin)

Collections / Fields

ToolDescription
list_collections / get_collectionList or fetch schema
create_collection / update_collection / reorder_collectionsSchema mutations (admin)
create_field / update_field / reorder_fieldsField mutations (admin)

Content Entries

ToolDescription
list_entries / get_entryQuery and fetch
create_entry / update_entry / patch_entrySave draft (save ≠ publish)
publish_entry / unpublish_entry / discard_entry_draftPublication lifecycle (update)
delete_entrySoft-delete
bulk_create_entries / bulk_update_entries / bulk_delete_entriesAtomic bulk
link_entry_translationLink locales (update)
list_entry_versions / get_entry_version / revert_entry_version / update_entry_version_labelVersion history

Assets / Webhooks

ToolDescription
list_assets / get_asset / upload_asset / bulk_upload_assets / bulk_update_asset_metadata / delete_assetMedia
list_webhooks / get_webhook / create_webhook / update_webhook / delete_webhook / list_webhook_logsWebhooks (admin for mutate)

Field names are kebab-case. Richtext writes are markdown strings. Relation writes send UUID/id only (not nested objects from get_entry).

Advanced Queries

list_entries supports where with operators: eq, lt, lte, gt, gte, not, like, in, not_in, null, not_null, between, not_between, plus OR groups and relation filtering.

{
  "where": {
    "price": { "lt": 50 },
    "in-stock": true
  },
  "sort": "price:asc",
  "paginate": 12
}

Use state: "published" (not a custom status field) for live reads.

Built-in Resources

  • Field Types Reference (elmapicms://field-types)
  • Collections Guide (elmapicms://collections-guide)
  • Query Reference (elmapicms://query-reference)

Token Abilities

AbilityTools
readlist/get collections, entries, assets, webhooks/logs
createcreate entries, upload assets, create webhooks
updateupdate/publish/unpublish/discard, versions, link translation, asset metadata, update webhooks
deletedelete entries, assets, webhooks
admincollections/fields; add/set default locales

For agent setup work, grant read, create, update, delete, and admin on a dedicated project token.

Using Multiple Projects

{
  "mcpServers": {
    "elmapicms-blog": {
      "command": "npx",
      "args": ["-y", "@elmapicms/mcp-server"],
      "env": {
        "ELMAPI_BASE_URL": "https://your-domain.com/api",
        "ELMAPI_API_KEY": "blog-project-api-token",
        "ELMAPI_PROJECT_ID": "blog-project-uuid"
      }
    }
  }
}

Local Development

For Laravel Herd / .test with a self-signed cert:

"env": {
  "ELMAPI_BASE_URL": "https://myproject.test/api",
  "ELMAPI_API_KEY": "your-project-api-token",
  "ELMAPI_PROJECT_ID": "your-project-uuid",
  "NODE_TLS_REJECT_UNAUTHORIZED": "0"
}

Only disable TLS verification for local development.

Search documentation

Find guides and reference pages