| 开发者 | guramzhgamadze |
|---|---|
| 更新时间 | 2026年7月27日 01:45 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp_get_site_info, wp_get_plugins, wp_get_themes, wp_get_post_types, wp_get_taxonomies, wp_get_options, wp_query_posts, wp_get_post, wp_get_db_schema, wp_db_query, wp_list_files, wp_read_file, wp_search_code, wp_get_logs, wp_get_hooks, wp_get_acf_fields, wp_get_users, wp_get_menus, wp_get_cron_jobs, wp_get_transients, wp_get_scheduled_actions, wp_get_active_widgets, wp_get_rest_routes, wp_get_woocommerce, wp_get_elementor.
Write (only with write mode enabled): wp_create_draft_post, wp_update_draft_post, wp_update_option, wp_toggle_plugin, wp_clear_cache, wp_create_term.
wp-content/plugins/zen-mcp-bridge, or install it from your WordPress admin.https://your-site.com/wp-json/zen-mcp/v1/bridge.Claude.ai auto-discovers the OAuth server from the /.well-known/ URLs and opens a login page on your site, where an administrator clicks Allow Access. If Claude.ai asks for details manually, use the Authorization URL and Token URL shown in the OAuth (advanced) section of the settings page, any Client ID except the literal text "Bearer Token", and the scope claudeai.
Go to Settings → Permalinks and click Save Changes to flush rewrite rules, and confirm the plugin is active.
This is handled automatically. If it persists, add this line to your .htaccess:
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
Define WP_DEBUG, WP_DEBUG_LOG (true) and WP_DEBUG_DISPLAY (false) in wp-config.php, then read wp-content/debug.log or use the wp_get_logs tool.
By default, yes — everything is read-only: credentials are redacted, database reads are structured (no raw SQL — table and column names are whitelisted against the live schema and every value is parameterized), file access is contained within wp-content, and OAuth uses mandatory PKCE with single-use, expiring authorization codes. Write access exists only when an administrator switches on write mode, is limited to drafts, allowlisted options, plugin toggles, caches and terms, and every write is recorded in the audit log. Deleting content, publishing, managing users and write SQL are impossible regardless of settings.
Enable it under Settings → MCP Bridge → Write mode (off by default). The static Bearer token then gains write access; OAuth sessions must additionally tick "Allow write access" on the consent screen (the claudeai:write scope). Six scoped tools become available; drafts can never be published, options must be on an allowlist you control (site identity, code-execution and secret options are refused even if listed), and the plugin can never toggle itself off. Each write tool can be disabled individually and every call is audited.
They point in opposite directions and can coexist: that plugin lets WordPress call Claude's API; Zen MCP Bridge lets Claude.ai read this site. When AI Provider for Anthropic is active, Zen MCP Bridge automatically stops registering its tools as WordPress Abilities so the site's AI surface has a single owner — Claude.ai access via the MCP endpoint is unaffected. The zenmcp_enable_abilities filter overrides this.
wp_db_query no longer accepts raw SQL. It is now a structured, injection-proof table reader: you name a table, columns, WHERE conditions, ordering and a limit, and the plugin builds the query — table/column names are validated against the live schema and every value is bound through $wpdb->prepare(). Credential columns stay blocked and secret values redacted. Joins and aggregate expressions are no longer supported (use wp_query_posts or the dedicated inspector tools).client_id from a dedicated plugin secret instead of the WordPress AUTH_KEY, keeping core authentication secrets scoped to authentication.<style>).X-Content-Type-Options: nosniff to all plugin responses (MCP endpoint, OAuth token/discovery endpoints, consent page) — hardening surfaced by an OWASP ZAP scan.wp_create_draft_post / wp_update_draft_post (status locked to draft/pending — publishing always needs a human), wp_update_option (admin-managed allowlist with hard denies for site identity, code-execution and secret options), wp_toggle_plugin (cannot touch Zen MCP Bridge itself), wp_clear_cache and wp_create_term.claudeai:write scope); the static Bearer token has write access only while write mode is on.readOnlyHint (and write tools destructiveHint: false) per the 2025-11-25 specification.tools/list for credentials without write access, individually toggleable, registered as Abilities only in write mode, and fully audited.wp_db_query now rejects queries referencing the plugin's own credentials and redacts secret-bearing values (API keys, session tokens, consumer secrets) from results; wp_get_options applies the same secret-name heuristic; sensitive files (.env, wp-config copies, SQL dumps, keys/certificates) cannot be read or searched, and credential-like lines are masked in code-search results.zenmcp_ code prefix, text domain and REST namespace zen-mcp/v1). Existing installs keep their Bearer token, redirect URIs and token lifetime via a one-time migration on activation. The MCP endpoint URL changed — reconnect Claude.ai to …/wp-json/zen-mcp/v1/bridge.wp_search_code, wp_get_post, wp_get_transients (auth/secret values redacted), wp_get_scheduled_actions, wp_get_woocommerce (no customer data or credentials) and wp_get_elementor — 25 tools total.resources (site snapshots at wordpress:// URIs) and prompts (site analysis, error debugging, plugin writing) capabilities.uninstall.php (removes options and transients on delete) and internationalization.client_id_metadata_document_supported, scope in WWW-Authenticate, and description in serverInfo.