perf-mcp
Provides structured tools for analyzing performance data collected with the Linux perf tool, enabling AI agents to inspect events, generate reports, annotate code, and analyze scheduling, locking, and memory behavior.
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: MCP Filesystem Server
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": "uvx",
"args": ["--from", "git+https://github.com/walac/perf-mcp", "perf-mcp"],
"type": "stdio"
}
}
}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": "uvx",
"args": ["--from", "git+https://github.com/walac/perf-mcp", "perf-mcp"],
"type": "stdio",
"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)
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables LLMs to perform high-performance code search and analysis across multiple languages using symbol indexing, regex text search, and structural AST pattern matching. It also provides tools for technology stack detection and dependency analysis with persistent caching for optimized performance.7
- Alicense-qualityDmaintenanceProvides LLM-optimized tools for advanced code analysis, repository complexity evaluation, and call graph generation. It enables users to visualize directory structures, detect code patterns, and build semantic context with significant token savings.8MIT
- Flicense-qualityBmaintenanceEnables LLMs to safely write and run bpftrace scripts against the Linux kernel for observability, with explicit probe allowlists and execution timeout.1
- Flicense-qualityBmaintenanceWraps Intel VTune Profiler CLI as MCP tools, enabling Claude Code to analyze performance data such as hotspots, summaries, and comparisons via natural language.
Related MCP Connectors
Package intelligence MCP for AI agents — 22 tools, 19 ecosystems, AGPL SDK, free.
23 agent tools + a measured per-call model cost dataset. No key needed to start.
33 tools that make AI write, implement, and verify intent against explicit, testable constraints.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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