Skip to main content

Environment Variables

The PagerDuty MCP Server uses the following environment variables.

Requiredโ€‹

VariableDescription
PAGERDUTY_USER_API_KEYYour PagerDuty User API Token. See Authentication.

Optionalโ€‹

VariableDefaultDescription
PAGERDUTY_API_HOSThttps://api.pagerduty.comPagerDuty API endpoint. Set to https://api.eu.pagerduty.com for EU accounts.
MCP_HOST127.0.0.1Host 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_PORT8000Port 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