Prerequisites
- Docker installed
- A PagerDuty User API Token (see Prerequisites)
Building the Docker Image
Build the Docker image using the following command:- Stage 1 (Builder): Installs dependencies and the project using
uv - Stage 2 (Runtime): Creates a minimal production image with only the necessary runtime files
mcp) for security.
Running in Read-Only Mode
By default, the Docker container runs in read-only mode, exposing only tools that read data:Running with Write Tools Enabled
To enable tools that can modify your PagerDuty account, use the--enable-write-tools flag:
EU Region Configuration
If your PagerDuty account is located in the EU region, set thePAGERDUTY_API_HOST environment variable:
Using with MCP Clients via Docker
To integrate the Docker container with MCP clients, use Docker as the command.Claude Desktop Example
Add the following configuration to your Claude Desktop settings:Ensure you build the image first using
docker build -t pagerduty-mcp:latest .Environment Variables
The Docker container supports the following environment variables:| Variable | Description | Default | Required |
|---|---|---|---|
PAGERDUTY_USER_API_KEY | Your PagerDuty User API Token | - | Yes |
PAGERDUTY_API_HOST | PagerDuty API host URL | https://api.pagerduty.com | No |
Environment Variable Details
- PAGERDUTY_USER_API_KEY: Your personal API token from PagerDuty
- PAGERDUTY_API_HOST: Use
https://api.eu.pagerduty.comfor EU accounts, otherwise use the default
Troubleshooting
Container Exits Immediately
If the container exits immediately, ensure you’re using the-i flag for interactive mode, as the MCP server uses stdio transport.
API Key Not Working
Verify that:- Your API key is correctly set in the environment variable
- The API key has not expired
- You’re using a User API Token (not a REST API key)
EU Region Connection Issues
If you’re getting authentication errors and your account is in the EU:- Set
PAGERDUTY_API_HOST="https://api.eu.pagerduty.com" - Verify your account region in PagerDuty settings
Health Check Failures
The Docker image includes a health check that verifies the server can start. If health checks fail:- Check container logs:
docker logs <container-id> - Verify Python dependencies are correctly installed
- Ensure the
pagerduty_mcpmodule is importable
Permission Issues
The container runs as a non-root user (mcp with UID 1000). If you encounter permission issues:
- Ensure any mounted volumes have appropriate permissions
- Check that the container can write to necessary directories