MCP WordPress CrunchTools
MCP WordPress CrunchTools
一个用于 WordPress 内容管理的安全 MCP(模型上下文协议)服务器。专为发布其工作内容的开发者设计。
概述
该 MCP 服务器设计为:
默认安全 - 全面的输入验证、凭据保护和 SSRF 防护
无第三方服务 - 通过 stdio 在本地运行,您的凭据永远不会离开您的机器
跨平台 - 支持 Linux、macOS 和 Windows
自动更新 - GitHub Actions 监控 CVE 并更新依赖
容器化 - 可在
quay.io/crunchtools/mcp-wordpress获取
Related MCP server: TypeScript WordPress MCP Server
命名约定
组件 | 名称 |
GitHub 仓库 | |
容器 |
|
Python 包(PyPI) |
|
CLI 命令 |
|
模块导入 |
|
功能特性
30 个工具,用于文章、页面、媒体和评论
安全优先:凭据保护、输入验证、SSRF 防护
开发者工作流:定时发布、修订版本、搜索
易于集成:兼容 Claude Code 和其他 MCP 客户端
安装
使用 uvx(推荐)
uvx mcp-wordpress-crunchtools使用 pip
pip install mcp-wordpress-crunchtools
mcp-wordpress-crunchtools使用容器
# Create a shared upload directory (required before first run)
mkdir -p ~/.local/share/mcp-uploads-downloads
podman run -v ~/.local/share/mcp-uploads-downloads:/tmp/mcp-uploads:z \
-e WORDPRESS_URL=https://example.com \
-e WORDPRESS_USERNAME=admin \
-e WORDPRESS_APP_PASSWORD='xxxx xxxx xxxx xxxx' \
quay.io/crunchtools/mcp-wordpressSELinux 说明: 使用
:z(小写,共享)而不是:Z(大写,私有)。 MCP 服务器作为长期运行的 stdio 进程运行。使用:Z时,容器启动后复制到 目录中的文件不具有容器的私有 MCS 标签,因此在容器内不可见。:z标志设置一个共享的container_file_t上下文,所有容器和宿主机都可以读写该上下文。提示: 在多个 MCP 容器服务器(例如 mcp-wordpress 和 mcp-gemini)之间使用相同的共享目录(
~/.local/share/mcp-uploads-downloads/), 这样生成的文件无需复制即可立即用于上传。
从源码构建
git clone https://github.com/crunchtools/mcp-wordpress.git
cd mcp-wordpress
uv sync --all-extras
uv run mcp-wordpress-crunchtools配置
设置以下环境变量:
变量 | 描述 | 示例 |
| WordPress 站点 URL |
|
| WordPress 用户名 |
|
| 应用程序密码 |
|
| 容器内上传目录(可选) |
|
创建应用程序密码
登录 WordPress 管理后台
转到用户 → 个人资料
滚动到应用程序密码
输入名称(例如“MCP Server”),然后点击添加
复制生成的密码(仅显示一次)
与 Claude Code 一起使用
使用 uvx(推荐)
claude mcp add mcp-wordpress-crunchtools \
--env WORDPRESS_URL=https://example.com \
--env WORDPRESS_USERNAME=admin \
--env WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx" \
-- uvx mcp-wordpress-crunchtools使用 pip
pip install mcp-wordpress-crunchtools
claude mcp add mcp-wordpress-crunchtools \
--env WORDPRESS_URL=https://example.com \
--env WORDPRESS_USERNAME=admin \
--env WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx" \
-- mcp-wordpress-crunchtools使用容器
# Create a shared upload directory (required before first run)
mkdir -p ~/.local/share/mcp-uploads-downloads
claude mcp add mcp-wordpress-crunchtools \
--env WORDPRESS_URL=https://example.com \
--env WORDPRESS_USERNAME=admin \
--env WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx" \
-- podman run -i --rm \
-v ~/.local/share/mcp-uploads-downloads:/tmp/mcp-uploads:z \
-e WORDPRESS_URL \
-e WORDPRESS_USERNAME \
-e WORDPRESS_APP_PASSWORD \
quay.io/crunchtools/mcp-wordpress可用工具
站点工具
工具 | 描述 |
| 获取站点标题、描述、URL、时区 |
| 验证 API 凭据是否有效 |
文章工具
工具 | 描述 |
| 使用筛选条件列出文章(状态、分类、搜索) |
| 按 ID 获取单篇文章及完整内容 |
| 按关键词搜索文章 |
| 创建新文章(支持定时发布) |
| 更新现有文章 |
| 删除/移至回收站一篇文章 |
| 列出一篇文章的修订版本 |
| 获取特定修订版本的内容 |
| 列出可用分类 |
| 列出可用标签 |
页面工具
工具 | 描述 |
| 使用筛选条件列出页面 |
| 按 ID 获取单个页面 |
| 创建新页面 |
| 更新现有页面 |
| 删除/移至回收站一个页面 |
| 列出页面修订版本 |
媒体工具
工具 | 描述 |
| 列出媒体项目 |
| 获取媒体项目详情 |
| 从本地路径上传文件 |
| 更新媒体元数据 |
| 删除媒体项目 |
| 获取媒体的公共 URL |
评论工具
工具 | 描述 |
| 使用筛选条件列出评论 |
| 获取单条评论 |
| 向文章添加评论 |
| 更新评论内容/状态 |
| 删除评论 |
| 批准、保留、标记垃圾或删除 |
示例
创建草稿文章
Create a new WordPress post titled "My Technical Article" with the content below. Keep it as a draft.定时发布文章
Update post ID 123 to publish on December 25, 2024 at 10:00 AM.上传图片
Upload this image to WordPress and set the alt text to "Architecture diagram".查找并审核评论
List all comments in "hold" status and approve the legitimate ones.安全性
凭据保护:所有凭据以
SecretStr存储,绝不记录日志SSRF 防护:REST API 路径为硬编码,无法覆盖
输入验证:所有输入均通过 Pydantic 模型验证
速率限制:优雅处理 WordPress 速率限制
TLS 强制:所有请求均使用带证书验证的 HTTPS
大小限制:响应大小限制为 10MB,防止内存问题
超时:所有请求在 30 秒后超时
开发
# Install dev dependencies
uv sync --all-extras
# Run tests
uv run pytest
# Run linting
uv run ruff check src tests
# Run type checking
uv run mypy src
# Format code
uv run ruff format src tests许可证
AGPL-3.0-or-later
致谢
由 crunchtools.com 构建
Available Tools
33 toolswordpress_create_commentWordpress Create CommentC
Create a new comment on a WordPress post.
Inputs: post (required), content (required), parent, author_name, +1 more. Returns: object
wordpress_create_pageWordpress Create PageC
Create a new WordPress page.
Inputs: title (required), content (required), date, slug, +6 more. Returns: object
wordpress_create_postWordpress Create PostC
Create a new WordPress post.
Inputs: title (required), content (required), date, slug, +6 more. Returns: object
wordpress_delete_commentWordpress Delete CommentB
Delete or trash a WordPress comment.
Inputs: comment_id (required), force. Returns: object
wordpress_delete_mediaWordpress Delete MediaC
Delete a WordPress media item.
Inputs: media_id (required), force. Returns: object
wordpress_delete_pageWordpress Delete PageC
Delete or trash a WordPress page.
Inputs: page_id (required), force. Returns: object
wordpress_delete_postWordpress Delete PostC
Delete or trash a WordPress post.
Inputs: post_id (required), force. Returns: object
wordpress_edit_draftWordpress Edit DraftA
Replace text in a draft or pending WordPress post's source. Refuses any other status.
Inputs: post_id (required), new_text (required), old_text (required), replace_all, +1 more. Returns: object
wordpress_edit_pageWordpress Edit PageA
Replace text in a WordPress page's source, without resending the page.
Inputs: page_id (required), new_text (required), old_text (required), replace_all, +1 more. Returns: object
wordpress_edit_postWordpress Edit PostA
Replace text in a WordPress post's source, without resending the post.
Inputs: post_id (required), new_text (required), old_text (required), replace_all, +1 more. Returns: object
wordpress_get_commentWordpress Get CommentBRead-only
Get a single WordPress comment by ID.
Inputs: comment_id (required). Returns: object
wordpress_get_mediaWordpress Get MediaBRead-only
Get a single WordPress media item by ID.
Inputs: media_id (required). Returns: object
wordpress_get_media_urlWordpress Get Media UrlBRead-only
Get the public URL for a WordPress media item.
Inputs: media_id (required), size. Returns: object
wordpress_get_pageWordpress Get PageBRead-only
Get a single WordPress page by ID with its saved source.
Inputs: page_id (required). Returns: object
wordpress_get_postWordpress Get PostARead-only
Get a single WordPress post by ID with its saved source.
Inputs: post_id (required). Returns: object
wordpress_get_revisionWordpress Get RevisionCRead-only
Get a specific revision of a WordPress post.
Inputs: post_id (required), revision_id (required). Returns: object
wordpress_get_site_infoWordpress Get Site InfoARead-only
Get WordPress site information.
Returns site title, description, URL, timezone, and other settings.
Inputs: no named parameters. Returns: object
wordpress_list_categoriesWordpress List CategoriesCRead-only
List available WordPress categories.
Inputs: page, search, per_page. Returns: object
wordpress_list_commentsWordpress List CommentsCRead-only
List WordPress comments with filtering.
Inputs: page, post, order, search, +3 more. Returns: object
wordpress_list_mediaWordpress List MediaCRead-only
List WordPress media items with filtering.
Inputs: page, order, search, orderby, +3 more. Returns: object
wordpress_list_page_revisionsWordpress List Page RevisionsBRead-only
List revisions for a WordPress page.
Inputs: page_id (required). Returns: object
wordpress_list_pagesWordpress List PagesCRead-only
List WordPress pages with filtering and pagination.
Inputs: page, order, parent, search, +3 more. Returns: object
wordpress_list_postsWordpress List PostsCRead-only
List WordPress posts with filtering and pagination.
Inputs: page, tags, order, search, +4 more. Returns: object
wordpress_list_revisionsWordpress List RevisionsBRead-only
List revisions for a WordPress post.
Inputs: post_id (required). Returns: object
wordpress_list_tagsWordpress List TagsCRead-only
List available WordPress tags.
Inputs: page, search, per_page. Returns: object
wordpress_moderate_commentWordpress Moderate CommentC
Moderate a WordPress comment by changing its status.
Inputs: action (required), comment_id (required). Returns: object
wordpress_search_postsWordpress Search PostsARead-only
Search WordPress posts by keyword in title and content.
Inputs: keyword (required), page, per_page. Returns: object
wordpress_test_connectionWordpress Test ConnectionARead-only
Test connection to WordPress REST API.
Verifies API credentials and returns connection status.
Inputs: no named parameters. Returns: object
wordpress_update_commentWordpress Update CommentC
Update an existing WordPress comment.
Inputs: comment_id (required), status, content. Returns: object
wordpress_update_mediaWordpress Update MediaC
Update WordPress media item metadata.
Inputs: media_id (required), title, caption, alt_text, +1 more. Returns: object
wordpress_update_pageWordpress Update PageA
Update an existing WordPress page. To change part of the content, use edit_page.
Inputs: page_id (required), date, slug, title, +8 more. Returns: object
wordpress_update_postWordpress Update PostB
Update an existing WordPress post. To change part of the content, use edit_post.
Inputs: post_id (required), date, slug, tags, +8 more. Returns: object
wordpress_upload_mediaWordpress Upload MediaA
Upload a media file to WordPress from a local file path.
The file is read directly from disk, avoiding large base64 payloads over the MCP protocol. Provide an absolute path to the file.
CONTAINER NOTE: When running as a container, the file path refers to the container filesystem, not the host. Files must be placed in ~/.local/share/mcp-wordpress/uploads/ on the host (mounted to /tmp/mcp-uploads/ inside the container) to be accessible.
Inputs: file_path (required), title, caption, alt_text, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools map cleanly to a distinct resource and action, especially across posts, pages, media, and comments. The main ambiguity is among update_post/edit_post/edit_draft and update_page/edit_page, which all modify content, though the descriptions distinguish full updates from source-text replacement.
All tools consistently use the wordpress_ prefix followed by snake_case verb_noun naming, such as list_posts, create_page, delete_comment, and moderate_comment. Names are predictable and readable throughout the set.
At 33 tools, the surface is heavy for a single MCP server and exceeds the rubric's 25+ threshold for too many tools. The broad WordPress content domain justifies many operations, but the set could likely consolidate overlapping post/page edit variants and media helpers.
Core content lifecycle coverage is strong for posts, pages, media, and comments, including revisions and comment moderation. Remaining gaps include no get-page-revision operation, read-only categories/tags, and no broader WordPress admin tools such as users or settings.
Maintenance
Related MCP Connectors
WordPress MCP server: publish posts, AI images, SEO and full site management, self-hosted
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
WordPress MCP server: generate SEO posts, AI images, autoblog & WooCommerce on your self-hosted site
WordPress MCP server: AI agents edit pages, builders, WooCommerce and SEO, every change recorded.
Related MCP Servers
- AlicenseCqualityDmaintenanceA lightweight MCP server that connects to WordPress via REST API, enabling content management (posts, pages, categories, etc.) and site configuration through natural language commands.49Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server for WordPress content management that provides a secure interface for AI assistants to interact with WordPress sites, enabling content creation, editing, and media management without destructive operations.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enables safe reconnaissance, mutation, and verification of WordPress sites through guarded, typed verbs with dry-run previews and change-packet audit records.MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that bridges AI assistants to WordPress, enabling natural-language management of posts, pages, media, comments, users, plugins, and settings across multiple sites simultaneously.1-