6eeb8b9087
Wraps the site tool wpb_build_page: build or update a Word Page from {kind, html} sections. The page lands as a native Word Page (payload in post meta, builder-rendered), so it stays editable and undoable in the builder. Also documents the builder tools in the bundled skill and README.
4.4 KiB
4.4 KiB
name, description, version, author, license, metadata
| name | description | version | author | license | metadata | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wordvibe-sites | Use when driving a WordPress site through the WordVibe plugin (wordvibe_* tools). Covers site selection, read-before-write, snapshots/rollback, and which site tools to reach for. | 1.0.0 | WordVibe | MIT |
|
Driving WordPress with the wordvibe_* tools
The wordvibe_* tools talk to the MCP server inside the WordVibe WordPress plugin. One
configured site is the default; when several are configured, pass site (name or URL).
Order of operations
wordvibe_sites(probe=true)— confirm the site(s) and that MCP is reachable.wordvibe_site_info— WordPress version, active theme, plugin count, WordVibe plugin version.wordvibe_tools— the catalogue. Filter it (filter="post",filter="security") when hunting.- Do the work with the wrappers, or
wordvibe_callfor anything without a wrapper.
Rules that keep you out of trouble
- Read before write.
wordvibe_read_filefirst, thenwordvibe_edit_file(targetedsearch→replace) rather thanwordvibe_write_file(full overwrite). Read again after a batch of edits. - Snapshots exist. Every save on the site captures the previous version. If you break something,
wordvibe_callwithrollback_list, thenrollback_restore. Say so to the user instead of improvising a fix. db_queryis SELECT-only;db_mutateandphp_evalare blocked over MCP by design. If a task truly needs SQL writes or code execution, tell the user it has to be done in the site's own UI.cli_execruns WP-CLI on the site (wp plugin list,wp post list …). Prefer the dedicated tools (plugin_list,post_list) — they return structured output.- Never invent paths.
list_directoryandfile_search(orwordvibe_search) resolve the real layout;get_file_infoconfirms a file exists. - Writes are live. They hit a production site. Before a destructive or wide change, state what you're about to change and why, and keep the change minimal.
Common tasks → tools
| Task | Call |
|---|---|
| Find code | wordvibe_search(query="add_filter", include="*.php") |
| Inspect a plugin | wordvibe_call(tool="plugin_list"), then list_directory path="wp-content/plugins/<slug>" |
| Read/update a post | wordvibe_call(tool="post_list") → wordvibe_call(tool="get_post") → update_post |
| Database lookups | wordvibe_call(tool="db_query", arguments={"sql":"SELECT COUNT(*) FROM wp_posts"}) |
| Security sweep | wordvibe_call(tool="security_scan_installed") |
| Roll back an edit | wordvibe_call(tool="rollback_list") → rollback_restore |
| Build a page | wordvibe_build_page(title=…, sections=[{kind, html}], status="publish") |
| Site basics | wordvibe_call(tool="site_info"), theme_list, plugin_list |
Building pages (Word Page Builder)
wordvibe_build_page creates or updates a Word Page — a page the site's Word Page Builder owns and
renders from its own stored payload, so it opens natively in the builder (edit, undo, redo all work).
- One call builds the whole page:
title,sections: [{kind, html}], optionalslug,status,post_id. - Section kinds:
hero,features,pricing,testimonials,faq,cta,footer,gallery,contact,about,services,custom. Each becomes<section data-wpb-section="kind" data-wpb-id="sec-…">. - Write inline styles rather than inventing class names — the builder preserves what you give it, but the site's stylesheet won't contain classes that don't exist.
- Editing an existing page:
wordvibe_tools(filter="wpb")lists the builder tools, then usewordvibe_callwithwpb_get_page/wpb_get_page_full,wpb_replace_section_html,wpb_add_section_to_page,wpb_delete_section,wpb_generate_page(AI),wpb_chat_edit_page(AI, one instruction per call),wpb_list_pages. - Needs the page builder present in the site's build (WordVibe 1.0.x cloud/ide). Where it was stripped, the tools answer "The Word Page Builder is not available in this build of the plugin." — say so instead of faking it with a plain page.
Multi-site
With WORDVIBE_MCP_SITES configured, name the target explicitly on every call — do not let a default
silently decide which client's site you just wrote to. When the user says "my site" and more than one
is configured, ask which one before writing anything.