MCPtrace logo

MCPtrace

Organization
eunomia-bpf

MCP server: using eBPF to tracing your kernel

Publishereunomia-bpf
RepositoryMCPtrace
LanguagePython
Forks
10
Stars
75
Available tools
0
Transport typestdio
LicenseMIT
Links
  • Connect tools to AI workflows

    MCPtrace exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    75 stars and 10 forks from the linked repository.

bpftrace MCP Server: generate eBPF to trace linux kernel

A minimal MCP (Model Context Protocol) server that provides AI assistants with access to bpftrace kernel tracing capabilities.

Now implemented in Rust using the rmcp crate for better performance and type safety. The Python implementation is still available in the git history.

bpftrace MCP Server Demo

Features

  • AI-Powered Kernel Debugging: Enable AI assistants to help you debug complex Linux kernel issues through natural language - no eBPF expertise required
  • Discover System Trace Points: Browse and search through thousands of kernel probes to find exactly what you need to monitor - from system calls to network packets
  • Rich Context and Examples: Access a curated collection of production-ready bpftrace scripts for common debugging scenarios like performance bottlenecks, security monitoring, and system troubleshooting
  • Secure Execution Model: Run kernel traces safely without giving AI direct root access - MCPtrace acts as a secure gateway with proper authentication
  • Asynchronous Operation: Start long-running traces and retrieve results later - perfect for monitoring production issues that occur intermittently
  • System Capability Detection: Automatically discover what tracing features your kernel supports, including available helpers, map types, and probe types

Why MCPtrace?

Debugging kernel issues traditionally requires deep eBPF expertise. MCPtrace changes that.

By bridging AI assistants with bpftrace (the perfect eBPF tracing language), MCPtrace lets you debug complex system issues through natural conversation. Just describe what you want to observe - "show me which processes are opening files" or "trace slow disk operations" - and let AI generate the appropriate kernel traces.

AI never gets root access. MCPtrace acts as a secure gateway, and with its rich collection of example scripts and probe information, AI has everything needed to help you understand what's happening inside your kernel. No eBPF expertise required.

Installation

Prerequisites

  1. Install Rust (if not already installed):
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Ensure bpftrace is installed:
bash
sudo apt-get install bpftrace  # Ubuntu/Debian
# or
sudo dnf install bpftrace      # Fedora

Install from crates.io (Recommended)

bash
cargo install bpftrace-mcp-server

This will install the bpftrace-mcp-server binary to your Cargo bin directory (usually ~/.cargo/bin/).

Build from Source

Alternatively, you can build from source:

bash
git clone https://github.com/yunwei37/MCPtrace
cd MCPtrace
cargo build --release

The binary will be available at ./target/release/bpftrace-mcp-server.

Quick Setup

Use our automated setup scripts:

  • Claude Desktop: ./setup/setup_claude.sh
  • Claude Code: ./setup/setup_claude_code.sh

For detailed setup instructions and manual configuration, see setup/SETUP.md.

Running the Server

If installed via cargo install

bash
bpftrace-mcp-server

If built from source

bash
./target/release/bpftrace-mcp-server

Development mode (from source)

bash
cargo run --release

Manual Configuration

For manual setup instructions for Claude Desktop or Claude Code, see setup/SETUP.md.

Usage Examples

List System Call Probes

python
await list_probes(filter="syscalls:*read*")

Get BPF System Information

python
info = await bpf_info()
# Returns system info, kernel helpers, features, map types, and probe types

Execute a Simple Trace

python
result = await exec_program(
    'tracepoint:syscalls:sys_enter_open { printf("%s\\n", comm); }',
    timeout=10
)
exec_id = result["execution_id"]

Get Results

python
output = await get_result(exec_id)
print(output["output"])

Security Notes

  • The server requires sudo access for bpftrace
  • Password Handling: Create a .env file with your sudo password:
    bash
    echo "BPFTRACE_PASSWD=your_sudo_password" > .env
  • Alternative: Configure passwordless sudo for bpftrace:
    bash
    sudo visudo
    # Add: your_username ALL=(ALL) NOPASSWD: /usr/bin/bpftrace
  • No script validation - trust the AI client to generate safe scripts
  • Resource limits: 60s max execution, 10k lines buffer
  • See SECURITY.md for detailed security configuration

Architecture

The Rust server uses:

  • Tokio async runtime for concurrent operations
  • Subprocess management for bpftrace execution
  • DashMap for thread-safe in-memory buffering
  • Automatic cleanup of old buffers
  • rmcp crate for MCP protocol implementation

Limitations

  • No real-time streaming (use get_result to poll)
  • Simple password handling (improve for production)
  • No persistent storage of executions
  • Basic error handling

Documentation

Future Enhancements

  • Add SSE transport for real-time streaming
  • Implement proper authentication
  • Add script validation and sandboxing
  • Support for saving/loading trace sessions
  • Integration with eBPF programs

Use MCPtrace MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCPtrace is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCPtrace as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCPtrace MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcptrace": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCPtrace MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCPtrace MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCPtrace to help me with this task?
MCPtrace
Sure. I read it.
Here is what I found using MCPtrace.

Frequently asked questions

What is the MCPtrace MCP server used for?

MCPtrace is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCPtrace MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCPtrace with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCPtrace MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCPtrace connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCPtrace MCP to TypingMind?

MCPtrace runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCPtrace MCP provide in TypingMind?

MCPtrace exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCPtrace MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCPtrace requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