upassist / neos-mcp
HTTP bridge for AI-assisted Neos CMS content management via MCP
Requires
- php: ^8.2
- ext-curl: *
- ext-openssl: *
- league/oauth2-server: ^8.5
- mcp/sdk: 0.10.*
- neos/flow: ^9.0
- neos/neos: ^9.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-03 13:55:46 UTC
README
Let AI assistants manage your Neos CMS content — safely, with human review before anything goes live.
This package adds an HTTP bridge to your Neos CMS installation that AI tools like Claude Code and Cursor can connect to via the Model Context Protocol (MCP). The AI can read pages, create and edit content, manage assets, and generate preview links. All changes are staged in a separate workspace so an editor can review before publishing.
What's new?
Editor access: Claude for your editors (2.6 for Neos 9, 1.4 for Neos 8)
Until now this package was for developers: one shared token, set up in Claude Code or Cursor. Editor access brings it to the people who actually write the content. An editor adds your site as a connector in claude.ai, Claude Desktop or Claude Code, logs in with their own Neos account, and from then on simply asks Claude: "Create a news item about the open day", "Check the contact page for typos", "Prepare the German translation of About us".
- The editor's own account and rights. Claude acts with the roles of that user (OAuth 2.1 with the normal Neos login and a consent step), so Neos' privileges apply: what the editor may not change, Claude cannot change either.
- Nothing goes live by surprise. All changes go to a private AI workspace per editor, reviewed under Management → Workspaces. Claude only publishes when the editor explicitly asks for it.
- Self-service in the backend. The module AI assistant shows the connector URL, the steps to connect, and the editor's connections with a revoke button; administrators see and revoke all connections.
- Easy to set up and to check.
./flow mcp:generateKeys, a few settings and a role;./flow mcp:checkEditorAccesschecks the server, including a CDN or firewall that blocks Claude. - Ready to hand to editors. A step-by-step guide with screenshots in English, Dutch and German; the backend texts are in English, Dutch and German.
Editor access is off by default and leaves Developer access unchanged. Set it up with Editor access; the full list of changes is in the CHANGELOG.
Which access do you need?
| Developer access | Editor access | |
|---|---|---|
| For whom | Developers, automation | Editors |
| Connects via | stdio client @upassist/neos-mcp to the REST API /neos/mcp/* |
Remote MCP endpoint /neos/mcp/server (Streamable HTTP) |
| Login | Instance token NEOS_MCP_BRIDGE_TOKEN |
OAuth 2.1 with the editor's own Neos account |
| Permissions | Configured role (Administrator by default) | The roles of that user |
| Workspace | Shared mcp workspace |
AI workspace mcp-<hash> per user, only that user has a role on it |
| Turn on | Set the token | editorAccess.enabled: true and grant a role |
Developer access is what the rest of this README describes up to Editor access. Editor access is off by default and does not change Developer access.
How it works (Developer access)
AI Assistant (Claude Code, Cursor, etc.)
│
│ MCP protocol (stdio)
│
neos-mcp-client ← translates MCP ↔ HTTP
│
│ HTTP + Bearer token
│
UpAssist.Neos.Mcp bridge ← this package (runs inside Neos)
│
│ ContentRepository API
│
Neos CMS (mcp workspace → live)
There are two components to install:
- This package (
upassist/neos-mcp) — a Neos Flow package that exposes content operations as a REST API - The MCP server (
@upassist/neos-mcp) — a lightweight Node.js process that translates between MCP protocol and the REST API
Quick start
1. Install the Neos package
composer require upassist/neos-mcp
2. Generate a shared token
The bridge uses a Bearer token to authenticate requests. Generate a secure token and add it to your Neos .env file:
# Generate a random token
openssl rand -hex 32
# .env NEOS_MCP_BRIDGE_TOKEN=paste-your-generated-token-here
3. Install the MCP server
The MCP server is a small Node.js application that runs locally on the developer's machine. See the neos-mcp-client README for detailed installation and configuration instructions per editor.
Quick version for Claude Code:
npm install -g @upassist/neos-mcp
Add a .mcp.json to your Neos project root:
{
"mcpServers": {
"neos-local": {
"command": "neos-mcp",
"env": {
"NEOS_MCP_URL": "http://localhost:8081",
"NEOS_MCP_TOKEN": "paste-your-generated-token-here"
}
}
}
}
Important: Add
.mcp.jsonto.gitignore— it contains your token.
4. Try it out
Start your Neos instance, open Claude Code (or Cursor), and ask:
"Show me the pages on my Neos site"
The AI will call neos_get_site_context and show you the site structure. From there you can ask it to edit content, create pages, upload images, and more — all staged for your review.
Version compatibility
| Package version | Branch | Neos CMS | Flow | PHP | Editor access | Tested on |
|---|---|---|---|---|---|---|
^2.0 |
main |
^9.0 |
^9.0 |
8.2+ | 2.6+ | Neos 9.0, 9.1, 9.2 |
^1.3 |
1.x |
^8.3 |
^8.3 |
8.2+ | 1.4+ | Neos 8.3, 8.4 |
Editor access on Neos 9: the full test suite runs on Neos 9.2. On 9.0 and 9.1 the unit tests, the migrations and mcp:checkEditorAccess were run; the functional tests (they need a MySQL test database, see Testing) have not run there yet.
The Neos 8 line (1.x, formerly the neos-8 branch) gets bug fixes; new features land on main first (Editor access is developed for both lines at the same time). The MCP server (@upassist/neos-mcp, 2.x) works with both lines and needs Node.js 18+.
Requirements
- Neos CMS 9.x (use
^1.3for Neos 8.3 and 8.4) - PHP 8.2+
- Node.js 18+ (for the MCP server)
Configuration
The default settings work out of the box. The only required configuration is the API token in your .env file (see step 2 above).
Workspace
All content changes are written to a dedicated mcp workspace (branched from live). This workspace is created automatically on first use. Changes remain there until explicitly published — the AI never auto-publishes to live.
Authentication
Every request to the bridge must include a Bearer token:
Authorization: Bearer <your-token>
When a proxy strips the Authorization header (nginx with PHP-FPM, for example), send the token in an X-MCP-Token: <your-token> header instead. Both the bridge and the entity endpoints accept it.
A request without a valid token is rejected and nothing is executed. Depending on where it is stopped this is a 403 (Flow's method security, the usual case) or a 401 (the controller's own token check), so clients should treat both as "not authorised".
By default, authenticated requests get Neos.Neos:Administrator privileges. To restrict this to Editor privileges, add to your site's Settings.yaml:
Neos: Flow: security: authentication: providers: 'UpAssist.Neos.Mcp:ApiToken': providerOptions: authenticateRoles: - 'Neos.Neos:Editor'
Full settings reference
UpAssist: Neos: Mcp: apiToken: '%env:NEOS_MCP_BRIDGE_TOKEN%' mcpWorkspaceName: 'mcp' mcpWorkspaceTitle: 'MCP Review' mcpWorkspaceDescription: 'Shared workspace for AI-assisted content changes, pending human review' preview: # the auth provider factory that the preview wraps, see "Preview links and your own auth provider" below wrappedAuthProviderFactory: 'Neos\Neos\Security\ContentRepositoryAuthProvider\ContentRepositoryAuthProviderFactory'
Preview links and your own auth provider
Preview links are only issued and honoured for the MCP workspace (mcpWorkspaceName), never for live, personal or other shared workspaces. A preview link (?_mcpPreview=) lets an anonymous visitor read that workspace, and nothing else: it is not a login, and policies, the firewall and CSRF protection apply as usual. It works on GET and HEAD requests only.
To grant that one read, the package sets the auth provider factory of the default content repository preset (Neos.ContentRepositoryRegistry.presets.default.authProvider.factoryObjectName) to UpAssist\Neos\Mcp\Security\PreviewAuthProviderFactory. That factory builds the auth provider of UpAssist.Neos.Mcp.preview.wrappedAuthProviderFactory (Neos' own by default) and only adds the preview read on top. If your site uses its own auth provider factory, set it in wrappedAuthProviderFactory instead of in the preset; a content repository that sets authProvider itself does not get previews.
What the AI can do
Once connected, the AI assistant has access to these capabilities:
Read content
| Tool | Description |
|---|---|
neos_list_sites |
List all sites of the Neos instance (name, node name, domains, default site) |
neos_get_site_context |
Get site structure, all node types with properties, and page tree |
neos_list_pages |
List all pages in a workspace |
neos_get_page_content |
Get all content nodes on a specific page |
neos_get_document_properties |
Get page-level properties (title, SEO fields, etc.) |
neos_list_node_types |
List available node types and their properties |
Create and edit content
| Tool | Description |
|---|---|
neos_update_node_property |
Update a property on an existing node (text, images, metadata) |
neos_create_content_node |
Create a new content element inside a page |
neos_create_document_node |
Create a new page |
neos_move_node |
Move a node to a new position |
neos_delete_node |
Remove a node (with dimensions: only that variant) |
neos_create_node_variant |
Create a variant of a node in other content dimensions, as a copy or empty |
Manage assets
| Tool | Description |
|---|---|
neos_list_assets |
Browse the Media Manager (filter by type, tag) |
neos_list_asset_tags |
List available asset tags |
neos_upload_asset |
Upload a file (local path, URL or base64) to the Media Manager, incl. title, caption, tags and collections. Identical files are deduplicated. |
Review and publish
| Tool | Description |
|---|---|
neos_get_preview_url |
Generate a 24-hour preview link (no Neos login needed), on the domain of the page's site |
neos_list_pending_changes |
See what has been changed, optionally only for one site |
neos_publish_changes |
Publish all changes from workspace to live, or only those of one site |
Typical AI workflow
1. neos_get_site_context → Understand the site
2. neos_get_page_content → Read current content
3. neos_update_node_property → Make changes
4. neos_get_preview_url → Generate preview for human review
5. (human reviews the preview)
6. neos_publish_changes → Go live after confirmation
Multi-site
A Neos instance can host several sites. The bridge works on the default site unless a request names another one:
listSites(toolneos_list_sites) returns all sites with name, node name, online state, primary domain and domains, content repository and default dimension space point, and marks the default site.- Every endpoint accepts an optional
siteparameter with a site node name (e.g.site=blog). It selects the site for the site-scoped parts of the request: site context, page tree, content repository and default dimension space point, pending changes and publishing. An unknown site returns404. getSiteContextlists the available sites insitesand tells the assistant to passsitewhen the instance has more than one.- Operations by node id (
getPageContent,updateNodeProperty,createContentNode,moveNode, …) work on any site of the content repository;siteis only needed there when sites use different content repositories or default dimensions. getPreviewUrlbuilds the link on the primary domain of the page's own site, not on the host the bridge was called with. Scheme and port the domain doesn't define are taken from the bridge request (second.localhostcalled viahttp://localhost:8080becomeshttp://second.localhost:8080).listPendingChangesreturns the site of each change; withsiteit only returns changes of that site.publishChangeswithsitepublishes only that site's changes (asPublishIndividualNodesFromWorkspace), changes of other sites stay in the workspace. Changes are attributed to a site via the node's site node, for removed nodes via their live counterpart, so removals made through the bridge are published per site as well (Neos'publishChangesInSite()can't attribute nodes removed withRemoveNodeAggregate). A site without changes publishes nothing and returnspublishedNodes: 0. Pending entries whose node exists neither in the workspace nor in live have no site and are only published withoutsite.- The CLI has
./flow mcp:listsitesand a--siteoption onmcp:sitecontext,mcp:listpages,mcp:listpendingchangesandmcp:publishchanges.
Without site, everything behaves as before. Which site is the default is decided by Neos: Neos.Neos.defaultSiteNodeName, or, if that isn't set, the first online site ordered by name.
The MCP workspace exists once per content repository, so sites sharing a content repository also share the review workspace; use site on listPendingChanges and publishChanges to review and publish them separately.
One API token covers the whole instance: it authenticates with the configured roles (Neos.Neos:Administrator by default) for all sites. Restricting a token to certain sites is not supported.
Content dimensions
A site can have content dimensions, such as a language or a country. getSiteContext lists them under dimensions, with the default value and the fallback chain of each value (for example {"value": "en_UK", "fallback": ["en_US"]}). Any number of dimensions can be combined.
Every endpoint accepts an optional dimensions parameter that selects the dimensions the request works in, like site selects the site. Pass a JSON object ({"language": "nl", "country": "be"}; in a GET query as a JSON string or as dimensions[language]=nl). Dimensions you leave out keep their default value; without dimensions the request works in the default dimensions, exactly as before. An unknown dimension or value answers 400 and lists the available ones.
- Nodes in the responses contain
dimensions(where the node is stored) andfallback(truewhen it is only visible in the requested dimensions through a fallback). - With
dimensions, a node that is only visible through a fallback is not modified, moved or used as a parent: the request answers409with the dimensions the node is stored in. Create the variant first withcreateNodeVariant. createNodeVariantcreates a variant in the target dimensions, from the node as it exists insourceDimensions(default: the default dimensions).modeiscopy(properties and content are copied) orempty(no properties except the URI path segment, and no content). The parent has to exist in the target dimensions: create variants top-down (409otherwise).deleteNodewithdimensionsremoves only the variant in those dimensions.deleteNodewithdimensionson a node that is only visible through a fallback removes the page from the requested dimension (and its specializations) only, as Neos 9 does; it stays in the dimension it is stored in. A specialization that was removed this way does not fall back again. This is the one write that does not answer409for such a node.getPreviewUrlputs the prefix of the site's dimension resolver in the link (for example/uk/page).listPendingChangesshows thedimensionsof each change (nullfor changes that apply to the whole node) and only lists the changes of the requested dimensions. Neos publishes whole nodes, sopublishChangeswithdimensionspublishes the nodes whose pending changes are all in those dimensions; nodes that also changed in another dimension are skipped and listed underskippedNodes. Withoutdimensionseverything is published.- When a dimension was added to a site that already has content,
createNodeVariantbrings theSitesroot node up to date for it. A shared workspace that was created earlier may be outdated (./flow workspace:rebase mcp). - A request for dimensions the site has no content in yet answers an empty
pageslist onlistPageswith a hint.
Entity CRUD (advanced)
Beyond Neos content nodes, the bridge can also expose custom Doctrine entities for CRUD operations. This is useful for managing data stored in custom database tables (e.g. notifications, form submissions, product data).
Packages declare their entities in YAML — no code changes in the bridge itself:
UpAssist: Neos: Mcp: entities: notifications: label: 'Editor Notifications' className: 'Vendor\Package\Domain\Model\Notification' repository: 'Vendor\Package\Domain\Repository\NotificationRepository' service: 'Vendor\Package\Service\NotificationService' # optional fields: title: type: string label: 'Title' required: true content: type: markdown label: 'Content' status: type: enum enum: [draft, active, archived]
Once configured, the AI gets access to generic entity tools: neos_entity_discover, neos_entity_list, neos_entity_show, neos_entity_create, neos_entity_update, neos_entity_delete, and neos_entity_action.
Supported field types
| Type | Description |
|---|---|
string, text, markdown |
Text fields |
integer, float |
Numeric fields |
boolean |
Boolean (also accepts string "true"/"false") |
datetime |
ISO 8601 date/time |
reference |
UUID reference to another entity |
asset |
Reference to a Neos asset (by UUID) |
enum |
Validated against a list of allowed values |
json |
JSON data |
Service delegation
When a service and serviceMethods are configured, CRUD operations are routed through a service class instead of direct repository calls. This preserves business logic like validation, markdown rendering, and side effects. Use parameterMapping when service method parameters differ from field names.
Full entity configuration reference
UpAssist: Neos: Mcp: entities: myEntity: label: 'My Entity' className: 'Vendor\Package\Domain\Model\MyEntity' repository: 'Vendor\Package\Domain\Repository\MyEntityRepository' service: 'Vendor\Package\Service\MyEntityService' fields: title: type: string label: 'Title' required: true filters: active: label: 'Active items' method: 'findActive' byStatus: label: 'Filter by status' method: 'findByFilter' parameters: filter: type: string required: true actions: publish: label: 'Publish' method: 'publish' serviceMethod: true requiresEntity: true serviceMethods: create: method: 'createEntity' parameterMapping: content: 'contentMarkdown' update: method: 'updateEntity' parameterMapping: content: 'contentMarkdown' delete: method: 'delete'
Review Status (opt-in)
The package includes an optional review workflow that shows editors which pages were modified by AI and what changed.
Enabling
Add the mixin to your Document node types:
'Your.Site:Mixin.Document': superTypes: 'UpAssist.Neos.Mcp:Mixin.ReviewStatus': true
What it does
- Automatic change tracking — When content is modified via MCP, the closest Document node is marked as "needs review" with a changelog of what changed
- Visual indicators — Orange dots appear in the Neos document tree and inspector for pages needing review
- Translated changelog — Property changes show translated labels (e.g. "Property 'Keywords' changed" instead of raw property names)
- Approval workflow — When an editor sets the status to "Approved", the changelog is automatically cleared
The Review tab in the inspector shows:
- Status: Approved / Needs Review
- Last changed: When the AI last modified the page
- Changelog: List of changes since last approval
API reference
Full REST API documentation
All endpoints are available under /neos/mcp/ and accept/return JSON. Every request requires a Authorization: Bearer <token> header.
Every endpoint also accepts an optional site parameter (a site node name) that selects the site for site-scoped operations, see Multi-site. Without it the default site is used.
Every endpoint also accepts an optional dimensions parameter that selects the content dimensions the request works in, see Content dimensions. Without it the default dimensions are used.
Property resolution
updateNodeProperty, createContentNode, and createDocumentNode all resolve property values against the target NodeType's declared property type before writing them:
| Property type | Accepted input | Resolved to |
|---|---|---|
| Image / Asset | Asset UUID, or {"__type":"asset","identifier":"<uuid>"}; an empty string or null clears it |
The Asset/Image entity |
integer / float |
A number, or a string with a number ("5", "1.5"); any other string answers 400 |
int / float |
reference |
Node aggregate identifier (UUID); an empty string clears it | Validated, set via a SetNodeReferences command |
references |
JSON array, comma-separated string, or PHP array of node aggregate identifiers | Validated array, set via a SetNodeReferences command |
DateTime |
Date string | \DateTime |
array |
JSON string | PHP array |
boolean |
true/false/"1"/"yes"/"on"/etc. |
bool |
Neos\Neos\Domain\Link\Link |
URI string (node://<id>, asset://<id>, https://…, mailto:…), or an object / JSON string with href and optional title, target, rel, download. An empty string or null clears the link. A node:// target must exist in the workspace that is written to; other schemes are not checked |
Link value object |
References are recognised from the NodeType's references configuration (Neos 9 migrates legacy type: reference(s) properties into it; maxItems: 1 means a single target). Every target must exist in the workspace that is written to and, if the reference configures ui.inspector.editorOptions.nodeTypes, be of one of these node types (or a subtype); a single reference accepts at most one identifier. An empty value clears the reference. On create, reference/references properties are applied in a follow-up SetNodeReferences command right after the node is created, since they aren't part of PropertyValuesToWrite. If an asset, a referenced node or a node:// link target can't be found in the workspace, the call fails with a 404; if a value doesn't fit the property (a date string that is invalid, a link object without href, a string that is not a number for an integer), or the property is not declared on the NodeType, it fails with a 400. Both with an {"error": "..."} body, see Errors.
Reading a node returns a Link property as {"href", "title", "target", "rel", "download"}.
Reading a node (getPageContent, getDocumentProperties, listPages) returns its references next to properties under references, in the format the write endpoints accept: every reference declared on the NodeType, a node aggregate identifier or null for reference, a list of identifiers for references. listNodeTypes and getSiteContext describe them per node type under references with type (reference/references), label and targetNodeTypes (the node types the inspector offers, from ui.inspector.editorOptions.nodeTypes; null when not configured, then any existing node is accepted). References are read and written in the requested dimensions, like properties. Reading references needs bridge 2.5.0 or later.
Since 2.5.0 a write with an unknown reference target, or a target of a node type the reference doesn't offer, fails with an {"error": "..."} body (404 for an unknown target and 400 for a node type the reference doesn't offer since 2.6.0, a 500 before). Before 2.5.0, unknown targets of references were dropped silently and the call succeeded.
Errors
Errors answer with a JSON body {"error": "<message>"} (some add keys, such as conflicts). Exceptions are the refusals Flow itself makes before the endpoint runs: the 403 of its method security and a missing required argument of the entity endpoints (400). The status says what went wrong:
| Status | Meaning |
|---|---|
400 |
Invalid input: a missing argument, an unknown node type or property, a value that doesn't fit the property, an unknown dimension, a workspace that does not exist ("Workspace 'x' does not exist. Call setupWorkspace first.", for reads and writes), publishing live |
401 / 403 |
No valid token, see Authentication |
404 |
Something the request names does not exist: a node, a parent, a sibling or move target, a site, an asset, a reference or link target |
409 |
The change would break the structure: the node type constraints of the parent, a node name that is taken, moving a node into itself or below itself, or a node (or parent) that only exists in the requested dimensions through a fallback (except deleteNode, see Content dimensions) |
500 |
An unexpected failure |
Before 2.6.0 most of the 400, 404 and 409 failures of the write endpoints answered 500, and writes to a workspace that does not exist answered 500 (some without a JSON body).
GET /neos/mcp/listSites
Lists all sites of the instance: name, nodeName, online, default, primaryDomain, domains (domain, active), contentRepositoryId, defaultDimensionSpacePoint.
GET /neos/mcp/getSiteContext
Returns site info, all node types with properties, and the page tree, for the default site or the one passed as site. sites lists all sites of the instance. Typically the first call an MCP client makes.
POST /neos/mcp/setupWorkspace
Creates the MCP workspace if it doesn't exist.
POST /neos/mcp/listPages
List all document nodes. Optional parameter: workspace (default: mcp).
POST /neos/mcp/getPageContent
Get all content nodes for a page. Parameters: nodeAggregateId (required), workspace (default: mcp).
POST /neos/mcp/getDocumentProperties
Get document-level properties. Parameters: nodeAggregateId (required), workspace (default: mcp).
POST /neos/mcp/listNodeTypes
List available node types. Parameter: filter — content, document, or all (default: content).
POST /neos/mcp/updateNodeProperty
Update a single property on a node. Parameters: contextPath (required), property (required), value (required), workspace (default: mcp). For image/asset properties, pass the asset UUID — it will be resolved automatically.
POST /neos/mcp/createContentNode
Create a content node. Parameters: parentPath (required), nodeType (required), properties (optional), workspace (default: mcp). properties values are resolved the same way as updateNodeProperty — see Property resolution above.
POST /neos/mcp/createDocumentNode
Create a page. Parameters: parentPath (required), nodeType (required), properties (optional), workspace (default: mcp), nodeName (optional), insertBefore/insertAfter (optional). properties values are resolved the same way as updateNodeProperty — see Property resolution above.
POST /neos/mcp/moveNode
Move a node. Parameters: contextPath (required), plus exactly one of: insertBefore, insertAfter, or newParentPath. Optional: workspace (default: mcp).
POST /neos/mcp/deleteNode
Remove a node. Parameters: contextPath (required), workspace (default: mcp).
POST /neos/mcp/createNodeVariant
Create a variant of a node in other dimensions, see Content dimensions. Parameters: nodeAggregateId (required), dimensions (required, the target dimensions), sourceDimensions (optional, default: the default dimensions), mode (copy or empty, default: copy), workspace (default: mcp).
POST /neos/mcp/listPendingChanges
List unpublished changes. Parameters: workspace (default: mcp), site (optional, only changes of that site). Each change contains the node name of its site.
POST /neos/mcp/getPreviewUrl
Generate a 24-hour preview URL. Parameters: nodeAggregateId (required), workspace (default: mcp; only the MCP workspace, mcpWorkspaceName, is accepted). The URL uses the primary domain of the node's site (falling back to the request host); the response contains the node name of that site.
GET /neos/mcp/listAssets
List assets from the Media Manager. Parameters: mediaType (default: image, matched as prefix of the media type, e.g. image, application; empty for all), tag (tag label), limit (default: 50), offset (default: 0).
Both filters are applied in the database query, so total is the number of assets matching the filters (not the page size) and limit/offset page through that filtered set. A tag that does not exist returns an empty list with total: 0.
GET /neos/mcp/listAssetTags
List all asset tags.
POST /neos/mcp/uploadAsset
Upload a file into the Media Manager. JSON body:
| Parameter | Type | Description |
|---|---|---|
filename |
string, required | Target filename including extension (any path parts are stripped) |
content |
string, required | Base64 encoded file content |
title, caption, copyrightNotice |
string | Optional asset metadata |
tags |
string[] | Tag labels; missing tags are created |
assetCollections |
string[] | Collection titles; missing collections are created |
allowDuplicate |
bool | Default false. Without it, a file whose content (SHA1) already exists returns the existing asset with duplicate: true instead of creating a second one |
The asset class (Image, Document, Video, Audio) is chosen by Neos' AssetModelMappingStrategyInterface, the same way the Media Browser does it. Response:
{
"success": true,
"duplicate": false,
"asset": {
"identifier": "e2d168e1-…",
"title": "…",
"filename": "example.png",
"mediaType": "image/png",
"fileSize": 71,
"assetType": "Image",
"publicUri": "https://…/_Resources/Persistent/…/example.png",
"tags": ["…"],
"collections": ["…"]
}
}
Good to know:
- The
identifiercan be used as the value of an image/asset property inupdateNodeProperty,createContentNodeandcreateDocumentNode. - When an existing asset is returned (
duplicate: true), thetitle,caption,tagsandassetCollectionsfrom the request are not applied to it. - Base64 makes the payload about 33% larger than the file. The limit is therefore set by PHP (
post_max_size,upload_max_filesize) and your web server (e.g. nginxclient_max_body_size), not by this package. Large files are better added through the Media Manager. - Assets are not workspace-aware in Neos: an uploaded file is visible in the Media Manager immediately, not only after publishing.
- Errors:
400for a missingfilename/contentor invalid base64, otherwise500with{"error": "…"}.
POST /neos/mcp/publishChanges
Publish all pending changes to live. Parameters: workspace (default: mcp), site (optional, publish only the changes of that site). Without pending changes it answers 200 with "publishedNodes": 0. live itself cannot be published (400); an unknown workspace answers 404.
Entity endpoints
All at /neos/mcp/entity/, using Bearer token auth:
| Endpoint | Method | Description |
|---|---|---|
listentities |
GET | Discover all exposed entities with schemas |
list |
POST | List/filter entities |
show |
POST | Get single entity by UUID |
create |
POST | Create new entity |
update |
POST | Update entity properties |
delete |
POST | Delete entity |
execute |
POST | Run a named action |
Editor access
Editor access lets editors connect Claude (claude.ai, Claude Desktop, Claude Code) to Neos with their own account. Claude talks to the remote MCP endpoint /neos/mcp/server; the editor logs in with the normal Neos login and gives consent once. Claude then acts with the roles of that user, so Neos node privileges apply: what the editor may not edit in Neos, the assistant may not edit either. Available from 1.4 (Neos 8) and 2.6 (Neos 9).
For editors there is a step-by-step guide in English, Dutch and German. It covers connecting in claude.ai, Claude Desktop and Claude Code, reviewing and publishing, managing connections and common problems.
It needs the MCP SDK (mcp/sdk) and league/oauth2-server, which composer require installs together with the package. After an update run ./flow doctrine:migrate (the OAuth tokens and the AI workspace records are stored in tables prefixed upassist_neos_mcp_).
1. Generate the keys
./flow mcp:generateKeys [--path=<directory>] [--force]
This writes private.key (mode 0600) and public.key (mode 0644) to Data/Persistent/UpAssist.Neos.Mcp/ (or --path) and prints the .env lines, including a fresh encryption key. Existing files are never overwritten without --force, which invalidates every token issued with the old keys.
NEOS_MCP_OAUTH_PRIVATE_KEY=/path/to/private.key NEOS_MCP_OAUTH_PUBLIC_KEY=/path/to/public.key NEOS_MCP_OAUTH_ENCRYPTION_KEY=...
A private key file must be readable by its owner only (0600); 0640 and 0644 are rejected. If the web server user is not the owner (PHP-FPM user differs from the deploy user), put the PEM itself in the environment variable instead (a value starting with -----BEGIN is used as inline PEM). Keep both keys out of version control.
Release-based deploys (Deployer and the like): without --path the keys go to Data/Persistent/UpAssist.Neos.Mcp/ of the current release (releases/N/...), and a later deploy removes them. Generate them into the shared directory (--path=/var/www/<site>/shared/Data/Persistent/UpAssist.Neos.Mcp) or put them inline in .env. mcp:generateKeys warns, and mcp:checkEditorAccess reports FAIL, for a key path that contains /releases/.
Inline PEM in .env: a PEM has several lines. Put the whole value in double quotes, with the real line breaks (most .env loaders, including the one Flow uses in Bedrock-style setups, keep them inside double quotes):
NEOS_MCP_OAUTH_PRIVATE_KEY="-----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASC... -----END PRIVATE KEY-----"
A value with a literal \n instead of line breaks is rejected (503, and mcp:checkEditorAccess says why). If your .env loader cannot do multi-line values, use key files in the shared directory instead.
The keys are checked before every request: the private key must be an RSA private key, the public key its RSA public key (not swapped, the same pair), and the encryption key the Defuse key mcp:generateKeys prints (or a password of at least 32 characters). Anything else answers 503 and never 500.
2. Settings
UpAssist: Neos: Mcp: editorAccess: enabled: true resourceUrl: 'https://www.example.com/neos/mcp/server' # exactly as entered in the connector tools: entityCrud: false # the entity tools, only for editors whose roles grant UpAssist.Neos.Mcp:EntityCrud oauth: accessTokenTtl: 3600 # seconds refreshTokenTtl: 2592000 # seconds, refresh tokens are rotated on use allowedClientMetadataHosts: ['claude.ai'] allowedRedirectUris: ['https://claude.ai/api/mcp/auth_callback'] allowLoopbackRedirects: true # http://localhost:<port>/callback and http://127.0.0.1:<port>/callback (Claude Code)
resourceUrl must be https://<host>/neos/mcp/server: port 443, exactly that path, no user info, query or fragment.
While enabled is false the endpoints answer 404; with enabled: true but missing or unusable keys or an invalid resourceUrl they answer 503 with the names of the settings ({"error":"editor_access_misconfigured","missing":[...]}); the system log and mcp:checkEditorAccess say what is wrong with them. Scopes are neos:read, neos:write and neos:publish; PKCE (S256 only) is required and there are no client secrets (token_endpoint_auth_methods_supported: ["none"]).
3. Server
-
The
Authorizationheader must reach PHP. nginx with PHP-FPM:fastcgi_param HTTP_AUTHORIZATION $http_authorization;. Apache:CGIPassAuth On(needs Apache 2.4.13 or newer).REDIRECT_HTTP_AUTHORIZATIONis not enough, and there is noX-MCP-Tokenfallback for Editor access (Claude only sendsAuthorization). -
HTTPS on port 443. The
resourceUrlmust be exactly what editors enter in the connector. -
Firewall/WAF: claude.ai and Claude Desktop connect from Anthropic's cloud, from
160.79.104.0/21and153.61.208.0/20. Allow these ranges before testing. -
CDN or bot protection (Cloudflare and the like): claude.ai and Claude Desktop call the MCP server with the user agent
Claude-Userand fetch the OAuth metadata and tokens withpython-httpx. Cloudflare's bot protection (Bot Fight Mode, WAF or security rules) can answer them with403("Your request was blocked.") before Neos sees anything, also on*.trycloudflare.comtunnels. Allow both user agents and the IP ranges above, for example with a WAF skip rule.mcp:checkEditorAccesscalls the server asClaude-Userandpython-httpxand reports such a block; a block on the IP ranges alone cannot be seen from the server itself. -
Request size: limit request bodies for
/neos/mcp/serverto about 4 MiB at the web server (nginx:client_max_body_size 4m;, Apache:LimitRequestBody 4194304). -
Reverse proxy: the
Hostheader that reaches Neos must be the public host ofresourceUrl, otherwise the endpoint answers403. -
If another global authentication provider has its own entry point, it can replace the
401challenge Claude needs to start the login. Check this withmcp:checkEditorAccess. -
Dotfile rules: many server configurations deny every path that starts with a dot (
location ~ /\. { deny all; }, also in Plesk's default nginx settings). That blocks/.well-known/oauth-authorization-serverand/.well-known/oauth-protected-resource, and Claude cannot start the login. Allow them before the deny rule, for example in nginx (Plesk: Apache & nginx Settings → Additional nginx directives):location ^~ /.well-known/oauth- { try_files $uri /index.php?$args; }
In Apache, a
RewriteRuleor<FilesMatch>that denies dotfiles needs an exception for^\.well-known/oauth-. -
Several web servers: the consent step keeps the pending authorization in the Neos session, and Flow's session lock is a file lock on one machine. Behind a load balancer use sticky sessions for
/neos/mcp/oauth/authorizeand/neos/login, or a session and lock backend that all servers share. -
Failed OAuth requests are logged in the system log (
Data/Logs/System.log): rejected clients with the host of theirclient_idand the reason (warning), error pages and token-endpoint errors (info). Refused requests to/neos/mcp/serverwrite one info line starting withEditor access:with the status and the reason (no_token,invalid_token (expired),insufficient_scope (no access),invalid_host,invalid_origin, ...); for a Host or Origin refusal also those two headers, sanitized and shortened to 100 characters. Codes, tokens and keys are never logged. The client metadata is fetched with theUser-AgentUpAssist.Neos.Mcp/<version>.
4. Give editors the role
./flow user:addrole <username> UpAssist.Neos.Mcp:EditorAccess
Only users with the role UpAssist.Neos.Mcp:EditorAccess can connect. They find the connector URL, a short manual for claude.ai, Claude Desktop and Claude Code, and their own connections (with a revoke button) in the backend module AI-assistent under Beheer (management/aiassistant). Administrators also see an overview of all connections there and can revoke them; an administrator without the role sees only that overview (no connector URL, no own connections). When the role is removed or the account is deactivated, the access tokens stop working at once and refreshing fails with invalid_grant.
5. Check the setup
./flow mcp:checkEditorAccess --url=https://www.example.com
Pass the base URL with --url; without it the resourceUrl setting is used. The command checks the configuration, port 443, the three metadata URLs, the 401 challenge of the MCP endpoint (with the Host of resourceUrl) whether the Authorization header reaches PHP (it sends Bearer test, never a real token), and whether the MCP endpoint and the metadata still answer when called with Claude's user agents Claude-User and python-httpx (a 403 without a WWW-Authenticate challenge means a CDN or firewall blocks Claude before Neos). On Neos 9 it also checks the table of the AI workspace records (upassist_neos_mcp_aiworkspace): FAIL when it is missing or lacks columns, then run ./flow doctrine:migrate. It prints one OK/FAIL line per check and exits with 1 on any failure. It also reminds you of the IP ranges and the body size limit, which it cannot test.
What the assistant does in Editor access
- All changes go to an AI workspace per user, named
mcp-<hash>(AI – <full name>), based onlive. On Neos 9 it is a shared workspace whose only role assignment is Manager for that user: other editors cannot open it, administrators can manage it (for instance delete it) but not read its content. - The editor reviews the changes in the Workspaces module: Beheer → Werkruimten (Management → Workspaces), at
AI – <full name>(open its review; the button is called Review in English, Controleer in the Neos 9 Dutch UI and Herziening in the Neos 8 Dutch UI). There each change can be published or discarded. The editor should not select the AI workspace as their own target workspace in the content module: their own publishes would then go into the AI workspace instead of live. Publishing to live from there needs Neos' own privilege to publish to live (a Restricted Editor can review and discard, not publish). - The assistant publishes only when the editor explicitly asks for it (
neos_publish_changes, scopeneos:publish); it publishes the AI workspace only. If the editor changed the same node in another workspace, whoever publishes last wins. - There are no preview links in Editor access, and the tools have no
workspaceargument. - Neos 9 only:
neos_sync_workspacerebases the AI workspace ontolive, for instance after someone published changes to the same pages. Withoutforcea conflict changes nothing and the tool lists the conflicting nodes; withforce(only when the editor explicitly asks, after the assistant named the changes that will be lost) the conflicting changes of the AI workspace are discarded. Neos 8 has no such operation, so the tool is not offered there.
Tools in Editor access:
| Scope | Tools |
|---|---|
neos:read |
neos_get_site_context, neos_list_sites, neos_list_pages, neos_get_page_content, neos_get_document_properties, neos_list_node_types, neos_list_pending_changes, neos_list_assets, neos_list_asset_tags |
neos:write |
neos_create_content_node, neos_update_node_property, neos_delete_node, neos_create_document_node, neos_move_node, neos_create_node_variant, neos_upload_asset (base64 up to about 3 MiB, or a public https URL up to 20 MiB; no local file paths), neos_sync_workspace (Neos 9 only) |
neos:publish |
neos_publish_changes |
| entity tools | neos_entity_*, only with editorAccess.tools.entityCrud: true and a role that grants UpAssist.Neos.Mcp:EntityCrud |
Not offered: neos_setup_workspace, neos_get_preview_url and neos_restart.
neos_publish_changes also follows Neos' own rules: without the privilege to publish to live (for example a Restricted Editor) it is refused, even with the neos:publish scope.
Uploaded assets are not workspace content: neos_upload_asset puts the file into the shared Media Manager at once, where other editors see it and its resource URL is public, also before anything is published. Missing tags and asset collections are created for the whole site.
Several sites
- One Neos installation with several sites: one connector is enough. The assistant lists the sites with
neos_list_sitesand passessitetoneos_get_site_context,neos_list_pages,neos_list_pending_changesandneos_publish_changesfor the site the editor names (see Multi-site). Neos' own privileges still decide what the editor may change on each site. All sites share the one AI workspace of that user; publishing withsitepublishes only that site's changes. - Several Neos installations: one connector per installation. Each has its own connector URL (
https://<host>/neos/mcp/server, shown in the module "AI-assistent"), its own login and its own consent. Give each connector a recognisable name in Claude, for instance the name of the site, so the editor and the assistant can tell them apart. - On Neos 9 all these sites must be in the content repository of the default site (see Neos 9: one content repository).
Neos 9: the AI workspace record
On Neos 9 another editor could create a workspace with the same name, title and roles. So Editor access stores a record of every AI workspace it creates (table upassist_neos_mcp_aiworkspace): the user it was created for and the WorkspaceWasCreated event of that workspace. An existing workspace named mcp-<hash> is only used when the record names this user and exactly that creation event, and the workspace still has its shape (base live, shared, no owner, only Manager for the user). Otherwise the tools answer 409 with "Workspace 'mcp-…' exists but is not the AI workspace of this user. Ask an administrator to remove or rename the workspace 'mcp-…'.", and the system log has a warning with the reason (possible squatting).
For the administrator: a 409 like that usually means the workspace was created or changed by hand (for instance an extra role added in the Workspaces module). Remove the extra roles, or delete the workspace; Editor access creates it again on the next call. When the records table is missing or incomplete (a migration has not run), the tools answer 503 "… Ask an administrator to run the database migrations." and mcp:checkEditorAccess reports FAIL; run ./flow doctrine:migrate.
The record is removed together with the workspace by a catch-up hook on the content graph projection. It is registered for content repositories with the preset default only; a content repository with its own preset that does not extend default gets no hook. That does not open a gap: the security rests on the binding to the creation event (a workspace created again later never matches an old record, and a stale record is dropped before the workspace is created again), the hook only cleans up.
Neos 9: one content repository
The AI workspace lives in the content repository of the default site, whatever site a tool call selects. With sites in several content repositories, Editor access works only on the sites of the default site's content repository.
Architecture
Internal components
| Component | Purpose |
|---|---|
McpBridgeController |
REST API endpoints for all content operations |
ApiTokenProvider |
Flow security authentication provider (Bearer token to Neos roles) |
PreviewTokenMiddleware |
HTTP middleware that activates workspace preview from ?_mcpPreview= tokens |
PreviewTokenService |
Singleton holding the active preview workspace for the current request |
PreviewAuthProvider |
Wraps the content repository's auth provider; grants reading the active preview workspace only |
WorkspacePreviewAspect |
AOP aspect that switches ContentRepository context to the preview workspace |
ReviewStatusService |
Tracks MCP changes, creates changelog entries, clears on approval |
ReviewStatusNodeInfoAspect |
Injects review status into Neos UI tree node data |
Preview mechanism
PreviewTokenMiddlewarereads the_mcpPreviewquery parameter- Validates the token against cache (24h TTL)
- Activates the preview workspace via
PreviewTokenService WorkspacePreviewAspectrenders the requested page from the preview workspace instead of livePreviewAuthProviderlets this request read the preview workspace; every other authorization decision is Neos' own- The page renders normally — hidden content is not shown in previews
Up to 2.5.0 a valid token switched off all authorization checks for the request, on any route. Since 2.5.1 it only grants reading its own workspace, on GET and HEAD requests; since 2.5.2 that is always the MCP workspace.
Testing
The functional tests exercise the HTTP endpoints through the real stack (routing, token authentication, persistence), so the same tests run on the Neos 9 (main) and Neos 8 (1.x) branch. Run them from a Neos distribution that has this package installed and phpunit available:
FLOW_CONTEXT=Testing bin/phpunit \ -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml \ Packages/Application/UpAssist.Neos.Mcp/Tests/Functional
-
The tests need their own database. Configure it in the distribution's
Configuration/Testing/Settings.yaml(Neos.Flow.persistence.backendOptions) and never point it at a database with real content. -
The content repository tests (built on
Tests/Functional/Support/ContentRepositoryTestCase: the REST characterization, the services and the MCP tools of Editor access) need MySQL or MariaDB: the Neos 9 content repository does not run on SQLite. Use a separate database whose name containstest, for exampleflow_functional_testing. Flow drops every table of the Testing database after each functional test, soTestingDatabaseGuardrefuses to run against any other database name (or SQLite other than:memory:).pathmust stay set, otherwise Flow skips the schema setup:Neos: Flow: persistence: backendOptions: driver: pdo_mysql host: 127.0.0.1 port: 3306 dbname: 'flow_functional_testing' # never the database of the site user: neos password: '...' path: ':memory:'
-
The package ships
Configuration/Testing/Settings.yaml, which sets a fixed API token for the test run. It only applies in theTestingcontext. -
Running the whole functional suite of a distribution that also contains other packages' functional tests can fail on their missing dev dependencies (for example
neos/behat). In that case run the tests from a cleanneos/neos-base-distributionthat requires this package.
Editor access tests
- Unit tests (no database):
Tests/Unit/EditorAccess/(configuration, key provider and generator, redirect-URI policy, client metadata resolver, S256-only grant, remote URL guard, the service contract coverage) andTests/Unit/Command/CheckEditorAccessTest.php(mcp:checkEditorAccessagainst a stub client). - Functional tests:
Tests/Functional/EditorAccess/(OAuth authorize, token and refresh flow, token storage, token validation, MCP endpoint, tool behaviour, the AI-assistant module) andTests/Functional/Service/AiWorkspaceServiceTest.php(the AI workspace and its record).Tests/Functional/Rest/RestCharacterizationTest.phppins the REST responses of Developer access, so they stay byte-identical. ToolParityTestcompares the tools of Editor access withTests/Fixtures/client-tools.json, which is generated in the client withnpm run export-tools. Regenerate it when the client's tools change.- The package ships
Configuration/Testing/Policy.yaml(andNodeTypes.yaml,Settings.yaml,Objects.yaml) for theTestingcontext. After a checkout or an update of these files runFLOW_CONTEXT=Testing ./flow flow:cache:flushbefore the tests. TokenFlowTestpins theinvalid_grantmapping to the hint strings ofleague/oauth2-server. After every upgrade of that library, run it again.- Editor access is the same code on both lines.
Build/check-editor-access-parity.sh <this checkout> <other checkout>compares the shared files (Classes/EditorAccess, its templates and translations,Tests/Unit/EditorAccessand the contract files) byte for byte; the CI jobEditor access parityruns it against the other line.Tests/Unit/ServiceContractTest.phpcompares the services Editor access calls withTests/Fixtures/service-contract.json, andServiceContractCoverageTestfails when Editor access calls a service method that is not in the contract (Build/ServiceContract.php).
The unit tests cover property value resolution and the handling of the dimensions argument (Tests/Unit/Service/DimensionSelectionTest.php) without a database:
bin/phpunit \ -c Build/BuildEssentials/PhpUnit/UnitTests.xml \ Packages/Application/UpAssist.Neos.Mcp/Tests/Unit
The dimension scenario Tests/Scenarios/dimensions.sh checks content dimensions end to end against a running bridge: it creates a page in the mcp workspace, creates a variant, changes, lists and removes it in several dimension combinations, and refuses to touch nodes that are only visible through a fallback. It needs two dimensions (language: en_US default and de; country: nl default and be) and never publishes, but it writes to the mcp workspace, so do not run it against a site with real content:
NEOS_MCP_URL=http://127.0.0.1:8080 NEOS_MCP_TOKEN=<token> bash Tests/Scenarios/dimensions.sh
License
MIT