Content
# WP Snapshot Tools
A [Local WP](https://localwp.com/) addon that provides MCP (Model Context Protocol) tools for WordPress database snapshot operations. Works with Claude Code, Cursor, Windsurf, and any MCP client.
## Tools
| Tool | Description |
|------|-------------|
| `snapshot_import` | Import a SQL file into the local site database |
| `snapshot_create` | Create a snapshot from the current local database |
| `snapshot_pull` | Pull a snapshot by ID into the local site |
| `snapshot_push` | Push a local snapshot to the remote repository |
| `snapshot_search` | Search for snapshots in a remote repository |
| `snapshot_configure` | Manage repository settings (~/.wpsnapshots/config.json) |
## Installation
1. Build the addon:
```bash
npm install
npm run build
```
2. Copy to Local's addons directory:
```bash
cp -R . ~/Library/Application\ Support/Local/addons/wp-snapshot-tools/
```
3. Restart Local.
## Usage
1. Open a site in Local.
2. Go to the **Tools** tab.
3. Find **Snapshot Tools** and click **Enable**.
4. Select your coding agent(s) and install location.
5. The addon writes its MCP server entry (`local-snapshots`) to the appropriate config file.
## What It Looks Like
Once enabled, your coding agent can search, create, import, pull, and push snapshots through natural language. Here is an example conversation in Claude Code:
```
> search snapshots for my-project
● local-snapshots → snapshot_search (MCP)(search: "my-project")
● Two remote snapshots found for my-project:
| Date | Description | Size | ID |
|----------------|-------------------------|----------|------------|
| March 14, 2026 | Local DB 2026-03-14 | 38.69 MB | xxxxxxxx… |
| April 2, 2026 | DB as of 2nd April 2026 | 38.71 MB | yyyyyyyy… |
Both are DB-only (no files), multisite, and authored by you. The April
2nd snapshot is the most recent. Want me to pull one of these into your
local site?
> no I want to create a new snapshot
● local-snapshots → snapshot_create (MCP)(slug: "my-project",
description: "Local DB 2026-04-12")
● Two SQL files were found in your project:
1. local-2026-04-12-2b29805.sql (282.4 MB, modified today at 16:53)
2. mysql.sql (282.5 MB, modified today at 15:18)
Should the snapshot use the current database as-is, or would you like
to import one of these SQL files first?
> use mysql.sql
● local-snapshots → snapshot_import (MCP)(sql_file: "mysql.sql")
● Database imported and URLs replaced. Now creating the snapshot.
● local-snapshots → snapshot_create (MCP)(slug: "my-project",
description: "Local DB 2026-04-12", skip_sql_check: true)
● Snapshot created successfully.
- ID: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
- Status: Created locally (not pushed)
- Login: username snapshots, password password
● local-snapshots → snapshot_pull (MCP)(snapshot_id: "a1b2c3d4…",
main_domain: "my-project.test")
● Snapshot pulled and applied. Your local site is now running the
scrubbed database with the snapshots user ready to log in.
Would you like me to push the snapshot to the remote repository so
your team can access it?
> yes
● local-snapshots → snapshot_push (MCP)(snapshot_id: "a1b2c3d4…")
● Snapshot pushed to remote. Your team can now pull it.
```
The agent handles the full workflow: searching existing snapshots, detecting SQL files, importing, creating, scrubbing user data, pulling the clean database locally, and pushing to the shared repository.
## Per-Project Configuration
Create a `.snapshot-plugins.json` file in your project root, WordPress root (`app/public`), or `wp-content` directory to automate plugin and command management during snapshot operations.
```json
{
"pre_create": {
"deactivate": ["wp-mail-smtp", "wp-saml-auth", "okta-sign-in"],
"commands": ["jetpack module deactivate account-protection"]
},
"post_pull": {
"deactivate": ["wp-mail-smtp", "wp-saml-auth", "okta-sign-in"],
"activate": ["query-monitor", "debug-bar"],
"commands": ["jetpack module deactivate account-protection"]
}
}
```
### Phases
| Phase | When it runs | Use case |
|-------|-------------|----------|
| `pre_create` | Before `snapshot_create` builds the snapshot | Deactivate production-only plugins (SSO, SMTP, WAF) so the snapshot itself is clean |
| `post_pull` | After `snapshot_pull` imports the database | Same deactivates as a safety net for snapshots created without pre_create, plus activate local dev tools |
### Fields (available in both phases)
| Field | Description |
|-------|-------------|
| `deactivate` | Plugin slugs to deactivate (`wp plugin deactivate`). Adds `--network` automatically on multisite. |
| `activate` | Plugin slugs to activate (`wp plugin activate`). Adds `--network` automatically on multisite. |
| `commands` | Arbitrary WP-CLI commands to run (without the `wp` prefix). Example: `"jetpack module deactivate account-protection"` |
## Requirements
- [Local WP](https://localwp.com/) v9+
- [WP Snapshots](https://github.com/10up/snapshots) WP-CLI package (`wp package install 10up/snapshots`)
- AWS credentials configured for snapshot repository access
## License
GPL-2.0-or-later