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
๐ Installation
pip install pcp-mcp
Or with uv:
uv add pcp-mcp
๐ Requirements
- Python: 3.10+
- PCP: Performance Co-Pilot with
pmcdandpmproxyrunning# 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": "pcp-mcp"
}
}
}
For remote monitoring:
{
"mcpServers": {
"pcp": {
"command": "pcp-mcp",
"args": ["--target-host", "webserver1.example.com"]
}
}
}
๐ ๏ธ 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 usagequery_metrics- Fetch current values for specific PCP metricssearch_metrics- Discover available metrics by name patterndescribe_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 summarypcp://metrics/common- Catalog of commonly used metricspcp://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_HOSTto 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pcp_mcp-1.0.1.tar.gz.
File metadata
- Download URL: pcp_mcp-1.0.1.tar.gz
- Upload date:
- Size: 31.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d8b037b2a650afd9e52bcb3b9297f288d1909e481a0b97c5db836866c3bab1
|
|
| MD5 |
de72724ccf56f4fbe16ca5126d24d44a
|
|
| BLAKE2b-256 |
512deca9d6686fd9ad556d48033e2472c5214dd268f3f9042be3984203709f55
|
Provenance
The following attestation bundles were made for pcp_mcp-1.0.1.tar.gz:
Publisher:
release.yml on major/pcp-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pcp_mcp-1.0.1.tar.gz -
Subject digest:
75d8b037b2a650afd9e52bcb3b9297f288d1909e481a0b97c5db836866c3bab1 - Sigstore transparency entry: 835255844
- Sigstore integration time:
-
Permalink:
major/pcp-mcp@4df7e4fba37dcafc5e434a7a4bfd34da290478e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/major
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4df7e4fba37dcafc5e434a7a4bfd34da290478e8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pcp_mcp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pcp_mcp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 41.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7781538b024ab2951dc77c6ce569540c6cba60f5585ed813550ca719312112f
|
|
| MD5 |
b65414610f44d5db68f215e98d481733
|
|
| BLAKE2b-256 |
3dd36efdd74051abaa2d605303cad21861e8fb628edd2abdeef222afb3bad253
|
Provenance
The following attestation bundles were made for pcp_mcp-1.0.1-py3-none-any.whl:
Publisher:
release.yml on major/pcp-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pcp_mcp-1.0.1-py3-none-any.whl -
Subject digest:
e7781538b024ab2951dc77c6ce569540c6cba60f5585ed813550ca719312112f - Sigstore transparency entry: 835255877
- Sigstore integration time:
-
Permalink:
major/pcp-mcp@4df7e4fba37dcafc5e434a7a4bfd34da290478e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/major
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4df7e4fba37dcafc5e434a7a4bfd34da290478e8 -
Trigger Event:
push
-
Statement type: