ebpf-mcpのロゴ

ebpf-mcp

コミュニティ
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.

公開者sameehj
リポジトリebpf-mcp
言語Go
フォーク
5
スター
23
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

    ebpf-mcpは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには23件のスターと5件のフォークがあります。

🐝 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.

インストール

TypingMind
前提条件:

Node.js 18+

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

ebpf-mcpのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度ebpf-mcpに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

ebpf-mcpをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. ebpf-mcpのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "sameehj-ebpf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ebpf-mcp"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてebpf-mcpのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. ebpf-mcpのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
ebpf-mcpを使ってこのタスクを手伝ってもらえますか?
ebpf-mcp
はい、読みました。
ebpf-mcpで調べた結果をお伝えします。

よくある質問

ebpf-mcp MCPサーバーは何に使いますか?

ebpf-mcpは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでebpf-mcp MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでebpf-mcpを利用できます。

TypingMindでebpf-mcp MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。ebpf-mcpを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

ebpf-mcp MCPをTypingMindに接続するにはどうすればよいですか?

ebpf-mcpはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでebpf-mcp MCPのどのようなツールを利用できますか?

ebpf-mcpはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

ebpf-mcp MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。ebpf-mcpで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