Payload CMS 3.0 MCP Server

A specialized MCP server for Payload CMS 3.0 that validates code, generates templates, and scaffolds projects following best practices.

Features

Enhance your Payload CMS 3.0 development with AI that understands the framework's architecture and best practices.

Code Validation

Validate Payload CMS code for collections, fields, globals, and config files with detailed feedback on syntax errors and best practices.

Code Generation

Generate code templates for collections, fields, globals, access control, hooks, endpoints, plugins, blocks, and migrations.

Project Scaffolding

Scaffold entire Payload CMS projects with validated options for consistency and adherence to best practices.

Payload CMS 3.0 Capabilities

AI-powered tools to help you build robust Payload CMS 3.0 applications following best practices.

Validation Tools

  • validate - Validate code for collections, fields, globals, and config
  • query - Query validation rules and best practices
  • mcp_query - Execute SQL-like queries for Payload CMS structures

Code Generation

  • generate_template - Generate code templates for various components
  • generate_collection - Create complete collection definitions
  • generate_field - Generate field definitions with proper typing

Project Setup

  • scaffold_project - Create entire Payload CMS project structures
  • validate_scaffold_options - Ensure scaffold options follow best practices

Payload CMS 3.0 AI Integration

Connect to the MCP server to build Payload CMS 3.0 applications with AI that validates code, generates templates, and follows best practices.

Cursor IDE Integration
Use the MCP server with Cursor IDE to validate Payload CMS 3.0 code, generate templates, and scaffold projects with AI assistance.
// In Cursor Settings > MCP Servers Name: "Payload CMS 3.0 MCP" Transport Type: "Command" // Option 1: After linking with Railway CLI Command: railway run // Option 2: Using API token and service ID Command: railway run --service=YOUR_SERVICE_ID
Example Commands
Once configured, you can use natural language to interact with the Payload CMS MCP Server.
  • "Validate this collection code for Payload CMS 3.0"
  • "Generate a template for a blog collection with title, content, and author fields"
  • "Query validation rules for access control in Payload CMS 3.0"
  • "Generate a field definition for an image field with validation"
Matmax Worldwide

MATMAX WORLDWIDE

Creating technology that helps humans be more human. We believe in tech for good—tools that enhance our lives while respecting our humanity.

Join us in building a future where technology serves wellness, connection, and purpose. Together, we can create digital experiences that bring out the best in us all.

Visit matmax.world

Getting Started

Follow these steps to set up and start using the Payload CMS MCP Server.

1

Prerequisites

Before you begin, make sure you have:

  • Node.js 18+ (required for Payload CMS 3.0)
  • npm or yarn package manager
  • An active Railway account (for Railway deployment)
  • A Railway API token (create one at railway.app/account/tokens)
  • Basic familiarity with Payload CMS 3.0 concepts
2

Installation Options

Option 1: Install from npm (Recommended)

# Install specific version globally npm install -g payload-cms-mcp@1.0.2 # Or install latest version npm install -g payload-cms-mcp # Run the server payload-cms-mcp

Option 2: Clone the repository

# Clone the repository git clone https://github.com/Matmax-Worldwide/payloadcmsmcp.git cd payloadcmsmcp # Install dependencies npm install # Run the development server npm run dev
3

Configure Cursor

To use with Cursor IDE:

  1. Open Cursor Settings
  2. Go to MCP Servers section
  3. Add a new MCP server
  4. Name it "Payload CMS 3.0 MCP"
  5. Set Transport Type to "Command"
  6. Set Command to one of the following options:
    • For Railway deployment: railway run (after linking with railway link)
    • For local installation: payload-cms-mcp (if installed via npm)
    • For local repository: npm run dev (in the repository directory)
  7. Save the configuration
4

Using the MCP Server

Once configured, you can use these tools in your AI prompts:

  • Code Validation: "Validate this Payload CMS collection code"
  • Template Generation: "Generate a template for a media collection"
  • Query Rules: "Query validation rules for access control"
  • SQL-like Queries: "Execute a query to find field types for collections"