melisaiのロゴ

melisai

コミュニティ
dmitriimaksimovdevelop

Single-binary Linux performance diagnostics via eBPF/BCC, built for humans and AI agents (MCP)

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

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

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

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

  • コピーして使える設定

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

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

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

melisai

[!WARNING] 🧊 Project frozen for an indefinite period. Development is paused — no new features, fixes, or releases are planned for the foreseeable future. The existing code remains available as-is.

🧊 Проект заморожен на неизвестный срок. Разработка приостановлена — новые функции, исправления и релизы в обозримом будущем не планируются. Существующий код остаётся доступным как есть.

melisai terminal demo

Your server is slow. You SSH in. Now what?

melisai answers that question in 10 seconds. Single Go binary — no agents, no daemons, no config files. It runs 67 BCC/eBPF tools + 8 procfs collectors, detects 37 anomalies, computes a health score, and tells you exactly what sysctl to change. Works standalone or as an MCP server for Claude/Cursor to diagnose servers interactively.

Go 1.23+ License BCC Coverage Tests Schema

$ sudo melisai collect --profile quick -o report.json

  melisai v0.4.1 | profile=quick | duration=10s

  Tier 1 (procfs)  ████████████████████████████████████████ 8/8   2.1s
  Tier 2 (BCC)     ████████████████████████████████████████ 4/4  10.3s

  Health Score:  68 / 100  ⚠️
  Anomalies:     cpu_utilization CRITICAL (98.7%)
                 load_average WARNING (3.2x CPUs)
  Recommendations: 2

  Report saved to report.json

Key Features

FeatureWhat it does
Health ScoreSingle 0-100 number. Green/yellow/red. AI agents use it to decide next steps
37 Anomaly RulesRate-based detection (not cumulative counters). Catches problems happening right now
35 RecommendationsCopy-paste sysctl commands with evidence. Each tagged as "fix" or "optimization"
67 BCC Tools~84% of Brendan Gregg's BPF toolkit. Histograms, events, stack traces
GPU/PCIe TopologyDetects NVIDIA GPUs, maps PCI→NUMA, flags cross-NUMA GPU-NIC pairs (30-50% DMA penalty)
Page Reclaim TrackingDirect reclaim rate, compaction stalls, THP splits — the invisible latency killers
NUMA AnalysisPer-node miss ratio, distance matrix, CPU mapping. Catches 30-50% latency penalties
Network Deep DiveConntrack, softnet, IRQ distribution, accept queue depth, 30+ TCP/UDP sysctls
MCP ServerClaude Desktop / Cursor connect over stdio. Interactive server diagnostics
Before/After DiffCompare two reports. See what improved, what regressed
Observer Effect MitigationTwo-phase collection: baselines first, then BCC tools. PID exclusion
22 Chapter DocumentationBook-level guide (EN + RU) covering CPU, memory, disk, network, GPU, NUMA, THP
Shareable Reportsmelisai share → one short URL with the diagnosis, rendered client-side. No agents to install for the reader

Real-World Diagnosis

One command. 60 seconds. Here's what melisai found on a production Docker host (8 CPUs, 32 GB RAM, HDD RAID):

Health Score: 46 / 100

Anomalies (6):
  [CRITICAL] tcp_retransmits          134/sec
  [WARNING]  disk_utilization          80.5%
  [WARNING]  cpu_psi_pressure          17.6%
  [WARNING]  io_psi_pressure           12.8%
  [WARNING]  disk_avg_latency          12.1ms
  [WARNING]  tcp_close_wait            1 socket

What melisai found that manual debugging wouldn't:

The root cause chain — HDD latency (p99=49ms) caused page reclaim pressure (PruneCalled=105), which made the kernel prune TCP buffers, triggering 31 retransmits/sec, and cascading into 226K dropped packets on the WireGuard tunnel. Four separate symptoms, one root cause.

WhatManualmelisai
Find the cascade: HDD → reclaim → tcp prune → retransmits → VPN dropsRequires years of kernel experienceAutomatic — 37 rules check it all
Know to check PruneCalled in /proc/net/netstatYou have to know it existsCollected and evaluated automatically
Identify the process eating 245% CPU + 8.6 GB RAMtop shows it, but not in contextCorrelated with health score and anomalies
Collect 17,330 stack traces for flame graphperf record + manual setupIncluded in one --profile deep run
Get copy-paste sysctl fixes with evidenceGoogle + trial and error7 recommendations with exact commands

The diagnosis: server outgrew its hardware. SSD would fix 80% of the problems. The other 20% is workload sizing.


Who Is This For?

  • SRE / DevOps — "server is slow, find out why" in one command
  • ML Engineers — GPU-NIC NUMA topology, PCIe bandwidth diagnostics
  • Database Admins — THP splits, page reclaim, dirty writeback, NUMA miss ratio
  • Platform Teams — container CPU throttling, cgroup memory pressure, K8s NUMA topology
  • AI Agents — structured JSON + MCP protocol = autonomous server diagnostics

