ebpf-mcp logo

ebpf-mcp

Community
sameehj

ebpf-mcp is a secure Model Context Protocol (MCP) server that exposes a minimal set of structured tools to interact with eBPF — optimized for safe AI control, automation agents, and human operators.

Publishersameehj
Repositoryebpf-mcp
LanguageGo
Forks
5
Stars
23
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    ebpf-mcp 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

    23 stars and 5 forks from the linked repository.

🐝 ebpf-mcp: AI-Compatible eBPF Control via Model Context Protocol

A secure, minimal, and schema-enforced MCP server for eBPF — purpose-built for AI integration, kernel introspection, and automation.

Version MCP Compatible eBPF Support License: GPL v2 (eBPF) License: Apache 2.0 (Core)


🧠 What Is This?

ebpf-mcp is a secure Model Context Protocol (MCP) server that exposes a minimal set of structured tools to interact with eBPF — optimized for safe AI control, automation agents, and human operators.

It enables loading, attaching, introspecting, and streaming eBPF programs — all through strict JSON Schema contracts validated at runtime. No REST APIs, no shell escapes, and no bpftool wrappers.


🚀 Quick Start

📦 One-liner Installation

bash
# Install ebpf-mcp server
curl -fsSL https://raw.githubusercontent.com/sameehj/ebpf-mcp/main/install.sh | sudo bash

# Start the service (runs on port 8080 by default)
sudo systemctl start ebpf-mcp
sudo systemctl enable ebpf-mcp

# Get your auth token
cat /etc/ebpf-mcp-token

# Check service status
sudo systemctl status ebpf-mcp

# View logs if needed
sudo journalctl -u ebpf-mcp -f

For air-gapped or development environments:

bash
git clone https://github.com/sameehj/ebpf-mcp.git
cd ebpf-mcp
sudo ./install.sh v1.0.2

🧪 Test the Installation

bash
# Run the complete test suite
cd scripts/
chmod +x test-ebpf-mcp-server.sh
./test-ebpf-mcp-server.sh <your-token>

If no token is provided, the script will prompt for it interactively.


🤖 Claude CLI Integration

Once installed, connect Claude to your eBPF server (runs on port 8080):

bash
# Add MCP server to Claude CLI
claude mcp add ebpf http://localhost:8080/mcp \
  -t http \
  -H "Authorization: Bearer $(cat /etc/ebpf-mcp-token)"

# Start Claude with eBPF tools
claude --debug

# Optional: Test with MCP Inspector (requires Node.js)
npx @modelcontextprotocol/inspector http://localhost:8080/mcp

📘 Tutorials

Looking to get started in specific environments or with Cursor IDE?

🧰 VirtualBox Setup Guide

Learn how to configure and run ebpf-mcp inside a VirtualBox VM, with port forwarding, SSH access, and practical tips.

🖥️ Cursor IDE + eBPF-MCP Integration

Step-by-step guide for running the eBPF MCP server with Cursor IDE for AI-driven observability.

Example prompts:

  • > Get system info and kernel version
  • > Load and attach a kprobe program to monitor sys_execve
  • > Show me all active eBPF programs and their types
  • > Stream events from ringbuffer maps for 10 seconds
  • > Trace kernel errors for the next 5 seconds

📥 Install Options

MethodCommandUse Case
One-linercurl ... | sudo bashProduction systems
Manualgit clone && sudo ./install.shDevelopment/air-gapped
Build from sourcemake buildCustom modifications
DockerComing soonContainerized environments

🔧 Minimal Toolset

Each tool is designed to be schema-validatable, AI-orchestrable, and safe-by-default. They cover 80%+ of real-world observability and control workflows.

