
WPGuard MCP
io.github.cgallic由 GitHub 帳號 cgallic 發布v0.4.0更新於 Oct 24, 2026
WordPress edit previews, scoped correction checks, and change records for trusted operators.
發布方自己的服務:Connorgallic
概覽
一個在本機執行的 MCP 伺服器,讓助理檢視、預覽並套用 WordPress 內容與設定變更,附帶糾錯檢查與變更紀錄。
- 可以做什麼
- 檢視網站主題、外掛、內容類型與欄位,並在編輯前列出頁面或與參考頁比對。預覽並套用頁面內文、區塊、文章中繼資料與選項變更,包含受保護文案檢查、快照與寫入後回讀。擷取桌機與行動版渲染證據,並在已註冊的預備站台測試變更而不自動上線。依版本鎖定更新外掛或主題,附健康檢查與失敗自動還原,並回傳快取的漏洞掃描結果。列出、檢視並還原 WordPress 原生版本修訂,記錄、列出或停用針對特定目標的糾錯檢查。檢視變更包、匯入歷史紀錄,並執行範圍很窄的預先授權原則。
- 適用情境
- 適合希望助理做可審查的 WordPress 編輯而非盲目寫入的情況:預覽整頁替換、保留必須存在的連結或文案、先在上線前的預備環境測試,或留下改了什麼、為什麼改的紀錄。
- 執行需求
- 以 Python 3.10 以上從原始碼在本機安裝(或使用 Docker 映像)執行,監聽本機 HTTP 端點。需要 WPGUARD_MCP_TOKEN 環境變數提供權杖,並在 Authorization 標頭帶相同值。WordPress 站台透過 SSH 或配套外掛連線,內容糾錯檢查需要配套外掛;建議使用專用管理員的應用程式密碼。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 WPGuard MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
WPGuard
Put your AI assistant to work on WordPress. Preview the edit. Keep the corrections that matter.
WPGuard connects an MCP client to WordPress so it can inspect a site, update content and settings, and return a record of its changes. When you teach it a supported correction, future edits to that exact target are checked before they are applied.
It is the open-source server behind WP MCP Server. Run it on your own machine or server and connect your WordPress sites over SSH or the companion plugin.
Get started · Product website · Security · MIT license
Useful work, with something to review
Ask your assistant to:
- Inspect the active theme, plugins, content types, and available fields before changing a page.
- Find a target page and approved reference, compare their complete stored content, and preview a bounded full-page diff.
- Replace a Gutenberg or classic page body while proving named copy survives and refusing to overwrite a later human edit.
- Update one Gutenberg block structurally, then verify the native WordPress revision created by the write.
- Test a page change on a registered staging site and capture desktop/mobile evidence before opening production approval.
- Update one plugin or theme with version pinning, health checks, and automatic restoration after a failed update.
- Preview a content replacement, setting update, or file edit before applying it.
- Preserve an approved text fragment, field value, or link during later edits to the same target.
- Retrieve earlier work for an exact client and show the originating evidence.
- Review a change packet and the snapshots captured by supported mutation tools.
The tools provide the WordPress access and change records. Your MCP client supplies the assistant and its reasoning.
Teach it once. Check the next edit.
Suppose a restaurant's reservations page must keep the link labeled Reserve a table pointing to /reserve.
You record that requirement with a rejected example, an accepted example, and its source. WPGuard first proves the check distinguishes those examples. A later content edit that removes the link fails its preview check and is blocked when the assistant tries to apply it.
This synthetic example uses the wp_correction_record MCP tool after registering the site:
The requirement applies to this registered site and this post body. It does not become a rule for every page or another client. Retiring a correction preserves its history and the reason it was retired.
Supported checks cover exact text presence or absence, scalar equality, a value at a JSON Pointer, and an HTML anchor's destination and text. The link check examines HTML structure; it does not prove the destination works or the link is visible in a browser.
Start from source
Requires Python 3.10 or newer. These commands install this repository; they do not depend on a published package or container image.
The server listens at http://127.0.0.1:8642/mcp. Connect a client that supports MCP Streamable HTTP and an Authorization: Bearer <token> header, using the value of WPGUARD_TOKEN_ADMIN from the server's environment.
Then register your site and call wp_site_context. Registration stores connection details; it does not import or modify your site's content.
The setup guide includes Windows, Docker builds, both WordPress connections, and a first edit with a reviewable preview.
What is included
The server also exposes advanced PHP, SQL, CLI, snippet, and access tools. Their permissions and side effects differ. They are not covered by the correction checks above.
Bring your own history
Importing history preserves the original records, hashes, and provenance in the instance's state directory. Repeating an identical import is idempotent; changed records retain their earlier versions.
Packet exports use three CSV schemas:
For richer session histories:
Each JSONL record needs nonempty episode_id, client, and site strings; additional evidence fields are preserved. wp_history_episodes(client_slug=...) matches the original client value exactly. Packet queries match the packet export's client_slug exactly. No alias mapping is inferred between the two exports.
Imported status and acceptance labels remain historical reports. Recording an active correction is a separate operation that requires examples which fail and pass its check. Caller-supplied acceptance references are recorded as attestations, not independently authenticated approvals.
Imports stay on the instance until queried or otherwise shared by its operator. Queries send the selected records to the connected MCP client. Keep private histories out of public repositories and publishable artifacts.
Know the boundaries
- Correction coverage is explicit: option, post-meta, post-content, full-page, block, and native-revision content writes evaluate applicable target rules. Raw PHP, SQL, file edits, new posts, component updates, and changes made outside WPGuard use different safeguards.
- Rendered verification is bounded.
wp_page_render_verifychecks the resolved live page at desktop and mobile sizes for HTTP failures, horizontal overflow, broken rendered images, and optional expected text. It stores hashed screenshots and a JSON receipt understate/render-evidence/. It does not judge visual quality or exercise interactions and links. - Permissions are not human approval. A mutate-scoped caller can approve packets. An admin-scoped caller can record or retire corrections. Use your surrounding workflow to decide who may do each.
- Snapshots are tool-specific. There is no guarantee that every exposed operation is reversible. Maintain your site's regular backups.
- The companion plugin has administrative capabilities. Prefer a WordPress Application Password owned by a dedicated administrator. The legacy shared key remains available for existing installations. Server-side token tiers do not protect callers who contact the plugin directly.
- Local ledgers assume a single writer. They are not a shared multi-writer database. A successful replay or test does not establish live production deployment.
The updated companion plugin is required for content correction checks. It returns the source content during preview and checks its digest before applying a content replacement. Older plugin responses cannot satisfy that capability check.
Development
CI runs lint, type checks, and tests on Python 3.10–3.12. PHP CLI is needed to run the companion-handler tests; without it those tests skip. All public test examples are synthetic.
WPGuard is MIT-licensed. See LICENSE.
來源:README.md,提交 06b2248
工具
0版本歷史
1- v0.4.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分