perf-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@perf-mcpShow top CPU consumers from ./perf.data"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
perf-mcp
MCP server for Linux perf. Gives LLMs structured access to perf report, perf script, perf annotate, and 23 other perf analysis commands through typed tool parameters.
Operates on existing perf.data files only -- no recording, no system modification.
Requirements
Linux with
perfinstalled (perf --version)Python 3.12+
Related MCP server: systerd-lite
Quick Start
git clone <repo-url> ~/work/perf-mcp
cd ~/work/perf-mcp
uv syncClaude Code
Add to .mcp.json (project or global):
{
"mcpServers": {
"perf-mcp": {
"command": "uv",
"args": ["run", "--directory", "<path-to-perf-mcp>", "perf-mcp"]
}
}
}Replace <path-to-perf-mcp> with the absolute path to your clone.
Other MCP Clients
Run as a stdio MCP server:
cd ~/work/perf-mcp
uv run perf-mcpConfiguration
Environment Variable | Default | Description |
|
| Path to the perf binary |
|
| Command timeout in seconds (max 300) |
|
| Output truncation limit (bytes) |
Set via the env key in .mcp.json:
{
"mcpServers": {
"perf-mcp": {
"command": "uv",
"args": ["run", "--directory", "<path>", "perf-mcp"],
"env": {
"PERF_TIMEOUT": "120"
}
}
}
}Tools
26 tools across 7 categories. Each wraps a perf subcommand with every CLI option exposed as a typed parameter.
Core Analysis
Tool | Command | What it does |
|
| List recorded events (start here) |
|
| Overhead histogram by symbol/DSO/thread |
|
| Raw per-sample event dump |
|
| Source/assembly with per-line hit counts |
|
| Compare two profiles side-by-side |
|
| False sharing / cache contention |
|
| Decode Intel PT, inject build IDs |
Scheduler
Tool | Command |
| Per-task scheduling latency stats |
| Timestamped context switch timeline |
| ASCII CPU activity map |
| Raw scheduler event dump |
| Replay scheduling for simulation |
Locks
Tool | Command |
| Lock acquire/contention statistics |
| Contention analysis with BPF support |
| Lock type information |
Kernel Work Items
Tool | Command |
| IRQ/softirq/workqueue statistics |
| Work item latency breakdown |
| Timestamped work item events |
| Top work items by runtime |
Memory, KVM, Utilities
Tool | Command |
| Kernel memory allocation stats |
| Memory access data source analysis |
| KVM VM exit statistics |
| Generate scheduling timechart SVG |
| List binary build IDs |
| Convert perf.data to JSON/CTF |
| Kernel symbol lookup |
Typical Workflow
Record a profile (outside this tool):
perf record -g -a -- sleep 10Ask the LLM to analyze it:
"What events are in
./perf.data?" -- callsperf_evlist"Show the top CPU consumers" -- calls
perf_report"Annotate the hottest function" -- calls
perf_annotate"Show the raw samples for
malloc" -- callsperf_scriptwithsymbols='malloc'"Compare before and after" -- calls
perf_diff
Safety
Read-only -- no recording or data modification commands
Path validation -- input/output paths validated,
/proc/sys/dev/etcblockedNo code execution --
--script,--dlfilter,--objdump,--addr2lineoptions excludedTimeout enforcement -- processes killed after the configured limit
Output truncation -- large outputs capped with a clear marker
No shell -- all commands use
subprocess.exec(no shell injection)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/walac/perf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server