LocalWP MCP
Enables management of LocalWP sites, providing capabilities for site discovery, environment diagnostics, log inspection, WP-CLI command execution, and full site backup and restoration workflows.
Provides tools for interacting with LocalWP site databases, including schema inspection, safe SQL reads, direct SQL execution, and database export or import operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LocalWP MCPlist my local sites and run a health check on plovercrm"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
localwp-mcp
localwp-mcp is an MCP server for LocalWP projects.
It discovers Local sites from Local's own metadata, resolves the correct Local PHP and MySQL runtimes for each site, and gives AI agents simple access to:
Local site discovery
Local logs and doctor-style diagnostics
site-aware WP-CLI
safe SQL reads
full SQL access when you opt into it
database export/import
Local-friendly backups
restore workflows
machine-readable Local diagnostics
MCP resources and prompts
Profiles
The package now has only 2 profiles:
safeGood default. Read-focused SQL plus safe WP-CLI inspection commands.full-accessBest for local development when you want the agent to fully work on the site and database.
safe is the default.
Tools
list_local_siteslocal_environment_checklocal_doctorlocal_logslocal_site_infobackup_sitedb_exportdb_importrestore_backupmysql_querySafe profile SQL reads only.mysql_executeFull-access profile single-statement SQL execution.mysql_schemaAcceptstableand alsotableNameas a compatibility alias.execute_wp_cli
Quick Setup
pnpm install
pnpm buildExample MCP config:
{
"mcpServers": {
"localwp": {
"command": "node",
"args": [
"/Users/your-user/Projects/MCP-Servers/localwp-mcp/dist/index.js"
],
"env": {
"LOCAL_SITE_NAME": "plovercrm",
"LOCALWP_MCP_PROFILE": "full-access"
}
}
}
}If you want the cautious default instead, set:
{
"LOCALWP_MCP_PROFILE": "safe"
}Recommended First Command
Run local_environment_check or local_doctor first on any machine. They show:
resolved Local metadata paths
resolved Local app-resource paths
WP-CLI/tooling resolution
optional WP-CLI and MySQL probes for a selected site
log availability and practical next steps
That makes support and cross-platform debugging much easier.
Backups and Database Transfers
backup_siteCreates a backup folder for the selected site.backup_sitewithscope=databaseCreates a timestamped backup folder with a fresh SQL dump.backup_sitewithscope=fullCopies the site'sapp,conf, andlogsdirectories and writes a fresh SQL dump intoapp/sql.db_exportWrites a SQL file directly. Good when you only want the database.db_importImports either a.sqlfile or abackup_sitedirectory. Requiresfull-access.restore_backupRestores from a.sqlfile or abackup_sitedirectory. Infull-access, it can also restoreapp,conf, andlogsfrom a full backup.
The full backup is intentionally folder-based instead of shelling out to platform-specific zip or tar commands. That keeps the MCP predictable across macOS, Windows, and Linux, and it stays close to Local's own site-folder restore shape.
Resources and Prompts
This MCP now also exposes lightweight resources and prompts:
Resource:
localwp://sitesJSON catalog of discovered Local sites.Resource template:
localwp://sites/{siteName}/summaryPer-site Local resolution summary.Resource template:
localwp://sites/{siteName}/doctorPer-site doctor output.Resource template:
localwp://sites/{siteName}/logsPer-site recent logs.Prompt:
diagnose_local_siteHelps an agent diagnose a LocalWP site with the MCP tools.Prompt:
restore_local_siteHelps an agent restore a site from a SQL dump or backup directory.
Platform Compatibility
macOSUses Local metadata under~/Library/Application Support/Localand the standard Local app bundle resources.WindowsUses Local metadata under%APPDATA%\\Localand searches both per-user andProgram Filesinstalls for Local resources.LinuxUses Local metadata under~/.config/Localand the common/opt/Local/resources/extraResourcesinstall path.
The resolver supports both current lightning-services layouts and older site-binaries layouts.
Configuration
Optional environment variables:
LOCALWP_MCP_PROFILEsafeorfull-accessLOCALWP_MCP_BACKUPS_DIROptional shared backup directory. If omitted, backups are written under each Local site'slocalwp-mcp-backupsfolder.LOCAL_SITE_NAMELOCAL_SITE_IDLOCAL_APP_SUPPORT_DIRLOCAL_EXTRA_RESOURCES_DIRSLOCAL_RUN_DIRLOCAL_LIGHTNING_SERVICES_DIRLOCAL_LIGHTNING_SERVICES_DIRSLOCAL_SITES_JSONLOCAL_SITE_STATUSES_JSONLOCAL_WP_CLI_PHARLOCAL_WP_CLI_CONFIGLOCAL_HELPER_BIN_DIRSLOCAL_MYSQL_HOST
Why It Stays Simple
plain TypeScript
pnpmtscstdio transport
There is no bundler here because this is a Node MCP server and the simpler build is easier to debug and maintain.
Development
pnpm install
pnpm check
pnpm test
pnpm build
node dist/index.jsThis server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kazimshah39/localwp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server