@cavort-it-systems/wordpress-mcp
v1.0.0
Published
Lightweight WordPress MCP server - token-optimized REST API access
Downloads
88
Maintainers
Readme
wordpress-mcp
Lightweight WordPress MCP server for site management. 42 tools with token-optimized responses — REST API responses automatically slimmed from kilobytes to essentials.
Why This Server?
WordPress REST API returns extremely verbose JSON (~5-10KB per post). This server strips it down:
| Response | Before | After | Reduction |
|----------|--------|-------|-----------|
| wp_list_posts (10 posts) | ~50KB | ~2KB | 96% |
| wp_get_post | ~5KB | ~200 bytes | 96% |
| wp_list_plugins | ~15KB | ~800 bytes | 95% |
Less tokens = faster responses, lower costs, more context for your AI.
Installation
npm install -g @cavort-it-systems/wordpress-mcpOr run directly:
npx @cavort-it-systems/wordpress-mcpConfiguration
Claude Code CLI
claude mcp add wordpress \
-e WORDPRESS_SITE_URL=https://example.com \
-e WORDPRESS_USERNAME=admin \
-e WORDPRESS_PASSWORD="xxxx xxxx xxxx xxxx" \
-- npx @cavort-it-systems/wordpress-mcpClaude Desktop / Manual
Add to your MCP config (~/.claude.json or Claude Desktop settings):
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["@cavort-it-systems/wordpress-mcp"],
"env": {
"WORDPRESS_SITE_URL": "https://example.com",
"WORDPRESS_USERNAME": "admin",
"WORDPRESS_PASSWORD": "xxxx xxxx xxxx xxxx"
}
}
}
}From Source
git clone https://github.com/cvrt-jh/wordpress-mcp.git
cd wordpress-mcp
npm install && npm run buildAuthentication
Uses Application Passwords (WordPress 5.6+):
- Go to Users → Profile in WordPress admin
- Scroll to Application Passwords
- Create new password for "Claude MCP"
- Use the generated password (keep the spaces)
Response Slimming
All responses are automatically trimmed. Example:
wp_get_post — from ~5KB to ~200 bytes:
// Before (WordPress REST API raw)
{"id":123,"date":"2026-01-15T10:30:00","date_gmt":"2026-01-15T09:30:00",
"guid":{"rendered":"https://example.com/?p=123"},"modified":"2026-01-20T14:00:00",
"modified_gmt":"2026-01-20T13:00:00","slug":"my-post","status":"publish",
"type":"post","link":"https://example.com/my-post/","title":{"rendered":"My Post"},
"content":{"rendered":"<p>Full content...</p>","protected":false},
"excerpt":{"rendered":"<p>Excerpt...</p>","protected":false},
"author":1,"featured_media":456,"comment_status":"open","ping_status":"open",
"sticky":false,"template":"","format":"standard","meta":{"footnotes":""},
"categories":[1,5],"tags":[10,20],"class_list":["post-123","type-post",...],
"_links":{"self":[...],"collection":[...],"about":[...],...}}
// After (slimmed)
{"id":123,"title":"My Post","slug":"my-post","status":"publish",
"date":"2026-01-15T10:30:00","modified":"2026-01-20T14:00:00",
"link":"https://example.com/my-post/","excerpt":"Excerpt...",
"author":1,"categories":[1,5],"tags":[10,20],"featured_media":456}What gets stripped:
| Field | Where | Why |
|-------|-------|-----|
| guid, _links | everywhere | Internal WordPress data |
| content.rendered | lists | Only included when explicitly requested |
| meta, class_list | posts/pages | Theme/plugin metadata |
| ping_status, comment_status | posts | Rarely needed |
| template, format, sticky | posts | Theme-specific |
| HTML tags | excerpts | Clean text output |
| Pretty-print JSON | all | Compact single-line output |
Tools (42)
Site (4)
wp_site_info- Get site name, description, URLwp_get_settings- Get site settingswp_update_settings- Update site settingswp_get_namespaces- List REST API namespaces
Posts (6)
wp_list_posts- List posts with filterswp_get_post- Get single postwp_create_post- Create postwp_update_post- Update postwp_delete_post- Delete postwp_search_posts- Search posts
Pages (5)
wp_list_pages- List pageswp_get_page- Get single pagewp_create_page- Create pagewp_update_page- Update pagewp_delete_page- Delete page
Users (6)
wp_list_users- List userswp_me- Get current userwp_get_user- Get user by IDwp_create_user- Create userwp_update_user- Update userwp_delete_user- Delete user
Plugins (5)
wp_list_plugins- List pluginswp_get_plugin- Get plugin detailswp_activate_plugin- Activate pluginwp_deactivate_plugin- Deactivate pluginwp_delete_plugin- Delete plugin
Themes (4)
wp_list_themes- List themeswp_get_active_theme- Get active themewp_get_theme- Get theme detailswp_activate_theme- Switch themes
Media (4)
wp_list_media- List media librarywp_get_media- Get media itemwp_update_media- Update media metadatawp_delete_media- Delete media
Categories & Tags (8)
wp_list_categories- List categorieswp_create_category- Create categorywp_update_category- Update categorywp_delete_category- Delete categorywp_list_tags- List tagswp_create_tag- Create tagwp_update_tag- Update tagwp_delete_tag- Delete tag
Comments (6)
wp_list_comments- List commentswp_get_comment- Get commentwp_create_comment- Create commentwp_update_comment- Update/moderate commentwp_delete_comment- Delete commentwp_moderate_comments- Batch moderate
Architecture
src/
index.ts # Entry: McpServer + StdioServerTransport
client.ts # WordPress REST API client (Basic Auth)
types.ts # Shared Zod schemas + jsonResult helper
slim.ts # Response slimming transformers
tools/
site.ts # 4 tools
posts.ts # 6 tools
pages.ts # 5 tools
users.ts # 6 tools
plugins.ts # 5 tools
themes.ts # 4 tools
media.ts # 4 tools
taxonomies.ts # 8 tools (categories + tags)
comments.ts # 6 toolsMulti-Site Support
For managing multiple WordPress sites, run separate MCP instances:
{
"mcpServers": {
"wordpress-site1": {
"command": "npx",
"args": ["@cavort-it-systems/wordpress-mcp"],
"env": {
"WORDPRESS_SITE_URL": "https://site1.com",
"WORDPRESS_USERNAME": "admin",
"WORDPRESS_PASSWORD": "xxxx xxxx xxxx xxxx"
}
},
"wordpress-site2": {
"command": "npx",
"args": ["@cavort-it-systems/wordpress-mcp"],
"env": {
"WORDPRESS_SITE_URL": "https://site2.com",
"WORDPRESS_USERNAME": "admin",
"WORDPRESS_PASSWORD": "yyyy yyyy yyyy yyyy"
}
}
}
}License
MIT
