payload
This is a Model Context Protocol (MCP) server that enables AI assistants and tools to interact directly with your Payload CMS instance.
claude mcp add --transport stdio ohnicholas93-payload-mcp-server python -m payload_mcp_server \ --env PAYLOAD_MCP_TOKEN="Optional pre-generated JWT or API token" \ --env PAYLOAD_MCP_PASSWORD="Password for authentication (if required)" \ --env PAYLOAD_MCP_USERNAME="Username for authentication (if required)" \ --env PAYLOAD_MCP_LOG_LEVEL="Logging level (e.g., INFO, DEBUG)" \ --env PAYLOAD_MCP_SSL_VERIFY="SSL verification flag (true/false) for self-signed certs" \ --env PAYLOAD_MCP_PAYLOAD__BASE_URL="Base API URL of the Payload CMS (e.g., http://localhost:3000/api)"
How to use
Payload MCP Server provides a secure, authenticated bridge to your Payload CMS instance. It exposes tools to create, search, and update documents in any Payload collection, as well as read and modify Global documents with full localization and population support. The server handles authentication automatically, including JWT token refresh and optional interactive login flows. Clients (like Kilocode, VS Code MCP integrations, or your own tooling) can call the defined tools by specifying the appropriate input schemas (e.g., create_object, search_objects, update_object, get_global, update_global). Use these tools to perform common CMS operations from your AI-assisted workflows without direct manual API calls. The server is designed to be lightweight and configurable, with environment variables controlling the base URL, authentication, and logging, making it simple to integrate into development pipelines and local setups.
How to install
Prerequisites
- Python 3.8+
- A running Payload CMS instance (default base API URL: http://localhost:3000/api)
- A working MCP client (e.g., Kilocode in VS Code) capable of calling external commands
Installation steps
- Clone the repository and install the package (assuming you’re using the published package name after cloning):
git clone https://github.com/ohnicholas93/payload-mcp-server.git
cd payload-mcp-server
- Install Python dependencies (recommended for local development):
pip install -r requirements.txt
- Optional: install the package globally for easier access from any shell:
pip install .
This should expose the payload-mcp-server command in your PATH.
- Prepare configuration
cp .env.example .env
Edit .env as needed (e.g., set PAYLOAD_MCP_PAYLOAD__BASE_URL to your Payload API URL).
- Run the server
payload-mcp-server
Or run via Python module directly (useful in virtual environments):
p python -m payload_mcp_server
- Verify accessibility If the server starts successfully, you should see log lines indicating the MCP server is listening for tool calls at the configured base URL.
Additional notes
Tips and common considerations:
- Ensure your Payload CMS is reachable from the machine running the MCP server. If you’re using a remote Payload instance, set PAYLOAD_MCP_PAYLOAD__BASE_URL accordingly.
- The MCP tools support localization flags (locale) and population (populate) when needed. Use the provided JSON Schemas in the README to structure your tool calls.
- If you encounter authentication issues, verify that environment variables for tokens or credentials are correctly set and that any interactive login flows are accessible in your environment.
- For development, enable DEBUG logs by setting PAYLOAD_MCP_LOG_LEVEL=DEBUG to get more granular information about requests and errors.
- Keep your Payload CMS CORS and authentication requirements in mind; the MCP server handles token refresh, but the initial login flow may require browser-based authentication depending on your setup.
- When deploying, consider securing environment variables via your platform’s secret management and restricting network access to trusted clients.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP