All environment variables used by PromptWire, with descriptions, defaults, and examples.
All environment variables are set in the env block of your .cursor/mcp.json server entry.
Core variables
| Variable | Required | Default | Description |
PW_PATH | Yes (for local) | — | Absolute path to your ProcessWire install root (the directory containing site/ and wire/). Required for local CLI mode. Also used to locate the default sync directory and local file assets. |
PHP_PATH | No | php | Path to the PHP binary. Only needed if php is not on your system PATH, or you need a specific version (e.g. /Applications/MAMP/bin/php/php8.3.30/bin/php). |
PROMPTWIRE_CLI_PATH | No | PW_PATH/site/modules/PromptWire/bin/promptwire.php | Override path to the CLI entrypoint. Useful if the module is installed in a non-standard location or symlinked. |
Remote variables
| Variable | Required | Default | Description |
PW_REMOTE_URL | Yes (for remote) | — | Full URL of the remote PromptWire API endpoint (e.g. https://www.example.com/promptwire-api.php). When set without PW_PATH, all commands run remotely. When set with PW_PATH, only explicit remote operations (push, publish, file sync, schema compare) use it. |
PW_REMOTE_KEY | Yes (for remote) | — | Shared secret for the X-PromptWire-Key header. Must match PROMPTWIRE_API_KEY on the remote server. Required for all remote write operations. |
Sync directory
| Variable | Required | Default | Description |
PW_SYNC_DIR | No | PW_PATH/.pw-sync | Override the location of schema files and named site configs. Schema lives at PW_SYNC_DIR/schema/, site configs at PW_SYNC_DIR/sites/. If not set, defaults to .pw-sync/ under PW_PATH (or the current working directory if PW_PATH is also unset). |
Server-side variables
These are set on the remote ProcessWire server, not in mcp.json:
| Variable | Where | Description |
PROMPTWIRE_API_KEY | site/config-promptwire.php or environment | The API secret. Must match PW_REMOTE_KEY in your local config. |
PROMPTWIRE_ALLOWED_IPS | site/config-promptwire.php | Optional comma-separated list of allowed client IPs. If not set, any IP can authenticate with a valid key. |
Precedence rules
- When both
PW_PATH and PW_REMOTE_URL are set, local wins for reads. All inspection and query commands use the local PHP CLI. Remote is only used for operations that explicitly target it (push with targets: "remote", file sync, schema compare).
- When only
PW_REMOTE_URL is set, all commands run remotely via HTTP.
- When only
PW_PATH is set, everything runs locally. Remote push/file sync is not available.