Strapi MCP Server
Strapi MCP サーバー
Strapi CMSと連携するためのモデルコンテキストプロトコルサーバー。このサーバーにより、AIアシスタントは標準化されたインターフェースを介してStrapiインスタンスと連携し、コンテンツタイプとREST API操作をサポートできるようになります。
⚠️重要な免責事項:本ソフトウェアはAI技術の支援を受けて開発されています。現状のまま提供されるため、十分なテストと検証を行わない限り、本番環境で使用しないでください。コードにはエラー、セキュリティ上の脆弱性、または予期しない動作が含まれている可能性があります。研究、学習、または開発目的に限り、自己責任でご使用ください。
変更履歴
バージョン 2.3.0 - ドキュメントと設定の強化
📚 CLAUDE.md に包括的なプロジェクトドキュメントを追加しました
⚙️ より優れたバージョン検出による構成オプションの拡張
🛠️ よくある問題に対する強化されたトラブルシューティングガイド
🔄 実用的な例を交えた詳細な REST API ドキュメント
📝 コンテンツ管理のベストプラクティスガイド
🐛 異なるフォーマットパターンからのバージョン解析を修正しました
🔍 バージョン固有のガイダンスによるエラーメッセージの改善
バージョン 2.2.0 - セキュリティとバージョン処理の更新
🔒 厳格な書き込み保護ポリシーを追加しました
🔄 強化されたバージョン形式のサポート (5.*、4.1.5、v4 など)
📚 サーバー機能にドキュメントを統合
🚫 接続プロンプトを削除しました(現在は機能内にあります)
⚡ エラー処理と検証の改善
🔍 バージョン固有の差異ガイドを追加しました
📋 サーバー機能のドキュメントの強化
バージョン2.1.0
Strapi v4とv5の両方との互換性が向上
バージョン間で異なるデータ構造をサポートするために自動検証を削除しました
バージョン固有のヒントを含むエラーメッセージの強化
リクエスト処理を簡素化し、クライアントにさらなる制御権を与える
両バージョンのわかりやすい例を記載したドキュメントを更新しました
Related MCP server: Directus MCP Server
特徴
🔍 スキーマイントロスペクション
🔄 検証機能付き REST API サポート
📸 メディアアップロードの処理
🔐 JWT認証
📝 コンテンツタイプの管理
🖼️ フォーマット変換による画像処理
🌐 複数サーバーのサポート
✅ 自動スキーマ検証
🔒 書き込み保護ポリシー
📚 統合されたドキュメント
🔄 バージョン互換性管理
インストール
Claude Desktop 構成で npx を使用してこのサーバーを直接使用できます。
{
"mcpServers": {
"strapi": {
"command": "npx",
"args": ["-y", "@bschauer/strapi-mcp-server@2.5.0"]
}
}
}構成
~/.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")
}
}このファイルに複数の Strapi インスタンスを追加して構成できます。
バージョン構成
サーバーは現在、さまざまなバージョン形式をサポートしています。
ワイルドカード: 「5. 」、「4. 」
具体的: 「4.1.5」、「5.0.0」
シンプル:「v4」、「v5」
これにより、サーバーはバージョン固有のガイダンスを提供し、API の違いを適切に処理できるようになります。
JWTトークンの取得
Strapi管理パネルにログイン
適切な権限を持つAPIトークンを作成する
適切なサーバー名の下の設定ファイルにトークンを追加します
使用法
利用可能なサーバーの一覧
strapi_list_servers();
// Now includes version information and differences between v4 and v5コンテンツタイプ
// 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
REST API は、組み込みの検証とバージョン固有の処理を備えた包括的な CRUD 操作を提供します。
// 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",
});メディアアップロード
// 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",
},
});バージョンの違い(v4とv5)
サーバーが自動的に処理する Strapi バージョン間の主な違い:
v4
数値IDを使用する
ネストされた属性構造
応答内のデータラッパー
従来のRESTパターン
外部i18nプラグイン
v5
ドキュメントベースのID
フラットなデータ構造
直接属性アクセス
強化されたJWTセキュリティ
統合されたi18nサポート
新しいドキュメントサービス API
セキュリティ機能
書き込み保護ポリシー
サーバーは厳格な書き込み保護ポリシーを実装しています。
すべての書き込み操作には明示的な承認が必要です
保護される操作には次のものが含まれます。
POST(作成)
PUT (更新)
消去
メディアアップロード
各操作はログに記録され、検証されます
ベストプラクティス
常にまずは
strapi_get_content_typesでスキーマをチェックするエンドポイントには適切な複数形/単数形を使用する
クエリにエラー処理を含める
アップロード前にURLを検証する
最小限のクエリから始めて、必要な場合にのみ人口を追加します
更新時には常に完全なデータオブジェクトを含める
フィルターを使用してクエリのパフォーマンスを最適化する
組み込みのスキーマ検証を活用する
操作のバージョン互換性を確認する
書き込み保護ポリシーのガイドラインに従う
REST APIのヒント
フィルタリング
// Filter by field value
params: {
filters: {
title: "Exact Match";
}
}
// Contains filter
params: {
filters: {
title: {
$contains: "partial";
}
}
}
// Multiple conditions
params: {
filters: {
$and: [{ category: "news" }, { published: true }];
}
}ソート
params: {
sort: ["createdAt:desc"];
}ページネーション
params: {
pagination: {
page: 1,
pageSize: 25
}
}人口
// Basic request without population
params: {
}
// Selective population when needed
params: {
populate: ["category"];
}
// Detailed population with field selection
params: {
populate: {
category: {
fields: ["name", "slug"];
}
}
}トラブルシューティング
よくある問題と解決策:
404エラー
エンドポイントの複数形/単数形を確認する
コンテンツタイプが存在することを確認する
正しいAPI URLを確認する
正しい ID 形式 (数値ベースとドキュメントベース) を使用しているかどうかを確認します
認証の問題
JWTトークンが有効であることを確認する
トークンの権限を確認する
トークンの有効期限が切れていないことを確認する
バージョン関連の問題
構成内のバージョン指定を確認する
データ構造がバージョンと一致しているかどうかを確認します
バージョンの違いに関するドキュメントを確認する
書き込み保護エラー
操作が承認されていることを確認する
操作が保護されているかどうかを確認する
リクエストがセキュリティポリシーに従っていることを確認する
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
ライセンス
マサチューセッツ工科大学
Available Tools
5 toolsstrapi_get_componentsA
Get all components from Strapi with pagination support. Returns both component data and pagination metadata (page, pageSize, total, pageCount).
Inputs: server (required), page, pageSize.
strapi_get_content_typesB
Get all content types from Strapi. Returns the complete schema of all content types.
Initialization Steps (ALWAYS DO FIRST)
Get schema and analyze with this tool
Capture Content Types and structures
Remember endpoint names (pluralName/singularName)
Document fields and types
Identify relations
Consider required fields and validations
Schema Conventions
singularName: Used for single item queries (e.g., "article")
pluralName: Used for collection endpoints (e.g., "articles")
collectionName: Database collection name
Endpoint Patterns
Collection: GET /api/{pluralName}
Single: GET /api/{pluralName}/{id}
Create: POST /api/{pluralName}
Update: PUT /api/{pluralName}/{id}
Delete: DELETE /api/{pluralName}/{id}
Inputs: server (required).
strapi_list_serversC
List all available Strapi servers from the configuration.
Security Policy
STRICT_USER_AUTHORIZATION_REQUIRED: No write operations without explicit user authorization. Protected operations: POST (Create), PUT (Update), DELETE (Delete), Media Upload. All write operations require userAuthorized: true parameter.
Strapi Version Support
Supports both Strapi v4 and v5 with automatic version detection.
Version Differences
v4: Numeric IDs, nested attributes under 'attributes', data wrapper in responses
v5: Document-based IDs (documentId), flat structure, direct attribute access
Common Errors
404: Using numeric ID instead of documentId, wrong plural/singular form
405: Incorrect endpoint (/article instead of /articles)
400: Missing data wrapper in request body
Best Practices
Always check schema first with strapi_get_content_types
Use documentId (not numeric id) for Strapi v5
Always use data wrapper for updates: { data: { field: value } }
Use pluralName for collection endpoints (api/articles)
Validate URLs with webtools before using them
Inputs: no named parameters.
strapi_restA
Execute REST API requests against Strapi endpoints. IMPORTANT: All write operations (POST, PUT, DELETE) require explicit user authorization via the userAuthorized parameter.
Reading Data
params: { populate: ['SEO'] } // Populate a component params: { populate: { SEO: { fields: ['Title', 'seoDescription'] } } } // With field selection params: { filters: { title: { $contains: 'search' } } } // Filter results params: { sort: ['createdAt:desc'] } // Sort results params: { pagination: { page: 1, pageSize: 10 } } // Pagination
Writing Data (REQUIRES userAuthorized: true)
body: { data: { componentName: { Title: 'value' }, // Single component componentName: [{ field: 'value' }] // Repeatable component } }
Debugging Guide
404 Error: Check plural/singular form, use documentId not numeric id
400 Error: Check if data wrapper is present in body
405 Error: Check endpoint format (/articles not /article)
URL Errors: Validate URLs with webtools first
ID Problems: Use documentId for Strapi v5
Strapi v5 Specifics
Use documentId instead of numeric id
Direct attribute access (no nested attributes)
No data wrapper in GET responses
Inputs: server (required), endpoint (required), body, method, +2 more.
strapi_upload_mediaA
Upload media to Strapi's media library from a URL with format conversion, quality control, and metadata options. IMPORTANT: This is a write operation that REQUIRES explicit user authorization via the userAuthorized parameter.
Upload Steps
Upload via strapi_upload_media with URL and metadata
Get image ID from response
Link to content using strapi_rest PUT request
Linking Images to Content (Strapi v5)
After upload, use PUT request to link: { "method": "PUT", "endpoint": "api/articles/{documentId}", "body": { "data": { "images": ["imageId"] } }, "userAuthorized": true }
Inputs: url (required), server (required), format, quality, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct function: schema introspection (components vs content types), server listing, generic REST execution, and media upload. No overlap in purposes.
Tools follow a strapi_verb_noun pattern mostly (get_components, get_content_types, list_servers, upload_media), but 'strapi_rest' deviates by using an acronym instead of a verb. Overall consistent.
5 tools is well-scoped for a Strapi MCP server, covering schema discovery, generic API access, media upload, and server management without superfluous tools.
The tool set provides schema introspection and a generic REST tool for all CRUD operations, plus media upload. Minor gap: no dedicated tool for content entry listing, but the REST tool covers it with schema guidance.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
The Telnyx MCP server is an official implementation of the Model Context Protocol that enables AI clients (like Claude Desktop, Cursor, and OpenAI Agents) to interact with Telnyx's telephony, messaging, and AI assistant APIs. It provides comprehensive capabilities including making and managing phone calls, sending SMS/MMS messages, purchasing and configuring phone numbers, creating AI assistants with custom instructions, managing cloud storage buckets, scraping and embedding website content, and handling integration secrets. The server exists as both a local implementation and a remotely hosted version, allowing developers to integrate real-world communication infrastructure directly into AI applications.
Related MCP Servers
- AlicenseAqualityFmaintenanceA Model Context Protocol server that enables AI assistants to interact with Confluence content, supporting operations like retrieving, searching, creating, and updating pages and spaces.98 npm12MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows AI tools to connect to and interact with your Directus API, enabling automated access to collections, items, and user data.17 npm27MIT
- AlicenseNot gradedqualityDmaintenanceA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.12 npm12MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI models with structured access to external data and services, acting as a bridge between AI assistants and applications, databases, and APIs in a standardized, secure way.2-