Development Setup
This guide covers setting up a local development environment for the PagerDuty MCP Server.
Prerequisitesโ
- Python 3.12
uvpackage manager- A PagerDuty account with API access
Clone the Repositoryโ
git clone https://github.com/PagerDuty/pagerduty-mcp-server.git
cd pagerduty-mcp-server
Install Dependenciesโ
uv sync --dev
Configure Environmentโ
cp .env.example .env
# Edit .env and add your PAGERDUTY_USER_API_KEY
Run the Server Locallyโ
uv run python -m pagerduty_mcp
With write tools:
uv run python -m pagerduty_mcp --enable-write-tools
Development Commandsโ
| Command | Description |
|---|---|
make test | Run all unit tests |
make test-coverage | Run tests with coverage report |
make lint | Run ruff linter |
make format | Auto-format code with ruff |
make check | Run all checks (lint + test-coverage) |
make debug | Start MCP Inspector for debugging |
Running Testsโ
make test
MCP Inspectorโ
The MCP Inspector is a debugging tool for testing MCP servers interactively:
make debug
This starts the inspector at http://localhost:5173.
Project Structureโ
pagerduty_mcp/
โโโ server.py # FastMCP server setup
โโโ tools/ # One file per domain (14 domains)
โโโ models/ # Pydantic models for validation
โโโ context/ # MCP context management