Strapi CMS

by misterboe

20 stars
2k downloads
Not rated
GitHub

About

Integrates Strapi CMS content into workflows, enabling manipulation of data for content management and querying in Strapi-powered applications.

Details

Author
misterboe
Repository
misterboe/strapi-mcp-server
GitHub stars
20
Downloads
2,015
License
MIT License
Categories
Productivity, Developer Tools, Design, AI, Media, Search, Infrastructure, API, Other
Tags
#web

- πŸ” Schema introspection
- πŸ”„ REST API support with validation
- πŸ“Έ Media upload handling
- πŸ” JWT authentication
- πŸ“ Content type management
- πŸ–ΌοΈ Image processing with format conversion
- 🌐 Multiple server support
- βœ… Automatic schema validation
- πŸ”’ Write protection policy
- πŸ“š Integrated documentation
- πŸ”„ Version compatibility management

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 -y
    • Argument 2 @bschauer/strapi-mcp-server@2.6.0

    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

The server now supports various version formats:

- Wildcard: "5._", "4._"
- Specific: "4.1.5", "5.0.0"
- Simple: "v4", "v5"

This helps the server provide version-specific guidance and handle API differences appropriately.

1. Log in to your Strapi admin panel
2. Create an API token with appropriate permissions
3. Add the token to your config file under the appropriate server name

strapi_list_servers

List all available servers with version information and differences between v4 and v5.

strapi_get_content_types

Get all content types from a specific server. Parameters: server (string).

strapi_get_components

Get components with pagination. Parameters: server (string), page (integer), pageSize (integer).

strapi_rest

Perform CRUD operations with built-in validation and version-specific handling. Parameters: server (string), endpoint (string), method (string), params (object).

strapi_upload_media

Upload image with automatic optimization. Parameters: server (string), url (string), format (string), quality (integer), metadata (object).

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "strapi cms": {
            "env": {},
            "args": [
                "-y",
                "@bschauer/strapi-mcp-server@2.6.0"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@bschauer/strapi-mcp-server@2.6.0"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@bschauer/strapi-mcp-server@2.6.0"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@bschauer/strapi-mcp-server@2.6.0"
    ],
    "command": "cmd"
}

Strapi MCP Server

A Model Context Protocol server for interacting with Strapi CMS. This server enables AI assistants to interact with your Strapi instance through a standardized interface, supporting content types and REST API operations.

<a href="https://glama.ai/mcp/servers/qfdkybxvkp">
Strapi Server MCP server
</a>

⚠️ IMPORTANT DISCLAIMER: This software has been developed with the assistance of AI technology. It is provided as-is and should NOT be used in production environments without thorough testing and validation. The code may contain errors, security vulnerabilities, or unexpected behavior. Use at your own risk for research, learning, or development purposes only.

Changelog

Version 2.6.0 - Enhanced Validation & Debugging Update

- πŸ”§ Implemented structured error handling with McpError and ErrorCode
- βœ… Added comprehensive Zod validation for runtime type safety
- πŸ“Š Integrated comprehensive logging system with request tracking
- πŸ› Added debug mode configuration with environment variables
- 🧹 Removed unused prompt handlers for cleaner codebase
- ⬆️ Updated all dependencies to latest versions
- πŸ“– Added DEBUGGING.md guide for development workflow
- πŸ›‘οΈ Enhanced security with better input validation
- πŸš€ Improved developer experience with detailed error messages

For complete version history, see CHANGELOG.md.

Features

- πŸ” Schema introspection
- πŸ”„ REST API support with validation
- πŸ“Έ Media upload handling
- πŸ” JWT authentication
- πŸ“ Content type management
- πŸ–ΌοΈ Image processing with format conversion
- 🌐 Multiple server support
- βœ… Automatic schema validation
- πŸ”’ Write protection policy
- πŸ“š Integrated documentation
- πŸ”„ Version compatibility management

Installation

You can use this server directly with npx in your Claude Desktop configuration:

{
  "mcpServers": {
    "strapi": {
      "command": "npx",
      "args": ["-y", "@bschauer/strapi-mcp-server@2.6.0"]
    }
  }
}

Configuration

Create a configuration file at ~/.mcp/strapi-mcp-server.config.json:

{
  "myserver": {
    "api_url": "http://localhost:1337",
    "api_key": "your-jwt-token-from-strapi-admin",
    "version": "5." // Optional: Specify Strapi version (e.g., "5.", "4.1.5", "v4")
  }
}

You can configure multiple Strapi instances by adding them to this file.

Version Configuration

The server now supports various version formats:

- Wildcard: "5._", "4._"
- Specific: "4.1.5", "5.0.0"
- Simple: "v4", "v5"

This helps the server provide version-specific guidance and handle API differences appropriately.

Getting a JWT Token

1. Log in to your Strapi admin panel
2. Create an API token with appropriate permissions
3. Add the token to your config file under the appropriate server name

Usage

List Available Servers

strapi_list_servers();
// Now includes version information and differences between v4 and v5

Content Types

// Get all content types from a specific server
strapi_get_content_types({
  server: "myserver",
});

// Get components with pagination
strapi_get_components({
server: "myserver",
page: 1,
pageSize: 25,
});

REST API

The REST API provides comprehensive CRUD operations with built-in validation and version-specific handling:

// Query content with filters
strapi_rest({
  server: "myserver",
  endpoint: "api/articles",
  method: "GET",
  params: {
    filters: {
      title: {
        $contains: "search term",
      },
    },
  },
});

// Create new content
strapi_rest({
server: "myserver",
endpoint: "api/articles",
method: "POST",
body: {
data: {
title: "New Article",
content: "Article content",
category: "news",
},
},
});

// Update content
strapi_rest({
server: "myserver",
endpoint: "api/articles/123",
method: "PUT",
body: {
data: {
title: "Updated Title",
content: "Updated content",
},
},
});

// Delete content
strapi_rest({
server: "myserver",
endpoint: "api/articles/123",
method: "DELETE",
});

Media Upload

// Upload image with automatic optimization
strapi_upload_media({
  server: "myserver",
  url: "https://example.com/image.jpg",
  format: "webp",
  quality: 80,
  metadata: {
    name: "My Image",
    caption: "Image Caption",
    alternativeText: "Alt Text",
  },
});

Version Differences (v4 vs v5)

Key differences between Strapi versions that the server handles automatically:

v4

- Uses numeric IDs
- Nested attribute structure
- Data wrapper in responses
- Traditional REST patterns
- External i18n plugin

v5

- Document-based IDs
- Flat data structure
- Direct attribute access
- Enhanced JWT security
- Integrated i18n support
- New Document Service API

Security Features

Write Protection Policy

The server implements a strict write protection policy:

- All write operations require explicit authorization
- Protected operations include:
- POST (Create)
- PUT (Update)
- DELETE
- Media Upload
- Each operation is logged and validated

Best Practices

1. Always check schema first with strapi_get_content_types
2. Use proper plural/singular forms for endpoints
3. Include error handling in your queries
4. Validate URLs before upload
5. Start with minimal queries and add population only when needed
6. Always include the complete data object when updating
7. Use filters to optimize query performance
8. Leverage built-in schema validation
9. Check version compatibility for your operations
10. Follow the write protection policy guidelines

REST API Tips

Filtering

```javascript
// Filter by field value

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.