Logo vun ebpf-mcp

ebpf-mcp

Communautéit
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.

Editeursameehj
Repositoryebpf-mcp
SproochGo
Forks
5
Stären
23
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzApache-2.0
Linken
  • Tools mat KI-Workflows verbannen

    ebpf-mcp stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    23 Stären an 5 Forks aus dem verlinkte 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.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

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

ebpf-mcp MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal ebpf-mcp verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

ebpf-mcp als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu ebpf-mcp an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "sameehj-ebpf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ebpf-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu ebpf-mcp. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu ebpf-mcp.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat ebpf-mcp?
ebpf-mcp
Jo. Ech hunn et gelies.
Dat hunn ech mat ebpf-mcp fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server ebpf-mcp benotzt?

ebpf-mcp ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech ebpf-mcp MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir ebpf-mcp mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat ebpf-mcp MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann ebpf-mcp verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech ebpf-mcp MCP mat TypingMind?

ebpf-mcp leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt ebpf-mcp MCP an TypingMind zur Verfügung?

ebpf-mcp stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir ebpf-mcp MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann ebpf-mcp eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