Skip to main content

Development Setup

This guide covers setting up a local development environment for the PagerDuty MCP Server.

Prerequisitesโ€‹

  • Python 3.12
  • uv package 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โ€‹

CommandDescription
make testRun all unit tests
make test-coverageRun tests with coverage report
make lintRun ruff linter
make formatAuto-format code with ruff
make checkRun all checks (lint + test-coverage)
make debugStart 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