Prerequisites
- asdf: Version manager for managing Python, Node.js, and uv versions
- uv: Fast Python package installer and resolver
- Git (for cloning the repository)
- A PagerDuty User API Token (see Prerequisites)
Installation Steps
1. Clone the Repository
Clone the PagerDuty MCP Server repository to your local machine:2. Install asdf Plugins
Install the required asdf plugins for Python, Node.js, and uv:3. Install Tool Versions
Install the tool versions specified in the.tool-versions file:
.tool-versions file and installs the correct versions of Python, Node.js, and uv.
4. Create Virtual Environment and Install Dependencies
Useuv to create a virtual environment and install dependencies:
- Creates a virtual environment in
.venv/ - Installs all project dependencies
- Installs the
pagerduty_mcppackage in editable mode
5. Ensure uv is Available Globally
The MCP server can be run from different places, souv needs to be available globally. Follow the official uv installation documentation.
You may need to restart your terminal and/or VS Code for the changes to take effect.
Running Locally with uv
To run your cloned PagerDuty MCP Server, update your MCP client configuration to useuv instead of uvx.
Claude Desktop Configuration Example
Replace
/path/to/your/mcp-server-directory with the full path to the directory where you cloned the MCP server, e.g., /Users/yourname/code/mcp-serverConfiguration Details
- —directory: Specifies the directory containing your local clone
- —enable-write-tools: Enables write operations, allowing you to create incidents, schedule overrides, and more
- PAGERDUTY_API_HOST: Use
https://api.eu.pagerduty.comif your PagerDuty account is in the EU region
Development Workflow
The project includes aMakefile with useful development commands:
Running Tests
Run all unit tests:Running Tests with Coverage
Generate a coverage report:HTML Coverage Report
Generate an HTML coverage report:htmlcov/index.html in your browser.
Linting
Run linting checks:Code Formatting
Format code automatically:Run All Checks
Run linting and tests with coverage:Clean Generated Files
Remove generated files and caches:Install Development Dependencies
Install additional development dependencies:Debugging the MCP Server
You can debug the MCP server using the MCP Inspector:Available Make Commands
Here’s a quick reference of all available Make commands:| Command | Description |
|---|---|
make test | Run all unit tests |
make test-coverage | Run tests with coverage report |
make test-html-coverage | Run tests with HTML coverage report |
make clean | Clean up generated files |
make install | Install dependencies |
make dev-install | Install development dependencies |
make lint | Run linting checks |
make format | Format code |
make check | Run all checks (lint, format, test) |
make debug | Start MCP server debugging session |
Troubleshooting
asdf Command Not Found
Ifasdf is not found, install it following the official asdf installation guide.
Python Version Mismatch
Ensureasdf install completed successfully and that the correct Python version is active:
uv sync Fails
Ifuv sync fails:
- Ensure asdf has installed the correct tool versions
- Check that you’re in the project directory
- Try running
uv syncwith verbose output:uv sync -v
Tests Failing
If tests fail:- Ensure all dependencies are installed:
uv sync - Check that your API key is valid (if required for tests)
- Run tests with verbose output:
uv run python -m pytest tests/ -vv
Import Errors
If you encounter import errors when running the server:- Ensure the virtual environment is activated
- Verify the package is installed in editable mode:
uv sync - Check that you’re using the correct Python version