WordPress plugin implementing WebMCP (Web Model Context Protocol) — allows AI agents running in the browser to interact with your WordPress site through document.modelContext.registerTool() browser-native MCP tools.
WebMCP is a W3C Community Group specification that brings MCP (Model Context Protocol) to the browser. It allows web pages to register JavaScript-based tools that AI agents can invoke — all running client-side with the visitor's own context. Tools are registered via document.modelContext.registerTool() and can interact with the WordPress REST API, page DOM, and other browser APIs.
Spec: https://webmachinelearning.github.io/webmcp/
Chrome docs: https://developer.chrome.com/docs/ai/webmcp
- Install the plugin on any WordPress site
- Visitors with a WebMCP-enabled browser (Chrome origin trial, Claude desktop, ChatGPT browser) can engage with the site via AI agents
- The plugin registers MCP tools that let agents:
- Read and search your posts, pages, and media
- Get complete site structure and navigation
- (Optionally) create, edit, or delete content
- Access user data, taxonomies, comments
- Agents can navigate between posts/pages using permalinks
- Agents can engage by creating comments or (if enabled) editing content
- 23+ MCP tools covering posts, pages, media, taxonomies, users, comments, categories, tags, site info, navigation, and search
- Permission-gated: each capability (create, edit, delete, users) can be toggled independently
- WordPress-native: uses the WordPress REST API v2 with nonce authentication
- Gutenberg block: add the WebMCP Visitor Widget to any page
- Responsive UI: floating chat container with dark/light mode support
- WP-CLI support: manage settings from the command line
- Origin isolation: automatically sends COOP/COEP headers required by WebMCP
# Clone and build the plugin
git clone https://github.com/pbmagnet4/nxt-wp-mcp.git
cd nxt-wp-mcp
# Install JS dependencies and build assets
npm install && npm run build
# Zip for WordPress upload
npm run zip- Download
nxt-wp-mcp.zip - Go to Plugins → Add New → Upload Plugin in WordPress
- Upload and activate
- Go to Settings → WebMCP to configure permissions and UI
- Add the "WebMCP Visitor Widget" block to any page, or enable the global widget
| Category | Tools |
|---|---|
| Site Info | wp_get_site_info, wp_get_navigation, wp_get_sitemap |
| Search | wp_search, wp_get_related_posts |
| Posts | wp_list_posts, wp_get_post, wp_create_post, wp_update_post, wp_delete_post |
| Pages | wp_list_pages, wp_get_page, wp_create_page, wp_update_page, wp_delete_page |
| Media | wp_list_media, wp_get_media, wp_delete_media |
| Taxonomies | wp_list_categories, wp_get_category, wp_create_category, wp_update_category, wp_delete_category |
| Tags | wp_list_tags, wp_get_tag, wp_create_tag, wp_update_tag, wp_delete_tag |
| Users | wp_list_users, wp_get_user |
| Comments | wp_list_comments, wp_get_comment, wp_create_comment, wp_update_comment, wp_delete_comment |
Visit Settings → WebMCP to configure:
- Enable/Disable the plugin globally
- Permission toggles for each capability (create, edit, delete, users, tax, comments, plugins, themes, settings)
- Widget UI settings (position, width, collapsibility, default open state)
- Content limits (max posts, pages, media exposed)
wp webmcp status # Show plugin status and settings
wp webmcp enable # Enable the plugin
wp webmcp disable # Disable the plugin
wp webmcp set allow_create 1 # Enable post creation
wp webmcp set allow_users 0 # Disable user access# Install dependencies
npm install
# Build assets
npm run build
# Watch mode for development
npm run devdist/webmcp.js— frontend tool registration and chat widgetdist/blocks.js— Gutenberg block editor scriptdist/manifest.php— PHP asset manifest for cache-busting
- WordPress 6.5+
- PHP 8.1+
- HTTPS recommended (WebMCP requires SecureContext)
- Chrome 149+ or origin trial support for
document.modelContext
GPLv2 or later — see LICENSE.