Skip to main content

MCP server for Performance Co-Pilot

Project description

pcp-mcp

MCP server for Performance Co-Pilot (PCP) metrics.

Query system performance metrics via the Model Context Protocol - CPU, memory, disk I/O, network, processes, and more.

๐Ÿ“– Full Documentation | ๐Ÿš€ Getting Started

CI codecov PyPI version Python 3.10+ License: MIT

๐Ÿš€ Quick Start (No Install)

Run immediately with uvx โ€” no installation required:

uvx pcp-mcp

Or install as a persistent global tool:

uvx tool install pcp-mcp
pcp-mcp

๐Ÿ“ฆ Installation

pip install pcp-mcp

Or with uv:

uv add pcp-mcp

๐Ÿ“‹ Requirements

  • Python: 3.10+
  • PCP: Performance Co-Pilot with pmcd and pmproxy running
    # Fedora/RHEL/CentOS
    sudo dnf install pcp
    sudo systemctl enable --now pmcd pmproxy
    
    # Ubuntu/Debian
    sudo apt install pcp
    sudo systemctl enable --now pmcd pmproxy
    

โš™๏ธ Configuration

Configure via environment variables:

Variable Description Default
PCP_HOST pmproxy host localhost
PCP_PORT pmproxy port 44322
PCP_TARGET_HOST Target pmcd host to monitor localhost
PCP_USE_TLS Use HTTPS for pmproxy false
PCP_TLS_VERIFY Verify TLS certificates true
PCP_TLS_CA_BUNDLE Path to custom CA bundle (optional)
PCP_TIMEOUT Request timeout (seconds) 30
PCP_USERNAME HTTP basic auth user (optional)
PCP_PASSWORD HTTP basic auth password (optional)
PCP_ALLOWED_HOSTS Hostspecs allowed via host param (optional)

๐ŸŽฏ Usage

Monitor localhost (default)

pcp-mcp

Monitor a remote host

PCP_TARGET_HOST=webserver1.example.com pcp-mcp

Or use the CLI flag:

pcp-mcp --target-host webserver1.example.com

Connect to remote pmproxy

PCP_HOST=metrics.example.com pcp-mcp

Use SSE transport

pcp-mcp --transport sse

๐Ÿ”Œ MCP Client Configuration

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "pcp": {
      "command": "uvx",
      "args": ["pcp-mcp"]
    }
  }
}

For remote monitoring:

{
  "mcpServers": {
    "pcp": {
      "command": "uvx",
      "args": ["pcp-mcp", "--target-host", "webserver1.example.com"]
    }
  }
}

๐Ÿ’ก Using uvx means you don't need pcp-mcp installed โ€” it runs directly from PyPI.

๐Ÿ› ๏ธ Available Tools

System Monitoring

  • get_system_snapshot - Point-in-time system overview (CPU, memory, disk, network, load)
  • get_process_top - Top processes by CPU, memory, or I/O usage
  • query_metrics - Fetch current values for specific PCP metrics
  • search_metrics - Discover available metrics by name pattern
  • describe_metric - Get detailed metadata about a metric

Example Queries

"What's the current CPU usage?"
โ†’ Uses get_system_snapshot

"Show me the top 10 processes by memory usage"
โ†’ Uses get_process_top(sort_by="memory", limit=10)

"What metrics are available for network traffic?"
โ†’ Uses search_metrics(pattern="network")

"Get detailed info about kernel.all.load"
โ†’ Uses describe_metric(name="kernel.all.load")

๐Ÿ“š Resources

Browse metrics via MCP resources:

  • pcp://health - Quick system health summary
  • pcp://metrics/common - Catalog of commonly used metrics
  • pcp://namespaces - Live-discovered metric namespaces

๐Ÿ’ก Use Cases

Performance Troubleshooting

Ask Claude to:

  • "Analyze current system performance and identify bottlenecks"
  • "Why is my disk I/O so high?"
  • "Which processes are consuming the most CPU?"

System Monitoring

  • "Give me a health check of the production server"
  • "Compare CPU usage over the last minute"
  • "Monitor network traffic on eth0"

Capacity Planning

  • "What's the memory utilization trend?"
  • "Show me disk usage across all filesystems"
  • "Analyze process resource consumption patterns"

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   LLM   โ”‚ โ—„โ”€MCPโ”€โ–บ โ”‚ pcp-mcp โ”‚ โ—„โ”€HTTPโ”€โ–บ โ”‚ pmproxy โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  pmcd   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                         (REST API)          (metrics)
  • pcp-mcp: FastMCP server exposing PCP metrics via MCP tools
  • pmproxy: PCP's REST API server (runs on port 44322 by default)
  • pmcd: PCP metrics collector daemon
  • Remote monitoring: Set PCP_TARGET_HOST to query a different pmcd instance via pmproxy

๐Ÿ”ง Development

# Install dependencies
uv sync --dev

# Run all checks
make check

# Individual commands
make lint       # ruff check
make format     # ruff format
make typecheck  # ty check
make test       # pytest with coverage

๐Ÿ“– Documentation

Full documentation at https://major.github.io/pcp-mcp

๐Ÿ“„ License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcp_mcp-1.3.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcp_mcp-1.3.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file pcp_mcp-1.3.0.tar.gz.

File metadata

  • Download URL: pcp_mcp-1.3.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pcp_mcp-1.3.0.tar.gz
Algorithm Hash digest
SHA256 a5bc0212594ddfdc65ecdddd9fac0408fe62201cbc420a834e49605137fe76f5
MD5 f74921e7e93da320e394d01b0ed8f2e5
BLAKE2b-256 b4201b3833b948d3bdd0e9b1693e4b345202d4ca266c61baa757c996c3f7658a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pcp_mcp-1.3.0.tar.gz:

Publisher: release.yml on major/pcp-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pcp_mcp-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: pcp_mcp-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pcp_mcp-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7bc3f6e1570eca40edcb87d6a83d3b41c1e2555b33184fb12701ae1dbdae32b
MD5 40a9bfaf6095b23c1433d6dd9c0c73cf
BLAKE2b-256 acd384a9d9d5d10bb65434d5f5ac5117626d79ba8dbe986bdb9208a1d15da833

See more details on using hashes here.

Provenance

The following attestation bundles were made for pcp_mcp-1.3.0-py3-none-any.whl:

Publisher: release.yml on major/pcp-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page