Get the FREE Ultimate OpenClaw Setup Guide →

payloadcmsmcp

Payload CMS MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio disruption-hub-payloadcmsmcp npx -y payloadcms-mcp \
  --env SERVICE_ID="Your service identifier (optional alias)" \
  --env RAILWAY_TOKEN="Your Railway API token" \
  --env RAILWAY_SERVICE_ID="Your Railway service ID"

How to use

Payload CMS 3.0 MCP Server is a specialized Model Context Protocol server designed to assist in Payload CMS development. It provides code validation, template generation, and scaffolding capabilities tailored for Payload CMS 3.0 projects. You can use the server to validate collection, field, global, and config code; generate code templates for collections, fields, globals, access control, hooks, endpoints, plugins, blocks, and migrations; and scaffold entire Payload CMS projects with validated options to ensure consistency and best practices. In prompts, leverage tools like validate, generate_template, generate_collection, generate_field, scaffold_project, and mcp_query to interact with the server and produce ready-to-use code and project structures.

To use the MCP server in prompts, reference its tools by name and provide the necessary parameters. For example, ask the server to validate a Payload CMS collection definition with the validate tool, or request a scaffold_project template to generate a full Payload CMS project layout. The server also supports SQL-like queries via mcp_query to inspect Payload CMS structures and schemas, enabling you to validate relationships and configurations before implementing them in code.

How to install

Prerequisites:

  • Node.js 18+ installed on your machine
  • Access to a Railway account (recommended for deployment) and a Railway API token
  • Basic familiarity with Payload CMS 3.0 concepts

Installation steps:

  1. Install Node.js 18+ from https://nodejs.org/
  2. Install or prepare your environment to use npx (comes with npm)
  3. Install the MCP server package and configure your environment (example uses npx):
# Use npx to install and run the Payload CMS MCP server package (example package name)
npx -y payloadcms-mcp
  1. Configure environment variables if running locally or via Railway Cursor integration (see next step for Cursor). Common envs include RAILWAY_TOKEN, RAILWAY_SERVICE_ID, and SERVICE_ID placeholders provided by your deployment setup.
  2. If using Cursor with Railway, configure the MCP server entry in Cursor and set the command to a Railway run command as described in the README (e.g., railway run --service=YOUR_SERVICE_ID).

Notes:

  • The exact package name may differ in your environment; replace payloadcms-mcp with the official MCP server package name if provided by the project.
  • Ensure network access and proper permissions for the Railway service if you deploy remotely.

Additional notes

Tips and common considerations:

  • Set up the Railway service and token ahead of time if you plan to deploy the MCP server via Railway; this enables smooth Cursor integration.
  • Expose environment variables like RAILWAY_TOKEN and RAILWAY_SERVICE_ID securely in your deployment environment.
  • When using Cursor, ensure the transport type is set to Command and the command matches your deployment (e.g., railway run --service=YOUR_SERVICE_ID).
  • The MCP server supports tools such as validate, generate_template, generate_collection, generate_field, scaffold_project, and mcp_query. Use descriptive prompts to maximize the quality of generated code and scaffolds.
  • If you encounter validation errors, check the Payload CMS 3.0 syntax rules and ensure templates generated by generate_template align with your project’s configuration (collections, globals, and config files).
  • For debugging, run locally first to verify code generation and validation outputs before integrating with CI or deployment pipelines.

Related MCP Servers

Sponsor this space

Reach thousands of developers