MCP Automation
pam artisan pam:mcp starts a Model Context Protocol
server over stdio. It lets an AI assistant or automation read your
application’s health, metrics, production audit, and process state, and
(only if you allow it) trigger deploys, rollbacks, and scaling.
Connecting a Client
Section titled “Connecting a Client”Register the server in your MCP client, run from the project root:
{ "mcpServers": { "pam-laravel": { "command": "pam", "args": ["artisan", "pam:mcp"] } }}You can talk to it directly to check it starts:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | pam artisan pam:mcp{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":false}},"serverInfo":{"name":"pam-laravel","version":"dev"}}}The transport is newline-delimited JSON-RPC 2.0 on stdin and stdout.
| Tool | Kind | Returns |
|---|---|---|
pam_health |
read-only | The same report as pam:health |
pam_metrics |
read-only | The bounded metrics snapshot |
pam_check_production |
read-only | Every pam:check-production result |
pam_processes |
read-only | pam:process status rows |
pam_deploy |
destructive | Triggers deploy on a remote target |
pam_rollback |
destructive | Triggers rollback on a PAM Cloud target |
pam_scale |
destructive | Scales a process (process, instances 1..128) on PAM Cloud |
Every result is returned both as text and as structuredContent.
Enabling Mutations
Section titled “Enabling Mutations”Destructive tools are always listed, but they refuse to run until you set both:
PAM_MCP_ALLOW_MUTATIONS=truePAM_MCP_CONFIRMATION_TOKEN=a-long-random-valueEach call must then pass the exact token:
{ "jsonrpc": "2.0", "id": 7, "method": "tools/call", "params": { "name": "pam_scale", "arguments": { "target": "production", "process": "queue", "instances": 6, "confirmation": "a-long-random-value" } }}Without the setting, the call fails with:
MCP mutations are disabled. Set PAM_MCP_ALLOW_MUTATIONS=true deliberately.Checklist
Section titled “Checklist”- Generate the confirmation token from a secure random source.
- Keep it out of the repository, prompts, logs, and process lists.
- Require human review for production rollbacks and scaling.
- Record who triggered each operation and its result.
- Rotate the token if it might have leaked.