Linux 软件免费装
Banner图

Spoko Content Editor for MCP

开发者 spokospace
更新时间 2026年12月2日 04:11
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: MIT
版权网址: 版权信息

标签

blocks gutenberg ai mcp abilities

下载

2.0.2 2.2.2

详情介绍:

Spoko Content Editor for MCP gives AI agents (Claude, Cursor or any other MCP client) safe, block-level tools for WordPress content. It runs on the official MCP Adapter and the Abilities API that ships with WordPress 6.9. An agent that rewrites a whole post to change one paragraph can break blocks it never meant to touch, or overwrite an edit someone made a minute ago. This plugin gives it smaller, safer steps: Tools Every tool runs with the capabilities of the WordPress user the agent signs in as (edit_post for the post, upload_files for the media library, which lists only files the user may read, edit_posts or edit_pages for create-draft). replace-block, unwrap-block and delete-block are marked destructive, so MCP clients that confirm destructive tools ask before running them. The plugin adds no settings screen. Its only data is a short-lived lock row in the options table while a write runs, and two post meta fields on the drafts create-draft makes. Drafts from Markdown create-draft puts an article written elsewhere into WordPress as a draft. The agent converts the Markdown to blocks and maps the front matter to the tool's fields: title, slug, excerpt, existing categories and tags, a featured image from the media library and, with Polylang, the language. The status is always draft, so the agent's user needs edit_posts and never publish_posts; a Contributor account is enough, and a person publishes. The markup is filtered and checked like every other write, dry_run creates nothing, and a source_key (for example the file path) keeps a retried call from making a second draft. A site that wants the agent to edit only existing posts turns it off: define( 'SPOKO_CONTENT_MCP_CREATE_DRAFTS', false ); or with the spoko_content_mcp_create_drafts filter. HTML filtering An agent decides what to write after reading content that other people wrote, and that content can contain instructions meant for it. So the markup an agent sends is filtered the way WordPress filters authors without the unfiltered_html capability (scripts, event handlers and unknown tags are removed), also when the agent signs in as an Administrator or Editor. The plugin filters only what the agent sends: for users with unfiltered_html the rest of the post, its title and excerpt stay as they are; for users without it WordPress filters every save of the whole post, as it always does. The tool reports content_filtered_on_save: true when the filter changed the markup (removed something, or normalized it, for example attribute order or <img/>), in a dry run too. An agent that re-sends a block containing such HTML, for example to fix a typo next to a script, loses that HTML unless the site opts in. Of core blocks, this affects data: URLs, as it does for Authors in the editor. For users with unfiltered_html the filter also keeps what cannot run a script in the page: iframes from https:// embed addresses of YouTube, Vimeo, Google Maps, Google Drive and Docs, Spotify, SoundCloud and OpenStreetMap (change the list with the spoko_content_mcp_embed_hosts filter); PDFs from the media library in an iframe or in the File block's preview; and inline SVG drawings without scripts, links or animation. Any other iframe or object loses its address. The spoko_content_mcp_allowed_html filter ($tags, $post) changes the whole tag list. A site that needs raw HTML from the agent can opt in, which only matters for users who have unfiltered_html: define( 'SPOKO_CONTENT_MCP_ALLOW_UNFILTERED_HTML', true ); or with the spoko_content_mcp_allow_unfiltered_html filter ($allow, $post). Headless sites If your frontend serves the uploads under its own address, link-images can link there instead of to WordPress. Set the address in wp-config.php: define( 'SPOKO_CONTENT_MCP_MEDIA_BASE', 'https://example.com/images' ); or with the spoko_content_mcp_media_base filter. Older media hosts to rewrite as well can be added with the spoko_content_mcp_media_aliases filter. More about the plugin, with examples: spoko.space/wordpress-content-editor-mcp. Development happens on GitHub. Made by spoko.space.

安装:

  1. Install and activate the MCP Adapter plugin.
  2. Install and activate Spoko Content Editor for MCP.
  3. Create a WordPress user for the agent and an application password for it (Users > Profile > Application Passwords).
  4. Point your MCP client at https://your-site/wp-json/spoko/content, for example with @automattic/mcp-wordpress-remote, using that user and application password.

屏幕截图:

  • `replace-block` with `dry_run: true` changes one paragraph by its path, checks the result and saves nothing. Tools that can remove content are marked destructive.
  • Every save is a normal revision. Here wp-admin compares the agent's edit with the version before it, so a person can review it and restore the old text.
  • `create-draft` turns an article (for example a Markdown file the agent converted to blocks) into a new post with existing categories and tags. The status is always `draft`.
  • The new draft waits in wp-admin, written by the agent's own Editor account, until a person publishes it.

升级注意事项:

2.2.2 The "View details" popup of the GitHub build shows readable release notes. 2.2.1 Agents now get error codes and data (e.g. draft_exists with the existing post_id) instead of the message alone. 2.2.0 New tool create-draft: agents can create posts and pages as drafts (never published). Turn it off with SPOKO_CONTENT_MCP_CREATE_DRAFTS. 2.1.1 Inline SVG written by an agent keeps viewBox and other camelCase attribute names on WordPress 7.x. 2.1.0 Agent markup is now HTML-filtered for every user; existing content is untouched. Administrators and Editors keep known embeds, site PDFs and inline SVG. For unfiltered HTML, set SPOKO_CONTENT_MCP_ALLOW_UNFILTERED_HTML.

常见问题:

Which MCP clients work with it?

Any client that can reach a WordPress MCP Adapter server, for example Claude (desktop and Claude Code) or Cursor through @automattic/mcp-wordpress-remote.

Can the agent change posts it should not?

No more than the WordPress user it signs in as. Give that user the smallest role that works, for example Author for its own posts or Editor for everyone's, and never an administrator account. Its HTML is filtered either way (see HTML filtering).

Can the agent publish?

No. create-draft makes drafts only, and the editing tools change content, not the status. A person publishes in WordPress.

How do I undo a change?

Every save creates a normal revision. Restore it from the block editor (Revisions), or note the revision_id the tool returns.

Does it work with the classic editor?

The tools work on block content. Classic (freeform) content is reported as such and left alone.

更新日志:

2.2.2 2.2.1 2.2.0 2.1.1 2.1.0 2.0.3 2.0.2 2.0.1 2.0.0