Skip to content

Commit ecec0bf

Browse files
committed
Add comprehensive Strapi version compatibility and documentation
- Introduce detailed version differences between Strapi v4 and v5 - Add version-specific configuration support in server configuration - Remove deprecated connect prompt and related files - Enhance server capabilities with Strapi version metadata - Include extensive documentation on Strapi API interactions, best practices, and migration guidelines
1 parent 01eb889 commit ecec0bf

File tree

6 files changed

+402
-268
lines changed

6 files changed

+402
-268
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
/build
22
/node_modules
33
/.DS_Store
4+
5+
.memory-bank
6+
.cursor

README.md

Lines changed: 81 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ A Model Context Protocol server for interacting with Strapi CMS. This server ena
44

55
## Changelog
66

7+
### Version 2.2.0 - Security & Version Handling Update
8+
9+
- 🔒 Added strict write protection policy
10+
- 🔄 Enhanced version format support (5.\*, 4.1.5, v4, etc.)
11+
- 📚 Integrated documentation into server capabilities
12+
- 🚫 Removed connect prompt (now in capabilities)
13+
- ⚡ Improved error handling and validation
14+
- 🔍 Added version-specific differences guide
15+
- 📋 Enhanced server capabilities documentation
16+
717
### Version 2.1.0
818

919
- Improved compatibility with both Strapi v4 and v5
@@ -22,6 +32,9 @@ A Model Context Protocol server for interacting with Strapi CMS. This server ena
2232
- 🖼️ Image processing with format conversion
2333
- 🌐 Multiple server support
2434
- ✅ Automatic schema validation
35+
- 🔒 Write protection policy
36+
- 📚 Integrated documentation
37+
- 🔄 Version compatibility management
2538

2639
## Installation
2740

@@ -50,13 +63,24 @@ Create a configuration file at `~/.mcp/strapi-mcp-server.config.json`:
5063
{
5164
"myserver": {
5265
"api_url": "http://localhost:1337",
53-
"api_key": "your-jwt-token-from-strapi-admin"
66+
"api_key": "your-jwt-token-from-strapi-admin",
67+
"version": "5.*" // Optional: Specify Strapi version (e.g., "5.*", "4.1.5", "v4")
5468
}
5569
}
5670
```
5771

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

74+
### Version Configuration
75+
76+
The server now supports various version formats:
77+
78+
- Wildcard: "5._", "4._"
79+
- Specific: "4.1.5", "5.0.0"
80+
- Simple: "v4", "v5"
81+
82+
This helps the server provide version-specific guidance and handle API differences appropriately.
83+
6084
### Getting a JWT Token
6185

6286
1. Log in to your Strapi admin panel
@@ -69,6 +93,7 @@ You can configure multiple Strapi instances by adding them to this file.
6993

7094
```javascript
7195
strapi_list_servers();
96+
// Now includes version information and differences between v4 and v5
7297
```
7398

7499
### Content Types
@@ -79,15 +104,17 @@ strapi_get_content_types({
79104
server: "myserver",
80105
});
81106

82-
// Get components
107+
// Get components with pagination
83108
strapi_get_components({
84109
server: "myserver",
110+
page: 1,
111+
pageSize: 25,
85112
});
86113
```
87114

88115
### REST API
89116

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

92119
```javascript
93120
// Query content with filters
@@ -156,6 +183,41 @@ strapi_upload_media({
156183
});
157184
```
158185

186+
## Version Differences (v4 vs v5)
187+
188+
Key differences between Strapi versions that the server handles automatically:
189+
190+
### v4
191+
192+
- Uses numeric IDs
193+
- Nested attribute structure
194+
- Data wrapper in responses
195+
- Traditional REST patterns
196+
- External i18n plugin
197+
198+
### v5
199+
200+
- Document-based IDs
201+
- Flat data structure
202+
- Direct attribute access
203+
- Enhanced JWT security
204+
- Integrated i18n support
205+
- New Document Service API
206+
207+
## Security Features
208+
209+
### Write Protection Policy
210+
211+
The server implements a strict write protection policy:
212+
213+
- All write operations require explicit authorization
214+
- Protected operations include:
215+
- POST (Create)
216+
- PUT (Update)
217+
- DELETE
218+
- Media Upload
219+
- Each operation is logged and validated
220+
159221
## Best Practices
160222

161223
1. Always check schema first with `strapi_get_content_types`
@@ -166,6 +228,8 @@ strapi_upload_media({
166228
6. Always include the complete data object when updating
167229
7. Use filters to optimize query performance
168230
8. Leverage built-in schema validation
231+
9. Check version compatibility for your operations
232+
10. Follow the write protection policy guidelines
169233

170234
## REST API Tips
171235

@@ -246,28 +310,29 @@ Common issues and solutions:
246310
- Check endpoint plural/singular form
247311
- Verify content type exists
248312
- Ensure correct API URL
313+
- Check if using correct ID format (numeric vs document-based)
249314

250315
2. Authentication Issues
251316

252317
- Verify JWT token is valid
253318
- Check token permissions
254-
- Ensure server is properly configured in config file
319+
- Ensure token hasn't expired
255320

256-
3. Validation Errors
321+
3. Version-Related Issues
257322

258-
- Check required fields are provided
259-
- Verify data types match schema
260-
- Ensure related content exists
323+
- Verify version specification in config
324+
- Check data structure matches version
325+
- Review version differences documentation
261326

262-
4. Configuration Issues
263-
- Check if `~/.mcp/strapi-mcp-server.config.json` exists
264-
- Verify server name is correct
265-
- Ensure API URL and key are valid
266-
267-
## License
268-
269-
MIT License - see LICENSE file for details
327+
4. Write Protection Errors
328+
- Ensure operation is authorized
329+
- Check if operation is protected
330+
- Verify request follows security policy
270331

271332
## Contributing
272333

273334
Contributions are welcome! Please feel free to submit a Pull Request.
335+
336+
## License
337+
338+
MIT

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bschauer/strapi-mcp-server",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"description": "Model Context Protocol server implementation for Strapi CMS with improved v4/v5 compatibility",
55
"type": "module",
66
"bin": {

0 commit comments

Comments
 (0)