Logotipo de melisai

melisai

Comunidad
dmitriimaksimovdevelop

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

Editordmitriimaksimovdevelop
Repositoriomelisai
IdiomaGo
Forks
6
Estrellas
64
Herramientas disponibles
0
Tipo de transportestdio
Categorías
LicenciaApache-2.0
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    melisai ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    64 estrellas y 6 forks en el repositorio enlazado.

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.

Instalación

TypingMind
Requisitos:

Node.js 18+

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

Usa el MCP de melisai con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado melisai, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade melisai como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de melisai.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "dmitriimaksimovdevelop-melisai": {
      "command": "npx",
      "args": [
        "-y",
        "melisai"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de melisai y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de melisai.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar melisai para ayudarme con esta tarea?
melisai
Claro. Lo he leído.
Esto he encontrado usando melisai.

Preguntas frecuentes

¿Para qué sirve el servidor MCP melisai?

melisai es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP melisai con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar melisai con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de melisai con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con melisai conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP melisai a TypingMind?

melisai funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP melisai en TypingMind?

melisai ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP melisai?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si melisai requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