Environment Variables
The PagerDuty MCP Server uses the following environment variables.
Requiredโ
| Variable | Description |
|---|---|
PAGERDUTY_USER_API_KEY | Your PagerDuty User API Token. See Authentication. |
Optionalโ
| Variable | Default | Description |
|---|---|---|
PAGERDUTY_API_HOST | https://api.pagerduty.com | PagerDuty API endpoint. Set to https://api.eu.pagerduty.com for EU accounts. |
MCP_HOST | 127.0.0.1 | Host to bind to for HTTP-based transports (streamable-http, sse). Set to 0.0.0.0 to listen on all interfaces. โ ๏ธ HTTP transports have no built-in auth โ only expose beyond loopback behind an authenticating proxy or on a trusted network. Not used for binding when --transport stdio (default), but a warning is emitted if set to a non-default value. |
MCP_PORT | 8000 | Port to bind to for HTTP-based transports (streamable-http, sse). Must be a valid integer โ the CLI parses the type at startup even in stdio mode. Range validation (1โ65535) only applies when using an HTTP transport. No effect at runtime when --transport stdio (default). |
Setting Variablesโ
Shellโ
export PAGERDUTY_USER_API_KEY="your-token"
export PAGERDUTY_API_HOST="https://api.eu.pagerduty.com" # EU only
MCP Client Configโ
Most clients accept an env block in their MCP server configuration:
{
"mcpServers": {
"pagerduty": {
"command": "uvx",
"args": ["pagerduty-mcp"],
"env": {
"PAGERDUTY_USER_API_KEY": "your-token",
"PAGERDUTY_API_HOST": "https://api.eu.pagerduty.com"
}
}
}
}
Dockerโ
Pass variables with -e flags:
docker run --rm -i \
-e PAGERDUTY_USER_API_KEY="your-token" \
-e PAGERDUTY_API_HOST="https://api.eu.pagerduty.com" \
ghcr.io/pagerduty/pagerduty-mcp:latest