Why Not prometheus/netdata/datadog?

melisaiMonitoring agents
DeploymentSingle binary, run onceDaemon + config + server
Time to answer10 secondsSet up dashboards, wait for data
BPF tools67 tools in one runSeparate setup per tool
RecommendationsExact sysctl commandsRaw metrics only
AI-nativeMCP server, structured JSON, AI promptRequires adapter/integration
GPU topologyCross-NUMA detectionNot typically covered
CostFree, Apache 2.0Free to $$$

melisai is not a replacement for monitoring — it's a diagnostic tool you run when something is already wrong (or to validate that everything is right).


Quick Start

bash
# Build (requires Go 1.23+, cross-compile from macOS/Linux)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o melisai ./cmd/melisai/

# Deploy and run
scp melisai root@server:/usr/local/bin/
ssh root@server "melisai collect --profile quick -o /tmp/report.json"

# Install BCC tools (first time only)
ssh root@server "melisai install"

No config files. No YAML. No environment variables.


Share a Report

melisai collect produces a 30–100 KB JSON file. melisai share turns it into one short URL you paste into Slack, an incident channel, or a Jira ticket — the recipient gets the full diagnosis rendered in their browser, no melisai install required.

bash
sudo melisai collect --profile quick -o report.json
melisai share report.json
# → https://melisai.dev/r/uJOzZUjb

Live demo (real run on a loaded server, health = 2/100): https://melisai.dev/r/uJOzZUjb

melisai share demo

Two flavours of URL, picked automatically:

ModeURL shapeWhen it's used
Short linkhttps://melisai.dev/r/Xa9bC3kpDefault. CLI POSTs the gzipped summary to melisai.dev/api/r; backend stores it in SQLite and returns the code
Fragment fallbackhttps://melisai.dev/r#H4sIAAAA...Auto-triggered when the upload fails (offline, airgapped, 5xx). The whole report rides in the URL fragment — nothing reaches a server. Force with --offline

The viewer page is static HTML+JS that decodes the payload client-side (atob + DecompressionStream); the backend is just a key→bytes store with no auth and rate-limited writes. See doc/en/16-sharing.md for the wire format and self-hosting notes.

Privacy: the payload carries hostname, kernel version, anomaly evidence and recommendation text. Treat the URL like the JSON report itself.


MCP Server — AI-Powered Diagnostics

melisai includes a built-in Model Context Protocol server. AI agents connect over stdio and interactively diagnose system performance.

Claude Desktop / Cursor config (claude_desktop_config.json):

json
{
  "mcpServers": {
    "melisai": {
      "command": "ssh",
      "args": ["root@your-server", "/usr/local/bin/melisai", "mcp"]
    }
  }
}

MCP Tools

ToolWhat it doesTime
get_healthQuick 0-100 score + anomalies. Tier 1 only~2s
collect_metricsFull profile with BCC/eBPF tools. Args: profile, focus, pid10-60s
explain_anomalyRoot causes + recommendations for any anomaly IDinstant
list_anomaliesAll 37 anomaly metric IDs with descriptionsinstant

Typical AI Workflow

Agent                              melisai
  │                                   │
  ├── get_health ──────────────────►  │  "score: 68, cpu_utilization CRITICAL"
  │                                   │
  ├── explain_anomaly ─────────────►  │  "Root causes, what to check, sysctl fixes..."
  │   anomaly_id: cpu_utilization     │
  │                                   │
  ├── collect_metrics ─────────────►  │  Full JSON: 67 BCC tools, histograms,
  │   profile: standard               │  events, stack traces, AI prompt
  │                                   │
  └── (agent analyzes & recommends)   │

How It Works

Three collection tiers with automatic fallback:

Tier 1: 8 collectors (/proc, /sys, ss, ethtool, nvidia-smi, dmesg)
        Network deep diagnostics, page reclaim & THP tracking,
        NUMA topology analysis, GPU/PCIe cross-NUMA detection
        Always works. No root needed.

Tier 2: 67 BCC tools — runqlat, biolatency, tcpconnlat, etc.
        Root + bcc-tools required. `melisai install` handles setup.

Tier 3: Native eBPF (cilium/ebpf) — tcpretrans kprobe
        Root + kernel ≥ 5.8 + BTF. Zero external dependencies.

Collection runs in two phases to eliminate observer effect:

  1. Phase 1 — Tier 1 collectors capture clean baselines
  2. Phase 2 — BCC/eBPF tools run without contaminating baselines

Report Structure

