home / mcp / bpftrace mcp server
MCP server: using eBPF to tracing your kernel
Configuration
View docs{
"mcpServers": {
"eunomia-bpf-mcptrace": {
"command": "bpftrace-mcp-server",
"args": [],
"env": {
"BPFTRACE_PASSWD": "YOUR_SUDO_PASSWORD"
}
}
}
}You can run a Rust-based MCP server that bridges AI assistants with bpftrace kernel tracing. It lets you discover system probes, execute traces, and retrieve results securely, without giving AI direct root access. This guide walks you through practical steps to install, run, and use the server for kernel tracing tasks.
Connect to the MCP server from your MCP client and start by listing available probes to understand what you can observe. Then pick a trace point or a ready-made script to execute a trace. You can run long-running traces and fetch results later, which is ideal for intermittent production issues. Use the information and examples provided by the server to craft traces that fit your debugging needs.
Prerequisites: install the Rust toolchain and ensure bpftrace is available on your system.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
```bash
sudo apt-get install bpftrace # Ubuntu/Debian
# or
sudo dnf install bpftrace # FedoraInstall the MCP server binary from crates.io to run directly.
cargo install bpftrace-mcp-serverIf you prefer building from source, clone the repository, build in release mode, and run the produced binary.
git clone https://github.com/yunwei37/MCPtrace
cd MCPtrace
cargo build --releaseUse the built binary to start the MCP server. Choose the standard runtime or a development run depending on your workflow.
# If installed via cargo
bpftrace-mcp-server
# If built from source
./target/release/bpftrace-mcp-server
# Development mode from source
cargo run --releaseConfigure how clients authenticate and how traces are executed by adjusting environment settings and startup options. The server supports a secure gateway model so that AI clients do not obtain direct root access. Refer to the setup instructions for specific environment variables and security considerations.
List available kernel probe points, with optional filtering to find probes that match your observability needs.
Retrieve system information including kernel helpers, features, map types, and probe types to guide trace creation.
Execute a bpftrace script or one-liner and obtain an execution identifier for later retrieval of results.
Poll for and retrieve the output of a previously started trace execution using the provided execution identifier.