Docs PromptWire Version 1.x Environment Variables

Environment Variables

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

VariableRequiredDefaultDescription
PW_PATHYes (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_PATHNophpPath 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_PATHNoPW_PATH/site/modules/PromptWire/bin/promptwire.phpOverride path to the CLI entrypoint. Useful if the module is installed in a non-standard location or symlinked.

Remote variables

VariableRequiredDefaultDescription
PW_REMOTE_URLYes (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_KEYYes (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

VariableRequiredDefaultDescription
PW_SYNC_DIRNoPW_PATH/.pw-syncOverride 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:

VariableWhereDescription
PROMPTWIRE_API_KEYsite/config-promptwire.php or environmentThe API secret. Must match PW_REMOTE_KEY in your local config.
PROMPTWIRE_ALLOWED_IPSsite/config-promptwire.phpOptional 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.