
Payload CMS
Provides code validation, template generation, and project scaffolding for Payload CMS 3.0 development. Helps developers build CMS applications following best practices with integrated Redis persistence.
Provides validation, query, and code generation services for Payload CMS 3.0 development, enabling developers to validate collections, execute SQL-like queries against validation rules, and scaffold complete projects with Redis integration for persistence.
What it does
- Validate Payload CMS collections and configuration files
- Generate code templates for collections, fields, and globals
- Scaffold complete Payload CMS projects
- Execute SQL-like queries against validation rules
- Create access control and hook templates
- Generate plugin and migration code
Best for
About Payload CMS
Payload CMS is a community-built MCP server published by disruption-hub that provides AI assistants with tools and capabilities via the Model Context Protocol. Boost Payload CMS 3.0 development with validation, querying, and Redis-integrated code generation for efficient project It is categorized under productivity, developer tools.
How to install
You can install Payload CMS in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
Payload CMS is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
π Payload CMS 3.0 MCP Server
A specialized MCP server for Payload CMS 3.0
Validate code, generate templates, and scaffold projects following best practices
π Overview
The Payload CMS 3.0 MCP Server is a specialized Model Context Protocol server designed to enhance your Payload CMS development experience. It helps developers build better Payload CMS applications by providing code validation, template generation, and project scaffolding capabilities that follow best practices.
β¨ Features
πCode ValidationValidate Payload CMS code for collections, fields, globals, and config files with detailed feedback on syntax errors and best practices. |
πCode GenerationGenerate code templates for collections, fields, globals, access control, hooks, endpoints, plugins, blocks, and migrations. |
πProject ScaffoldingScaffold entire Payload CMS projects with validated options for consistency and adherence to best practices. |
π§ Payload CMS 3.0 Capabilities
Validation Tools
validate- Validate code for collections, fields, globals, and configquery- Query validation rules and best practicesmcp_query- Execute SQL-like queries for Payload CMS structures
Code Generation
generate_template- Generate code templates for various componentsgenerate_collection- Create complete collection definitionsgenerate_field- Generate field definitions with proper typing
Project Setup
scaffold_project- Create entire Payload CMS project structuresvalidate_scaffold_options- Ensure scaffold options follow best practices (used internally by scaffold_project)
π Detailed Tool Reference
Validation Tools
validate
Validates Payload CMS code for syntax and best practices.
Parameters:
code(string): The code to validatefileType(enum): Type of file - "collection", "field", "global", or "config"
Example Prompt:
Can you validate this Payload CMS collection code?
```typescript
export const Posts = {
slug: 'posts',
fields: [
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'content',
type: 'richText',
}
],
admin: {
useAsTitle: 'title',
}
}
query
Queries validation rules and best practices for Payload CMS.
Parameters:
query(string): The query stringfileType(optional enum): Type of file - "collection", "field", "global", or "config"
Example Prompt:
What are the best practices for implementing access control in Payload CMS collections?
mcp_query
Executes SQL-like queries against Payload CMS structures.
Parameters:
sql(string): SQL-like query string
Example Prompt:
Can you execute this query to find all valid field types in Payload CMS?
SELECT field_types FROM payload_schema WHERE version = '3.0'
Code Generation
generate_template
Generates code templates for various Payload CMS components.
Parameters:
templateType(enum): Type of template - "collection", "field", "global", "config", "access-control", "hook", "endpoint", "plugin", "block", "migration"options(record): Configuration options for the template
Example Prompt:
Generate a template for a Payload CMS hook that logs when a document is created.
generate_collection
Generates a complete Payload CMS collection definition.
Parameters:
slug(string): Collection slugfields(optional array): Array of field objectsauth(optional boolean): Whether this is an auth collectiontimestamps(optional boolean): Whether to include timestampsadmin(optional object): Admin panel configurationhooks(optional boolean): Whether to include hooksaccess(optional boolean): Whether to include access controlversions(optional boolean): Whether to enable versioning
Example Prompt:
Generate a Payload CMS collection for a blog with title, content, author, and published date fields. Include timestamps and versioning.
generate_field
Generates a Payload CMS field definition.
Parameters:
name(string): Field nametype(string): Field typerequired(optional boolean): Whether the field is requiredunique(optional boolean): Whether the field should be uniquelocalized(optional boolean): Whether the field should be localizedaccess(optional boolean): Whether to include access controladmin(optional object): Admin panel configurationvalidation(optional boolean): Whether to include validationdefaultValue(optional any): Default value for the field
Example Prompt:
Generate a Payload CMS image field with validation that requires alt text and has a description in the admin panel.
Project Setup
scaffold_project
Scaffolds a complete Payload CMS project structure.
Parameters:
projectName(string): Name of the projectdescription(optional string): Project descriptionserverUrl(optional string): Server URLdatabase(optional enum): Database type - "mongodb" or "postgres"auth(optional boolean): Whether to include authenticationadmin(optional object): Admin panel configurationcollections(optional array): Array of collection objectsglobals(optional array): Array of global objectsblocks(optional array): Array of block objectsplugins(optional array): Array of plugin stringstypescript(optional boolean): Whether to use TypeScript
Example Prompt:
Scaffold a Payload CMS project called "blog-platform" with MongoDB, authentication, and collections for posts, categories, and users. Include a global for site settings.
π Getting Started
1. Prerequisites
Before you begin, make sure you have:
- Node.js 18+ (required for Payload CMS 3.0)
- An active Railway account
- A Railway API token (create one at railway.app/account/tokens)
- Basic familiarity with Payload CMS 3.0 concepts
2. Configure Cursor
To use with Cursor IDE:
- Open Cursor Settings
- Go to MCP Servers section
- Add a new MCP server
- Name it "Payload CMS 3.0 MCP"
- Set Transport Type to "Command"
- Set Command to:
railway run --service=YOUR_SERVICE_ID - Save the configuration
3. 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"
4. Example Workflow
A typical workflow with the Payload CMS MCP Server:
- Generate a collection template with specific fields
- Validate the generated code for best practices
- Query for specific validation rules to improve the code
- Generate additional components like hooks or endpoints
- Scaffold a complete project structure when ready
5. Complete Workflow Example
Here's a complete example of how you might use the MCP server in a conversation:
User: I need to create a Payload CMS collection for a product catalog.
AI: I'll help you create a product catalog collection. Let me generate a template for you.
[Uses generate_collection tool]
Here's a collection template for your product catalog:
```typescript
import { CollectionConfig } from 'payload/types';
export const Products: CollectionConfig = {
slug: 'products',
admin: {
useAsTitle: 'name',
defaultColumns: ['name', 'price', 'category', 'inStock'],
group: 'Shop',
},
access: {
read: () => true,
},
fields: [
{
name: 'name',
type: 'text',
required: true,
},
{
name: 'description',
type: 'richText',
},
{
name: 'price',
type: 'number',
required: true,
},
{
name: 'category',
type: 'relationship',
relationTo: 'categories',
required: true,
},
{
name: 'images',
type: 'array',
fields: [
{
name: 'image',
type: 'upload',
relationTo: 'media',
required: true,
},
{
name: 'altText',
type: 'text',
required: true,
}
]
},
{
name: 'inStock',
type: 'checkbox',
defaultValue: true,
},
],
timestamps: true,
}
User: Can you validate this code to make sure it follows best practices?
AI: I'll validate the code for you.
[Uses validate tool]
The validation results show that your code is valid and follows best practices. Here are a few suggestions:
- Consider adding a maxDepth to your category relationship field to prevent deep queries
- You might want to add access control for create, update, and delete operations
README truncated. View full README on GitHub.
Alternatives
Related Skills
Browse all skillsUse when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
Leveraging AI coding assistants and tools to boost development productivity, while maintaining oversight to ensure quality results.
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.
Creates educational Teams channel posts for internal knowledge sharing about Claude Code features, tools, and best practices. Applies when writing posts, announcements, or documentation to teach colleagues effective Claude Code usage, announce new features, share productivity tips, or document lessons learned. Provides templates, writing guidelines, and structured approaches emphasizing concrete examples, underlying principles, and connections to best practices like context engineering. Activates for content involving Teams posts, channel announcements, feature documentation, or tip sharing.