MCP Server
@loopress/mcp is an MCP server that exposes Loopress CLI operations as tool calls, so an AI agent (Claude Code, Claude Desktop, or any MCP client) can pull and push snippets, API routes, hooks, ACF objects, SEO settings, forms, plugins and Composer dependencies on a WordPress site, one resource at a time or all at once, and check project status. It ships as the lps-mcp binary.
It doesn’t reimplement any sync logic: every tool shells out to the lps binary already on your PATH, the same one used by the CLI.
Requirements
Section titled “Requirements”- The Loopress CLI installed and on
PATH - A
loopress.jsonalready set up in the directory your MCP client will launch the server from (lps init), since tools resolve paths the same waylpsdoes when run by hand - WordPress authentication already done via the CLI (
lps project config). The MCP server never handles auth itself, it only callslps, which reads the stored Application Password.
Installation
Section titled “Installation”npm install -g @loopress/mcpThen point your MCP client at the lps-mcp binary. In Claude Code:
claude mcp add loopress -- lps-mcpIn a JSON-based client config (Claude Desktop and similar):
{ "mcpServers": { "loopress": { "command": "lps-mcp" } }}The server communicates over stdio from the directory your client launches it in, and takes no arguments of its own.
| Tool | Mutating | Description |
|---|---|---|
snippet_push |
Yes | Push local snippet files to WordPress |
snippet_pull |
No | Pull snippets from WordPress into local files |
snippet_list |
No | List snippets currently on WordPress |
api_push |
Yes | Push local custom API route files to WordPress (prune also removes server-side files absent locally) |
api_pull |
No | Pull custom API route files from WordPress |
api_list |
No | List custom API route files currently on WordPress (flags each route public when it needs no authentication) |
api_rm |
Yes | Remove one custom API route file from WordPress |
hook_push |
Yes | Push local hook files to WordPress (prune also removes server-side files absent locally) |
hook_pull |
No | Pull hook files from WordPress |
hook_list |
No | List hook files (WordPress actions, filters, and cron jobs) currently on WordPress |
hook_rm |
Yes | Remove one hook file (action, filter, cron) from WordPress |
app_push |
Yes | Push built single-page app bundles to WordPress |
app_pull |
No | Pull single-page app bundles from WordPress into local files |
app_list |
No | List single-page apps currently deployed to WordPress |
app_remove |
Yes | Remove a single-page app from WordPress |
acf_push |
Yes | Push local ACF field groups, post types, taxonomies and options pages to WordPress |
acf_pull |
No | Pull ACF objects from WordPress into local files |
acf_list |
No | List ACF objects currently on WordPress |
seo_push |
Yes | Push SEO settings, post meta and redirects to WordPress (allowExternalRedirects to permit an off-site redirect target) |
seo_pull |
No | Pull SEO settings, post meta and redirects from WordPress into local files |
seo_list |
No | List posts with SEO meta, and redirects if supported, on WordPress |
option_push |
Yes | Push locally tracked, non-readonly options to WordPress |
option_pull |
No | Refresh locally tracked options from WordPress |
option_list |
No | List WordPress option names and autoload flags currently on the site (names only, never values) |
option_add |
No | Fetch a WordPress option by name and start tracking it locally |
option_remove |
Yes | Stop tracking an option locally and delete it from WordPress |
form_push |
Yes | Push local form files to WordPress |
form_pull |
No | Pull forms from WordPress into local files |
form_list |
No | List forms currently on WordPress |
plugin_push |
Yes | Install/pin/activate WordPress.org plugins to match loopress.json, via Composer + WPackagist |
plugin_pull |
No | Pull installed plugins from WordPress into loopress.json, pinned to their live versions |
plugin_status |
No | Report drift between the plugins on WordPress and loopress.json |
plugin_audit |
No | Check loopress.json plugins for known vulnerabilities and health issues |
theme_push |
Yes | Install/pin WordPress.org themes to match loopress.json (never switches the active theme) |
theme_pull |
No | Pull installed themes from WordPress into loopress.json, pinned to their live versions |
theme_status |
No | Report version drift between the themes on WordPress and loopress.json |
composer_push |
Yes | Push composer.json and run Composer on WordPress to resolve and install dependencies |
composer_pull |
No | Pull composer.json/composer.lock from WordPress |
push_all |
Yes | Push every local resource to WordPress in one run, like lps push |
pull_all |
No | Pull every resource from WordPress into local files in one run, like lps pull |
project_status |
No | Show which project and environment the other tools will target |
Every tool accepts an optional env to target a specific environment instead of the globally active one. The _push, _pull and _list tools that sync files also accept an optional path to override the directory configured in loopress.json. The ACF tools take an optional type array and the SEO tools an optional postType array to scope the operation, mirroring the CLI’s --type and --post-type flags.
Confirming changes
Section titled “Confirming changes”Every mutating tool requires two calls before it touches WordPress:
- Call without
confirmToken: runs a dry-run preview and returns a single-useconfirmToken(expires after 5 minutes) instead of making any change. - Call again with that
confirmToken: applies exactly what was previewed.
This handshake can’t be skipped, not even against a production environment, so an agent can never push a real change without a human-reviewable preview first.
Project config resource
Section titled “Project config resource”The server also exposes loopress://project/config as a resource: the raw contents of loopress.json in the current directory, for an agent to inspect without shelling out itself.