SectionContent
summary.health_scoreWeighted 0-100 score (CPU 1.5x, Memory 1.5x, Disk 1.0x, Network 1.0x)
summary.anomalies[]Detected issues with severity, metric, value, threshold
summary.resourcesUSE metrics per resource (utilization, saturation, errors)
summary.recommendations[]Exact commands with type (fix/optimization) and evidence
categories.*Raw data: histograms, events, stack traces per subsystem
ai_context.promptDynamic prompt with system context and 27 anti-patterns

Collection Profiles

ProfileDurationWhat runsBest for
quick10sTier 1 + biolatency, tcpretrans, opensnoop, oomkillHealth checks, CI gates
standard30sAll Tier 1 + all 67 BCC toolsRegular diagnostics
deep60sEverything + memleak, biostacks, wakeuptime, biotopRoot cause analysis
bash
# Quick health check
sudo melisai collect --profile quick -o report.json

# Full analysis with AI prompt
sudo melisai collect --profile standard --ai-prompt -o report.json

# Deep dive focused on disk
sudo melisai collect --profile deep --focus disk -o report.json

# Profile a specific process
sudo melisai collect --profile standard --pid 12345 -o app.json

# Profile a container
sudo melisai collect --profile standard --cgroup /sys/fs/cgroup/system.slice/nginx.service -o nginx.json

# Compare before/after a change
melisai diff before.json after.json -o diff.json

Anomaly Detection — 37 Rules

All rate-based rules use two-point sampling (delta over interval). No false positives from cumulative counters on long-uptime systems.

MetricWarningCriticalSource
cpu_utilization80%95%/proc/stat
cpu_iowait10%30%/proc/stat
load_average2x CPUs4x CPUs/proc/loadavg
memory_utilization85%95%/proc/meminfo
swap_usage10%50%/proc/meminfo
direct_reclaim_rate10/s1000/s/proc/vmstat (rate)
compaction_stall_rate1/s100/s/proc/vmstat (rate)
thp_split_rate1/s100/s/proc/vmstat (rate)
numa_miss_ratio5%20%/sys/devices/system/node
disk_utilization70%90%/proc/diskstats
disk_avg_latency5ms50ms/proc/diskstats
tcp_retransmits10/s50/s/proc/net/snmp (rate)
conntrack_usage_pct70%90%/proc/sys/net/netfilter
softnet_dropped1/s100/s/proc/net/softnet_stat (rate)
listen_overflows1/s100/s/proc/net/netstat (rate)
tcp_close_wait1100ss
tcp_rcvq_drop1/s100/s/proc/net/netstat (rate)
tcp_zero_window_drop1/s50/s/proc/net/netstat (rate)
listen_queue_saturation70%90%ss -tnl fill %
irq_imbalance5x20x/proc/softirqs (rate)
gpu_nic_cross_numa1 pair1 pairsysfs PCI NUMA
... and 16 more (BCC histograms, PSI, container, NIC, UDP)

BCC Tools — 67 Tools

~84% coverage of Brendan Gregg's BPF observability tools.

SubsystemCountTools
CPU10runqlat, runqlen, cpudist, hardirqs, softirqs, runqslower, cpufreq, cpuunclaimed, llcstat, funccount
Disk21biolatency, biosnoop, biotop, bitesize, ext4slower/dist, btrfsslower/dist, xfsslower/dist, nfsslower/dist, zfsslower/dist, fileslower, filelife, mountsnoop, mdflush, scsilatency, nvmelatency, vfsstat
Memory7cachestat, oomkill, drsnoop, shmsnoop, numamove, memleak, slabratetop
Network14tcpconnlat, tcpretrans, tcprtt, tcpdrop, tcpstates, tcpconnect, tcpaccept, tcplife, udpconnect, sofdsnoop, sockstat, skbdrop, tcpsynbl, gethostlatency
Process9execsnoop, opensnoop, killsnoop, threadsnoop, syncsnoop, exitsnoop, statsnoop, capable, syscount
Stacks6profile, offcputime, wakeuptime, offwaketime, biostacks, stackcount

24 tools support --pid filtering for per-process analysis.


Manual Usage (without AI)

bash
# Health score
jq '.summary.health_score' report.json

# All anomalies
jq '.summary.anomalies[]' report.json

# Copy-paste recommendations
jq '.summary.recommendations[] | {type, title, commands}' report.json

# Network sysctls
jq '.categories.network[0].data.sysctls' report.json

# Page reclaim pressure
jq '.categories.memory[0].data.reclaim' report.json

# NUMA miss ratio per node
jq '.categories.memory[0].data.numa_nodes[] | {node, miss_ratio, cpus}' report.json

# Top CPU processes
jq '.categories.process[0].data.top_by_cpu[:5]' report.json

# BCC histogram percentiles
jq '.categories.cpu[].histograms[]? | {name, p50, p99, max}' report.json

Documentation — 22 Chapters (EN + RU)

