# Payload CMS MCP for AI Agents AI Agent Connect

> Payload CMS MCP lets you manage your headless CMS content directly through your AI client. You can query collections, update entries, and inspect data structures without jumping back and forth between your code editor and the admin dashboard. It's built for anyone who needs to interact with a Payload CMS instance using natural language.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_F9KqScjp1H2LzRfZYwHeA6WirB5M3GIYHP3k8KOt/ai-agent-connect
- **Tags:** payload-cms, typescript, api-framework, database-management, content-api

## Description

This Payload CMS MCP lets you treat your headless content management system as a direct extension of your AI client. Instead of hunting through a web dashboard to find a specific entry or checking your schema files to see how a collection is structured, you just ask your agent to do it for you. It understands your TypeScript schema and can pull specific documents based on complex filters like status, dates, or custom fields. You can create new content, update existing records, and manage global settings while staying entirely within your preferred workspace. If you're tired of the context switching between your IDE and your CMS admin panel, this is the fix. It's one of the many tools available in the Vinkius catalog that turns your content database into a conversational interface. You get to focus on building and managing content while the agent handles the heavy lifting of querying and updating the database.

## Tools

### create_document
Create a new document in a collection. This adds new content to your headless CMS.

### delete_document
Delete a document. Use this to remove entries you no longer need.

### get_document
Get a single document by ID. This pulls the full JSON payload for a specific record.

### list_documents
List documents from a Payload CMS collection. It supports filtering, sorting, and pagination.

### login_user
Login a user to get an authentication token. This handles the initial handshake for your session.

### logout_user
Logout the current user. Use this to clear your session when you're done.

### refresh_token
Refresh authentication token. This keeps your session active without re-logging in.

### update_document
Update an existing document. It lets you change specific fields in your database records.

### update_global
Update global data. Use this to change site-wide configurations instantly.

### get_global
Fetch global data from your Payload CMS instance. It's useful for seeing site-wide settings.

### get_me
Get current authenticated user details. Use this to check your current session status.

## Prompt Examples

**Prompt:** 
```
Find all the blog posts that are currently in 'draft' status.
```

**Response:** 
```
I've checked your 'posts' collection. I found 12 documents currently marked as drafts. Would you like me to list them for you or show you the details of a specific one?
```

**Prompt:** 
```
What is the current site name and logo URL in our global settings?
```

**Response:** 
```
I've pulled the global settings for you:

- **Site Name**: My Awesome Store
- **Logo URL**: `https://cdn.example.com/logo.png`
- **Maintenance Mode**: Off
```

**Prompt:** 
```
Update the price of the 'Blue Widget' to $19.99.
```

**Response:** 
```
I've updated the price for the 'Blue Widget' in your products collection. It's now set to $19.99. Is there anything else you'd like to change?
```

## Capabilities

### Filter and find content
Use complex queries to pull specific documents from any collection.

### Create new entries
Add new content to your headless CMS using natural language commands.

### Update existing records
Modify specific fields in your database without opening a web form.

### Manage global settings
Retrieve and change site-wide configurations and environment variables.

### Audit data structures
Inspect the full JSON payload of any document to verify your schema.

### Handle user sessions
Login, logout, and refresh authentication tokens through your agent.

## Use Cases

### Bulk updating product prices
A content manager needs to update the price for 50 different products. They ask the agent to find all items in a specific category and apply the new price using update_document.

### Verifying data structures for frontend dev
A developer needs to see the JSON structure of a user profile to write a component. They use get_document to pull the full payload for a test user.

### Auditing environment configurations
A DevOps engineer needs to check the site settings across three different environments. They ask the agent to run get_global for each instance to compare the values.

### Checking for duplicate slugs
You're creating a new blog post and need to see if a specific slug is taken. You use list_documents with a filter to check for duplicates before you hit publish.

## Benefits

- Stop jumping between tabs by using get_document to see content details right where you're already working.
- Update multiple records faster with update_document instead of clicking through every single field in a web form.
- Query your database using complex filters with list_documents to find exactly what you need in seconds.
- Manage site-wide settings instantly using update_global to avoid hunting for configuration files.
- Verify your TypeScript schema and data models with get_global to ensure your AI agent understands your content structure.
- Handle authentication tasks like login_user and refresh_token to keep your agent connected to your private data.

## How It Works

The bottom line is you get a conversational interface for your headless CMS content.

1. Subscribe to the Connector and grab your instance URL and API key.
2. Add your credentials to your AI client's configuration.
3. Start asking your agent to query, create, or update your Payload CMS content.

## Frequently Asked Questions

**Can the Payload CMS MCP help me update my content without a browser?**
Yes, it lets you perform updates directly through your AI client. You can ask your agent to change fields, create new entries, or delete old ones using natural language.

**Does the Payload CMS MCP work with my existing TypeScript schema?**
Yes, it's designed to understand your specific data model. It uses your schema to ensure that any content it creates or updates follows your defined rules.

**How does the Payload CMS MCP handle my login credentials?**
You provide your instance URL and API key during setup. The Connector uses these to handle authentication, including logging in and refreshing your session tokens.

**Can I use the Payload CMS MCP to find specific documents using filters?**
Yes, you can ask for documents based on specific criteria like status, category, or custom dates. It handles the complex querying for you.

**Is the Payload CMS MCP safe for my production data?**
It uses your existing API keys to interact with your instance. It follows the same permissions as your admin panel, so it only does what your API allows.

**Can I use the Payload CMS MCP to see my global settings?**
Yes, it can retrieve and update global data. This is great for checking site-wide configurations like SEO meta tags or environment variables.

**How can I see all the available content types in my Payload instance?**
You can use the `list_collections` tool. Your agent will query your Payload instance and return a list of all registered collections and globals, helping you understand what data is available to interact with.

**Is it possible to search for documents with specific criteria, like a slug or status?**
Yes! Use the `find_documents` tool. You can provide a collection name and filter parameters (e.g., `where[slug][equals]=my-post`). The agent will return the matching documents including their full metadata.

**Can I retrieve the full data of a single document if I have its ID?**
Absolutely. Use the `get_document` tool by providing the collection name and the unique Document ID. This is perfect for inspecting deep nested relationships or specific field values.