Logo van melisai

melisai

Community
dmitriimaksimovdevelop

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

Uitgeverdmitriimaksimovdevelop
Repositorymelisai
TaalGo
Forks
6
Sterren
64
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    melisai biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    64 sterren en 6 forks in de gekoppelde repository.

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.

Installatie

TypingMind
Vereisten:

Node.js 18+

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

Gebruik melisai MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra melisai is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg melisai toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van melisai.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "dmitriimaksimovdevelop-melisai": {
      "command": "npx",
      "args": [
        "-y",
        "melisai"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van melisai in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van melisai in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je melisai gebruiken om me hiermee te helpen?
melisai
Zeker. Ik heb het gelezen.
Dit vond ik met melisai.

Veelgestelde vragen

Waarvoor wordt de MCP-server melisai gebruikt?

melisai is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik melisai MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je melisai gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom melisai MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als melisai verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik melisai MCP met TypingMind?

melisai werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt melisai MCP in TypingMind?

melisai biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om melisai MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als melisai authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