This is a Model Context Protocol (MCP) implementation for Strapi CMS, allowing AI assistants to interact with Strapi's REST API.
This MCP provides tools to interact with Strapi's REST API endpoints:
get_documents: Get a list of documents from a collection typeget_document: Get a single document from a collection type by IDcreate_document: Create a new document in a collection typeupdate_document: Update a document in a collection typedelete_document: Delete a document from a collection type
get_single_type: Get a single type contentupdate_single_type: Update a single type contentdelete_single_type: Delete a single type content
- Node.js (v16 or later)
- npm or yarn
- Clone this repository
- Install dependencies:
cd strapi-cms-mcp
npm install- Build the project:
npm run buildBefore running the MCP, you need to set the following environment variables:
STRAPI_API_TOKEN: Your Strapi API tokenSTRAPI_API_URL: The URL of your Strapi API (e.g.,http://localhost:1337)
You can create a .env file in the root directory with these variables:
STRAPI_API_TOKEN=your_api_token
STRAPI_API_URL=http://localhost:1337
To run the MCP:
npm startFor development with environment variables loaded from .env:
npm run dev{
"contentType": "restaurants",
"populate": "*",
"sort": "name:asc"
}{
"contentType": "restaurants",
"documentId": "znrlzntu9ei5onjvwfaalu2v",
"populate": "categories,image"
}{
"contentType": "restaurants",
"data": {
"Name": "New Restaurant",
"Description": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"text": "A description of the restaurant."
}
]
}
]
}
}{
"contentType": "restaurants",
"documentId": "znrlzntu9ei5onjvwfaalu2v",
"data": {
"Name": "Updated Restaurant Name"
}
}{
"contentType": "restaurants",
"documentId": "znrlzntu9ei5onjvwfaalu2v"
}{
"contentType": "homepage",
"populate": "*"
}{
"contentType": "homepage",
"data": {
"Title": "Updated Homepage Title",
"Description": "New homepage description"
}
}MIT