# Payload CMS MCP

> Payload CMS MCP connects your AI agent directly to your headless content management system. Query collections, update documents, and manage global site settings using natural language commands against the Payload REST API.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** backend-framework, api-driven, content-modeling, rest-api, data-collections, web-development

## Description

Managing a large website’s content usually means juggling multiple admin dashboards just to make one small change. With this connector, you tell your agent what needs doing, and it handles the backend communication with your CMS. You can ask your agent to find all product listings that haven't been updated in six months, or maybe update the main site footer text across every page. It treats your content—the documents, the global settings, even user preferences—like a database you talk to. Because this MCP is hosted on Vinkius, you get access to reliable, structured actions for your CMS right from any of your preferred AI clients. You don't need to log into the backend; you just ask, and it executes the required API calls.

## Tools

### create_document
Generates and saves a brand new entry into any specified content collection.

### delete_document
Removes a specific document from a collection using its unique identifier.

### delete_preference
Deletes a user's stored site preference record.

### find_by_id
Retrieves the full data payload for one document when you know its exact ID.

### find_many
Searches and returns a list of multiple documents based on defined criteria or filters.

### get_global
Fetches the current configuration data for site-wide settings like headers or footers.

### get_preference
Retrieves a specific user's saved preference data by ID.

### update_document
Modifies the text, metadata, or other fields of an existing document in a collection.

### update_global
Changes site-wide settings for global configurations like navigation links or theme colors.

### update_preference
Updates a specific user's saved preference data in the system.

## Prompt Examples

**Prompt:** 
```
Find the last 3 documents in the 'posts' collection sorted by creation date.
```

**Response:** 
```
I've retrieved the 3 most recent posts from your collection. They include 'New Features in v3', 'Getting Started with MCP', and 'API Best Practices'. Would you like to see the full content of any of these?
```

**Prompt:** 
```
Update the document with ID 673c2 in the 'products' collection to set the price to 49.99.
```

**Response:** 
```
I have successfully updated the product (ID: 673c2). The price is now set to 49.99. Is there anything else you'd like to modify in this document?
```

**Prompt:** 
```
Get the current data for the 'header' global.
```

**Response:** 
```
I've fetched the 'header' global data. It currently contains the site logo URL, a navigation array with 5 links, and a 'sticky' setting set to true. Do you need to update any of these fields?
```

## Capabilities

### Retrieve specific content records
Find single documents or lists of documents across any collection using unique identifiers or complex search filters.

### Modify existing site data
Change the contents of a document, global setting, or user preference by providing a new payload structure.

### Remove obsolete records
Permanently delete documents, preferences, or other content types directly through an agent command.

## Use Cases

### Auditing outdated site copy
The product team needs to know which articles haven't been touched in 18 months. The agent uses find_many, filtering by last modified date, and returns a list of IDs and titles for review.

### Fixing the main footer text
The marketing team realizes the site footer copy is wrong. They ask the agent to update_global on the 'footer' setting, specifying the correct new text instantly.

### Testing a content migration
A developer needs to verify that 10 specific product documents exist in staging. Running find_by_id for each ID confirms existence and structure without manual API calls.

### Onboarding new users' defaults
The system automatically runs an agent command to update_preference, setting the default language and timezone for a newly registered user account.

## Benefits

- Speed up audits by using find_many to query large collections. Instead of building complex queries in the admin panel, you simply ask for 'all draft posts' and get a list immediately.
- Never lose track of global settings again. Use get_global and update_global to read or change site-wide elements like footers or header logos without opening the dedicated configuration page.
- Automate content drafting by using create_document to quickly populate new entries with structured data, bypassing manual form entry entirely.
- Maintain clean data hygiene. You can delete_document and delete_preference directly through your agent when an item is obsolete, ensuring your CMS remains accurate.
- Handle complex relationships easily. When searching for content, the system manages relationship depth so you get all necessary related items in one go.

## How It Works

The bottom line is that you skip the UI entirely; your content changes are managed via secure, conversational instructions.

1. Subscribe to this MCP and provide the base URL for your Payload CMS instance.
2. Optional: Supply API keys or authentication slugs if your site requires protected access.
3. Your AI agent uses these credentials to construct and execute structured API calls based on your natural language request.

## Frequently Asked Questions

**How does Payload CMS MCP handle complex searches?**
It handles complexity through advanced filtering. You can use tools like find_many to query collections using specific criteria, allowing you to filter by date range, status, or multiple metadata fields.

**Can I update global settings with Payload CMS MCP?**
Yes. The get_global and update_global tools allow you to read and modify site-wide configuration data, like the main footer text or navigation links, without touching the visual editor.

**What if I need to create multiple documents at once?**
You can ask your agent to run a sequence of create_document calls. It treats each request as a distinct operation and executes them sequentially for you.

**Is Payload CMS MCP only for published content?**
No. The tools allow modification across the entire payload, including draft documents in various collections that might not be live on the site yet.

**Does this MCP handle user accounts and passwords?**
No. This connector focuses strictly on content modeling (documents, globals) and user preferences stored within the CMS, not user authentication or password management.