Strapi CMS

by l33tdawg

20 2k downloads Not rated yet MIT

About

Integrates with Strapi CMS to enable creating, reading, updating, and deleting content entries with support for filtering, pagination, sorting, and media uploads through URI-based resource patterns.

Details

Repository
l33tdawg/strapi-mcp
License
MIT

Explore

- List and read content types
- Get, create, update, and delete entries
- Upload media files
- Connect and disconnect relations
- Get content type schemas

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Strapi CMS
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 strapi-mcp
    Environment
    • STRAPI_URL http://localhost:1337
    • STRAPI_ADMIN_EMAIL [email protected]
    • STRAPI_ADMIN_PASSWORD your_admin_password

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Recommended Method (using Cursor MCP Configuration):

For Cursor users, configure the strapi-mcp server in your ~/.cursor/mcp.json file:

"strapi-mcp": {
  "command": "npx",
  "args": ["strapi-mcp"], 
  "env": {
    "STRAPI_URL": "http://localhost:1337",
    "STRAPI_ADMIN_EMAIL": "[email protected]",
    "STRAPI_ADMIN_PASSWORD": "your_admin_password"
  }
}

If you installed from source, use the direct path instead:

"strapi-mcp": {
"command": "node",
"args": ["/path/to/strapi-mcp/build/index.js"],
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_ADMIN_EMAIL": "[email protected]",
"STRAPI_ADMIN_PASSWORD": "your_admin_password"
}
}

Cursor will manage the server lifecycle automatically when strapi-mcp tools are used.

Alternative Method (using .env file):

Make sure you have built the project (npm run build). Then run the server using Node.js v20.6.0+ with the --env-file flag:

node --env-file=.env build/index.js


Alternative (using environment variables directly):

export STRAPI_URL=http://localhost:1337
export [email protected]
export STRAPI_ADMIN_PASSWORD=your_admin_password

It's recommended to use a .env file in the project root to store your credentials.