Tool NameStatusDescriptionCapabilities Required
info✅System introspection: kernel, arch, BTFCAP_BPF or none (read-only)
load_program✅Load and validate .o files (CO-RE supported)CAP_BPF or CAP_SYS_ADMIN
attach_program✅Attach program to XDP, kprobe, tracepoint hooksDepends on type (e.g. CAP_NET_ADMIN for XDP)
inspect_state✅List programs, maps, links, and tool metadataCAP_BPF (read-only)
stream_events✅Stream events from ringbuf/perfbuf mapsCAP_BPF (read-only)
trace_errors✅Monitor kernel tracepoints for error conditionsCAP_BPF (read-only)

All tools return structured JSON output — AI-ready, streaming-compatible, and schema-validated.

🔍 See docs/TOOL_SPECS.md for full schema definitions.


🚀 What You Can Do

  • ✅ Query kernel version, architecture, and BTF availability
  • ✅ Load programs from disk or inline base64 with optional BTF
  • ✅ Attach to live systems with type-safe constraints
  • ✅ Inspect pinned objects, kernel version, verifier state
  • ✅ Stream real-time events with filtering by pid/comm/cpu
  • ✅ Trace kernel errors and system anomalies
  • ✅ Discover available tools and their schemas
  • ✅ Integrate with Claude, Ollama, or MCP-compatible clients

🛡️ Security Model

LayerControls
eBPF executionKernel verifier + resource caps
FilesystemNo shell, no exec, path-validated
Runtime isolationSession-scoped cleanup, strict inputs
AI safetyCapability-aware schemas + output limits
AuthenticationBearer token + HTTPS ready

🧼 All resources are automatically cleaned up when a client disconnects (no manual unload/detach required unless pinned).


📦 Project Structure

.
├── cmd/              # MCP server + CLI client
├── internal/         # Core logic: eBPF, tools, kernel adapters
├── pkg/types/        # JSON schema bindings + shared types
├── docs/             # Tool specs, design notes, schemas
├── scripts/          # Install script + test suite
└── schemas/          # JSON Schema files for each tool

🧠 Advanced Design Notes

✅ Lifecycle Management

  • 🔒 No manual detach: Links are closed automatically unless pinned
  • 🧹 Auto cleanup: FDs and memory are released on disconnect
  • 📎 Pinning: Optional pin paths (/sys/fs/bpf/...) for maps/programs/links

🤖 AI Tooling Compatibility

  • All tools are strictly typed with published schemas and return structured JSON output
  • AI-ready: No parsing required — direct integration with language models
  • Streaming-compatible: Real-time data flows for observability workflows
  • Responses include:
    • tool_version
    • verifier_log (for debugging)
    • Structured error with context

🔗 Extensibility

Future optional tools:

  • pin_object / unpin_object
  • detach_link
  • map_batch_op

These are omitted from the default for security and simplicity.


📚 References

🧪 See scripts/test-ebpf-mcp-server.sh for full validation suite.

Basic Architecture:

Claude / Ollama / AI Client
          ↓
     MCP JSON-RPC
          ↓
   ebpf-mcp server
          ↓
     Kernel APIs

📜 Licensing

ComponentLicense
internal/ebpf/GPL-2.0
Everything elseApache-2.0

✉️ Contact

📬 GitHub – sameehj/ebpf-mcp 🛠 Contributions, issues, and PRs welcome!


Structured. Safe. Schema-native. ebpf-mcp brings eBPF to the age of AI.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "sameehj-ebpf-mcp": {
      "command": "",
      "args": []
    }
  }
}

Use ebpf-mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once ebpf-mcp 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 ebpf-mcp 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 ebpf-mcp 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": {
    "sameehj-ebpf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ebpf-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the ebpf-mcp 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 ebpf-mcp 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 ebpf-mcp to help me with this task?
ebpf-mcp
Sure. I read it.
Here is what I found using ebpf-mcp.

Frequently asked questions

What is the ebpf-mcp MCP server used for?

ebpf-mcp 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 ebpf-mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use ebpf-mcp 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 ebpf-mcp 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 ebpf-mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect ebpf-mcp MCP to TypingMind?

ebpf-mcp 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 ebpf-mcp MCP provide in TypingMind?

ebpf-mcp 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 ebpf-mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If ebpf-mcp 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 👇