Comprehensive book-level guide covering Linux performance theory and melisai implementation:

ChaptersTopic
00-01Introduction, Linux fundamentals (/proc, /sys, cgroups, PSI)
02-07CPU, Memory, Disk, Network, Process, Container analysis
08-10System collector, BCC tools registry, Native eBPF
11-13Anomaly detection (37 rules), Recommendations engine, AI integration
14-17Report diffing, Orchestrator, Output formats, Appendix
18GPU & PCIe Topology — nvidia-smi, NUMA mapping, GPUDirect RDMA
19Page Reclaim & THP — watermarks, direct reclaim, compaction, THP defrag
20NUMA Optimization — distance matrix, numactl, K8s topology manager
21Production Tuning Checklist — all sysctls + one-liner tuning script

All chapters available in English and Russian: doc/en/ | doc/ru/


Architecture

cmd/melisai/           CLI (cobra) + MCP subcommand
internal/
  ├── collector/       8 Tier 1 collectors + BCC adapter + GPU/PCIe
  ├── executor/        BCC runner, security, 67 parsers, registry
  ├── ebpf/            Native eBPF loader (cilium/ebpf, CO-RE)
  ├── mcp/             MCP server (4 tools, stdio JSON-RPC)
  ├── model/           Types, USE metrics, 37 anomalies, health score
  ├── observer/        PID tracker, overhead measurement
  ├── orchestrator/    Two-phase execution, signal handling, profiles
  ├── output/          JSON, FlameGraph SVG, AI prompt generator
  ├── diff/            Report comparison engine
  └── installer/       Distro detection, package installation

Security: BCC binaries verified (root-owned, not world-writable, allowed paths only). No shell execution. Symlink resolution. Output capped at 50MB per tool.


Requirements

MinimumNotes
BuildGo 1.23+Cross-compile: GOOS=linux GOARCH=amd64
Tier 1Any Linux kernelNo root needed
Tier 2bcc-tools installedsudo melisai install handles this
Tier 3Kernel ≥ 5.8 with BTFFalls back to Tier 2 automatically

Tested Distros

Ubuntu 24.04 (full validation), Ubuntu 22.04, Debian 12, Fedora 39, CentOS Stream 9


Development

bash
go test ./... -v          # 458 tests
go test ./... -race       # with race detector
make lint                 # golangci-lint
make build                # cross-compile to linux/amd64
make test-validation      # Linux + root + stress-ng workload tests

Roadmap

  • Concurrent ethtool calls (parallel NIC enrichment)
  • --compact flag for 256+ CPU servers
  • Per-cgroup memory pressure tracking
  • AMD ROCm GPU support
  • OpenTelemetry export
  • Web UI for report visualization

Contributing

Contributions welcome! Areas where help is especially appreciated:

  • New BCC tool parsers — we're at 67/80 of Gregg's toolkit
  • AMD GPU support — ROCm equivalent of our nvidia-smi integration
  • Documentation — translations, tutorials, real-world case studies
  • Testing — malformed input edge cases, container-specific scenarios

Please open an issue first to discuss significant changes.


Troubleshooting

ProblemFix
tool "X" not foundsudo melisai install
binary "X" not owned by rootchown root:root /usr/sbin/X-bpfcc
Empty histogram dataNormal — no events during window
exit status 1 from BCC toolCheck dmesg for BPF errors

Limitations

Being honest about what melisai is not:

  • Not a monitoring system. It's a diagnostic tool — you run it when something is wrong (or to validate that everything is right). For continuous monitoring, use Prometheus/Grafana/Datadog alongside melisai.
  • No historical trends. melisai captures a point-in-time snapshot. It can't tell you "retransmits spiked yesterday at 3 PM."
  • No alerting. It doesn't run as a daemon or send notifications. Use it on-demand or via cron + MCP.
  • BCC tools need kernel headers. Some distros require linux-headers-$(uname -r) for Tier 2 tools. Tier 1 always works.
  • System-level only. melisai sees that a process uses 245% CPU, but not why inside the application. For app-level profiling, use pprof/async-profiler on the process melisai identified.
  • NVIDIA GPUs only. AMD ROCm support is on the roadmap but not implemented yet.

License

Apache License 2.0


Built on the shoulders of Brendan Gregg's BPF ecosystem, the USE Method, and cilium/ebpf.

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "dmitriimaksimovdevelop-melisai": {
      "command": "",
      "args": []
    }
  }
}

melisaiのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度melisaiに接続すれば、モデルごとに個別に設定することなく、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

melisaiをサーバーとして追加

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

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

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

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

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

よくある質問

melisai MCPサーバーは何に使いますか?

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

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

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

TypingMindでmelisai MCPを使うメリットは何ですか?

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

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

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

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

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

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

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

関連するMCPサーバー

すべて見る

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

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