feat(cms): upgrade Payload to 3.78.0 and set up MCP plugin#12
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
- Upgrade all @payloadcms packages from 3.74.0 to 3.78.0 (second latest stable) - Update Next.js from 16.2.0-canary.7 to 16.2.0-canary.98 for compatibility - Install and configure @payloadcms/plugin-mcp@3.78.0 for all non-system collections and globals - Fix type errors in access control files caused by PayloadMcpApiKey union type - Add MCP setup instructions to README.md for GitHub Copilot and Claude Code Co-authored-by: jhb-dev <20878653+jhb-dev@users.noreply.github.com>
jhb-dev
left a comment
There was a problem hiding this comment.
Ensure hat for collections with drafts enabled. The agent is only able to create new drafts but not published versions. Use acces control to achieve this.
Add a shared restrictMcpToDraft beforeChange hook that forces _status to 'draft' when the requesting user is an MCP API key. Apply it to all five draft-enabled collections: Articles, Pages, Authors, Projects, and Testimonials. Co-authored-by: jhb-dev <20878653+jhb-dev@users.noreply.github.com>
Done in 571408e. Added a shared Note: Payload's auto-generated |
PR Review: feat(cms): upgrade Payload to 3.78.0 and set up MCP pluginOverall the implementation is clean and well-structured. A few things to flag: Potential Bugs
The hook is described as targeting "collections with Globals have no draft-restriction protection
Silent status coercion
Security Concerns
Both collections are enabled with create/update/delete access for MCP agents:
Consider either disabling write operations for these collections, or enabling read-only ( Production MCP URL in README The README documents Minor
|
Upgrades Payload CMS to v3.78.0 (second latest stable) and wires up the
@payloadcms/plugin-mcpplugin so AI coding assistants can read and edit CMS content via MCP.Package upgrades
@payloadcms/*packages:3.74.0→3.78.0@payloadcms/plugin-mcp@3.78.0addednext:16.2.0-canary.7→16.2.0-canary.98(required by@payloadcms/next@3.78.0peer dep)MCP plugin configuration
All content collections and globals are enabled; system collections (
users,redirects) are excluded:Draft-only writes for MCP agents
For all collections with
versions.draftsenabled (Articles, Pages, Authors, Projects, Testimonials), MCP API key requests are restricted to draft-only writes via a sharedrestrictMcpToDraftbeforeChangehook. This prevents MCP agents from publishing content directly — any attempt to set_status: 'published'is silently coerced to'draft'.Type fix
The MCP plugin expands the
usertype toUser | PayloadMcpApiKey. All role-based access functions now guard withuser.collection === 'users'before accessinguser.rolesto satisfy the union type.README
Added MCP setup instructions for both GitHub Copilot (VS Code) and Claude Code, covering API key creation and client configuration against both local and production CMS URLs.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.