- STRAPI_URL: The URL of your Strapi instance (default: http://localhost:1337)
- STRAPI_ADMIN_EMAIL: The email address for a Strapi admin user (Recommended for full functionality, especially schema access).
- STRAPI_ADMIN_PASSWORD: The password for the Strapi admin user (Recommended).
- STRAPI_API_TOKEN: (Optional Fallback) An API token. Can be used if admin credentials are not provided, but may have limited permissions.
- STRAPI_DEV_MODE: Set to "true" to enable development mode features (defaults to false).

Example .env file:

dotenv
STRAPI_URL=http://localhost:1337
[email protected]
STRAPI_ADMIN_PASSWORD=your_admin_password

npm install strapi-mcp

For the latest development features:

git clone https://github.com/l33tdawg/strapi-mcp.git
cd strapi-mcp
npm install
npm run build

strapi-mcp

The server prioritizes authentication methods in this order:
1. Admin Email & Password (STRAPI_ADMIN_EMAIL, STRAPI_ADMIN_PASSWORD)
2. API Token (STRAPI_API_TOKEN)

It's strongly recommended to use Admin Credentials for the best results.

- Admin Credentials: Use the email and password of an existing Super Admin or create a dedicated admin user in your Strapi admin panel (Settings > Administration Panel > Users).
- API Token: (Optional Fallback)

1. Log in to your Strapi admin panel
2. Go to Settings > API Tokens
3. Click "Create new API Token"
4. Set a name, description, and token type (preferably "Full access")
5. Copy the generated token and use it in your MCP server configuration

Cannot connect to Strapi instance: Authentication failed. Check your API token or admin credentials.
Solution: - Verify your API token has proper permissions (preferably "Full access") - Check admin email/password are correct - Ensure the admin user exists and is active

list_content_types

List all available content types in Strapi.

get_entries

Get entries for a specific content type with optional filtering, pagination, sorting, and population of relations.

get_entry

Get a specific entry by ID.

create_entry

Create a new entry for a content type.

update_entry

Update an existing entry.

delete_entry

Delete an entry.

upload_media

Upload a media file to Strapi (max ~750KB file due to base64 context limits).

upload_media_from_path

Upload a media file from local file path (max 10MB, avoids context overflow).

get_content_type_schema

Get the schema (fields, types, relations) for a specific content type.

connect_relation

Connect related entries to an entry's relation field.

disconnect_relation

Disconnect related entries from an entry's relation field.

create_content_type

Create a new content type using the Content-Type Builder API (Requires Admin privileges).

publish_entry

Publish a specific entry.

unpublish_entry

Unpublish a specific entry.

list_components

List all available components in Strapi.

get_component_schema

Get the schema for a specific component.

create_component

Create a new component.

update_component

Update an existing component.

- list_content_types - List all available content types in Strapi
- get_entries - Get entries for a specific content type with optional filtering, pagination, sorting, and population of relations
- get_entry - Get a specific entry by ID
- create_entry - Create a new entry for a content type
- update_entry - Update an existing entry
- delete_entry - Delete an entry
- upload_media - Upload a media file to Strapi (max ~750KB file due to base64 context limits)
- upload_media_from_path - Upload a media file from local file path (max 10MB, avoids context overflow)
- get_content_type_schema - Get the schema (fields, types, relations) for a specific content type.
- connect_relation - Connect related entries to an entry's relation field.
- disconnect_relation - Disconnect related entries from an entry's relation field.
- create_content_type - Create a new content type using the Content-Type Builder API (Requires Admin privileges).
- publish_entry - Publish a specific entry.
- unpublish_entry - Unpublish a specific entry.
- list_components - List all available components in Strapi.
- get_component_schema - Get the schema for a specific component.
- create_component - Create a new component.
- update_component - Update an existing component.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "strapi cms": {
            "env": {
                "STRAPI_URL": "http://localhost:1337",
                "STRAPI_ADMIN_EMAIL": "[email protected]",
                "STRAPI_ADMIN_PASSWORD": "your_admin_password"
            },
            "args": [
                "strapi-mcp"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": {
        "STRAPI_URL": "http://localhost:1337",
        "STRAPI_ADMIN_EMAIL": "[email protected]",
        "STRAPI_ADMIN_PASSWORD": "your_admin_password"
    },
    "args": [
        "strapi-mcp"
    ],
    "command": "npx"
}

Macos

{
    "env": {
        "STRAPI_URL": "http://localhost:1337",
        "STRAPI_ADMIN_EMAIL": "[email protected]",
        "STRAPI_ADMIN_PASSWORD": "your_admin_password"
    },
    "args": [
        "strapi-mcp"
    ],
    "command": "npx"
}

Windows

{
    "env": {
        "STRAPI_URL": "http://localhost:1337",
        "STRAPI_ADMIN_EMAIL": "[email protected]",
        "STRAPI_ADMIN_PASSWORD": "your_admin_password"
    },
    "args": [
        "/c",
        "npx",
        "strapi-mcp"
    ],
    "command": "cmd"
}

strapi-mcp MCP Server

An MCP server for your Strapi CMS

This is a TypeScript-based MCP server that integrates with Strapi CMS. It provides access to Strapi content types and entries through the MCP protocol, allowing you to:

- Access Strapi content types as resources
- Create, read, update, and delete content entries
- Manage your Strapi content through MCP tools

Features

Resources

- List and access content types via strapi://content-type/ URIs - Each content type exposes its entries as JSON - Application/JSON mime type for structured content access

Tools

- list_content_types - List all available content types in Strapi - get_entries - Get entries for a specific content type with optional filtering, pagination, sorting, and population of relations - get_entry - Get a specific entry by ID - create_entry - Create a new entry for a content type - update_entry - Update an existing entry - delete_entry - Delete an entry - upload_media - Upload a media file to Strapi (max ~750KB file due to base64 context limits) - upload_media_from_path - Upload a media file from local file path (max 10MB, avoids context overflow) - get_content_type_schema - Get the schema (fields, types, relations) for a specific content type. - connect_relation - Connect related entries to an entry's relation field. - disconnect_relation - Disconnect related entries from an entry's relation field. - create_content_type - Create a new content type using the Content-Type Builder API (Requires Admin privileges). - publish_entry - Publish a specific entry. - unpublish_entry - Unpublish a specific entry. - list_components - List all available components in Strapi. - get_component_schema - Get the schema for a specific component. - create_component - Create a new component. - update_component - Update an existing component. ### Advanced Features
Filtering, Pagination, and Sorting
The get_entries tool supports advanced query options:
{
  "contentType": "api::article.article",
  "filters": {
    "title": {
      "$contains": "hello"
    }
  },
  "pagination": {
    "page": 1,
    "pageSize": 10
  },
  "sort": ["title:asc", "createdAt:desc"],
  "populate": ["author", "categories"]
}
Resource URIs
Resources can be accessed with various URI formats: - strapi://content-type/api::article.article - Get all articles - strapi://content-type/api::article.article/1 - Get article with ID 1 - strapi://content-type/api::article.article?filters={"title":{"$contains":"hello"}} - Get filtered articles

Publishing and Unpublishing Content

The publish_entry and unpublish_entry tools provide control over the content lifecycle:

{
  "contentType": "api::article.article",
  "id": "1"
}

These tools utilize the admin API paths for publishing/unpublishing actions, with a fallback to directly updating the publishedAt field if admin permissions are not available.

Component Management

Strapi components can be managed with the following tools:

- list_components: Get all available components
- get_component_schema: View a specific component's structure
- create_component: Create a new component with specified fields
- update_component: Modify an existing component

Example of creating a component:

{
  "componentData": {
    "displayName": "Security Settings",
    "category": "security",
    "icon": "shield",
    "attributes": {
      "enableTwoFactor": {
        "type": "boolean", 
        "default": false
      },
      "passwordExpiration": {
        "type": "integer",
        "min": 0
      }
    }
  }
}

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

For detailed step-by-step instructions on how to deploy and test this MCP server, please see the DEPLOYMENT.md file.

Quick setup:

1. Build the server: npm run build
2. Configure your Strapi instance and get an API token
3. Add the server config to Claude Desktop:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "strapi-mcp": {
      "command": "npx",
      "args": ["strapi-mcp"],
      "env": {
        "STRAPI_URL": "http://localhost:1337",
        "STRAPI_ADMIN_EMAIL": "[email protected]",
        "STRAPI_ADMIN_PASSWORD": "your_admin_password"
      }
    }
  }
}

