Configuration
Setting up your .cursor/mcp.json, environment variables, and multi-site configuration.
MCP server configuration
All PromptWire configuration lives in your .cursor/mcp.json file. Each MCP server entry maps to one ProcessWire site.
Local site
For a local development site:
{
"mcpServers": {
"PromptWire: My Site (Local)": {
"command": "node",
"args": ["/path/to/site/modules/PromptWire/mcp-server/dist/index.js"],
"env": {
"PW_PATH": "/path/to/processwire",
"PHP_PATH": "/path/to/php"
}
}
}
}
| Setting | What it is |
|---|---|
"PromptWire: My Site (Local)" | A label of your choice. This name appears in Cursor's MCP panel so you can identify which site you're working with. |
command | The runtime that starts the MCP server. Always "node". |
args | The absolute path to the compiled MCP server entry point (mcp-server/dist/index.js) inside your PromptWire module directory. |
PW_PATH | The absolute path to your ProcessWire install root — the directory containing site/ and wire/. |
PHP_PATH | The absolute path to your PHP binary. Optional if php is already on your system PATH. Run which php to find it. |
When PW_PATH is set, all commands run locally via the PHP CLI. This is the fastest mode and requires no network access.
Remote site
For a production or staging site you access over HTTPS, set PW_REMOTE_URL and PW_REMOTE_KEY instead:
{
"mcpServers": {
"PromptWire: My Site (Production)": {
"command": "node",
"args": ["/path/to/site/modules/PromptWire/mcp-server/dist/index.js"],
"env": {
"PW_REMOTE_URL": "https://www.example.com/promptwire-api.php",
"PW_REMOTE_KEY": "your-api-key-here"
}
}
}
}
See Remote Setup for how to deploy the API endpoint on your production server.
Hybrid (local + remote)
If you set both PW_PATH and PW_REMOTE_URL, reads always use the local CLI. The remote endpoint is only called for explicit remote operations: pushing content to production, publishing pages remotely, syncing files, and comparing schemas.
This is the recommended setup for active development: fast local reads with the ability to push to production when ready.
Multiple sites
Add a separate MCP server entry for each site. Cursor shows all configured servers in its MCP panel, and you can address them by name in chat.
{
"mcpServers": {
"PromptWire: Client Site (Local)": {
"command": "node",
"args": ["/path/to/client-site/site/modules/PromptWire/mcp-server/dist/index.js"],
"env": {
"PW_PATH": "/path/to/client-site"
}
},
"PromptWire: Client Site (Production)": {
"command": "node",
"args": ["/path/to/client-site/site/modules/PromptWire/mcp-server/dist/index.js"],
"env": {
"PW_REMOTE_URL": "https://client.example.com/promptwire-api.php",
"PW_REMOTE_KEY": "client-api-key"
}
}
}
}
Named remote sites for schema comparison
Why this exists
The pw_schema_compare tool compares the field and template structure of two sites in a single operation — for example, "has my local site added fields that production doesn't have yet?" For this to work, the tool needs access to both sites from within a single MCP server connection.
How the other approaches handle this
Two separate MCP server entries (e.g. one for Local, one for Production) won't work for schema comparison. Each entry is an independent connection — the AI agent talks to one at a time and cannot cross-reference the other.
A hybrid entry (both PW_PATH and PW_REMOTE_URL on one server) handles this perfectly for a two-environment setup. The tool reads the local schema via the CLI and the remote schema via HTTPS, then diffs them. This is the simplest approach if you only have local and production.
When you need named sites
Named site configs are useful when you have three or more environments — for example, local, staging, and production — and want to compare any two of them. Rather than creating every possible hybrid combination in mcp.json, you define each remote environment once and reference it by name.
Create a JSON config file for each remote environment in .pw-sync/sites/:
// .pw-sync/sites/staging.json
{
"name": "staging",
"label": "Staging",
"url": "https://staging.example.com/promptwire-api.php",
"key": "staging-api-key"
}
// .pw-sync/sites/production.json
{
"name": "production",
"label": "Production",
"url": "https://www.example.com/promptwire-api.php",
"key": "production-api-key"
}
Then ask the agent to compare any combination:
Compare my local schema against staging.
Compare staging against production.
The pw_schema_compare tool loads the named config, connects to that environment, and diffs the schemas.
Security note
These config files contain API keys. Keep the .pw-sync/ directory out of version control and exclude it from production deployments. See Security — Deployment exclusions for details.
Environment variables reference
For a full list of all environment variables and their defaults, see Environment Variables.