If you installed from source, use the direct path:

{
"mcpServers": {
"strapi-mcp": {
"command": "/path/to/strapi-mcp/build/index.js",
"env": {
"STRAPI_URL": "http://localhost:1337",
"STRAPI_ADMIN_EMAIL": "[email protected]",
"STRAPI_ADMIN_PASSWORD": "your_admin_password"
}
}
}
}

Environment Variables

- STRAPI_URL (optional): The URL of your Strapi instance (defaults to http://localhost:1337)
- STRAPI_ADMIN_EMAIL & STRAPI_ADMIN_PASSWORD (Recommended): Credentials for a Strapi admin user. Required for full functionality like fetching content type schemas.
- STRAPI_API_TOKEN (Optional Fallback): Your Strapi API token. Can be used if admin credentials are not provided, but functionality might be limited based on token permissions.
- STRAPI_DEV_MODE (optional): Set to "true" to enable development mode features (defaults to false)

### Authentication Priority

The server prioritizes authentication methods in this order:
1. Admin Email & Password (STRAPI_ADMIN_EMAIL, STRAPI_ADMIN_PASSWORD)
2. API Token (STRAPI_API_TOKEN)

It's strongly recommended to use Admin Credentials for the best results.

### Getting Strapi Credentials

- Admin Credentials: Use the email and password of an existing Super Admin or create a dedicated admin user in your Strapi admin panel (Settings > Administration Panel > Users).
- API Token: (Optional Fallback)

1. Log in to your Strapi admin panel
2. Go to Settings > API Tokens
3. Click "Create new API Token"
4. Set a name, description, and token type (preferably "Full access")
5. Copy the generated token and use it in your MCP server configuration

Troubleshooting

Common Issues and Solutions:

1. Placeholder API Token Error
[Error] STRAPI_API_TOKEN appears to be a placeholder value...
Solution: Replace "strapi_token" or "your-api-token-here" with a real API token from your Strapi admin panel.
2. Connection Refused Error
Cannot connect to Strapi instance: Connection refused. Is Strapi running at http://localhost:1337?
Solution: - Ensure Strapi is running: npm run develop or yarn develop - Check if the URL in STRAPI_URL is correct - Verify your database (MySQL/PostgreSQL) is running
3. Authentication Failed
Cannot connect to Strapi instance: Authentication failed. Check your API token or admin credentials.
Solution: - Verify your API token has proper permissions (preferably "Full access") - Check admin email/password are correct - Ensure the admin user exists and is active
4. Context Window Overflow with File Uploads
```
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about Strapi CMS

Relevant YouTube tutorials, setups, and demos