Logo di Detrix

Detrix

Community
flashus

Observe any line of running code — no restarts, no code changes, production-safe

Autoreflashus
Repositorydetrix
LinguaRust
Fork
5
Stelle
23
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Detrix mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    23 stelle e 5 fork nel repository collegato.

Detrix

Give your AI agent eyes inside any running program.

  • Watch any variable at any line — agent sets an observation point in seconds, zero code changes during debugging
  • Local or cloud — same workflow for Docker containers and remote hosts
  • Python, Go, Rust — observation points capture values without pausing, without restarting
  • Built for agents — observe, query, manage observations via natural language; Claude Code, Cursor, Windsurf

Tests CI Rust Docker crates.io PyPI Go License


See It in Action

1-minute demo: A Go service in Docker starts reporting wrong numbers. Nothing in the client code changed. Claude watches it live and finds the cause.

Here's what the session looks like:

You:    "The order-service in Docker is reporting wildly inflated revenue.
         Daily total is in the thousands when transactions should be $20-200."

Agent:  → reads the source, spots dead unit-conversion code
        → wakes the service via Detrix
        → observes txn.Amount, txn.Unit, total
          (no line number — find_variable locates it in the running container)

        "Found it. The pricing API changed what it's returning.

        txn.Amount = 8957, txn.Unit = "cents" → should be $89.57, summed as $8957

        In calculateRevenue, the unit field is fetched and discarded:

        unit := txn.Unit
        _ = unit          // ← conversion was intended, never implemented
        total += amount   // ← adds cents as if they were dollars

        This didn't matter before. It matters now."

        → fixed the client code
        → reported the API contract change upstream

No code was modified to instrument. No restarts. The old workflow — add a log line, rebuild, redeploy, wait for the bug to reproduce — replaced by watching it live.

You don't need to know the line number either — describe the behavior and the agent finds where to look.


Why Detrix?

You hit a bug. The old workflow: add a print, restart, reproduce, remove the print, repeat. If it's in production, redeploy. If it's in a Docker container, get into the container. If it's intermittent, wait.

With Detrix, you just ask the agent. It finds the right line, plants an observation point, and tells you what it sees — live, nothing restarting.

That bug that cost you hours last week — redeploy after redeploy, still can't reproduce — your agent can investigate it in minutes, while your app keeps running.

print() / loggingDetrix
Iteration speedHours (edit → rebuild → deploy)Minutes
Add new observationEdit code → restartAsk the agent — no code, no restart¹
Production-safeOutput pollution, perf riskNon-breaking observation points
EventsEphemeral streamStored, queryable by metric and time
Capture controlEvery hit, no filteringThrottle, sample, first-hit, interval
CleanupManual (easy to forget, ships to prod)One command — or automatic expiry
Sensitive dataSecrets can leak via log outputSensitive-named vars blocked by default; configurable blacklist + whitelist in detrix.toml

¹ Embed detrix.init() once for zero restarts forever. Or restart once to attach the debugger (--debugpy, dlv, lldb-dap) — from that point on, the agent adds and removes observations without any further restarts.


Quick Start

Try it in 2 minutes. Your agent handles everything after step 3.

1. Install Detrix

macOS (Homebrew):

bash
brew install flashus/tap/detrix

macOS / Linux (shell script):

bash
curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/flashus/detrix/releases/latest/download/detrix-installer.sh | sh

Windows (PowerShell):

powershell
irm https://github.com/flashus/detrix/releases/latest/download/detrix-installer.ps1 | iex

Docker (linux/amd64, linux/arm64):

bash
docker pull ghcr.io/flashus/detrix:latest

Build from source:

bash
cargo install --git https://github.com/flashus/detrix detrix

Then initialise (creates config and sets up local storage):

bash
detrix init

2. Add to your app

One line — the debugger sleeps until your agent needs it, zero overhead when idle:

python
import detrix
detrix.init(name="my-app")

Go and Rust work the same way — see App Integration.

3. Connect your agent

Claude Code:

bash
claude mcp add --scope user detrix -- detrix mcp

Cursor / Windsurf — add to .mcp.json in your project root:

json
{
  "mcpServers": {
    "detrix": {
      "command": "detrix",
      "args": ["mcp"]
    }
  }
}

For cloud setup and other editors, see the setup guide.

That's it. Ask your agent to observe any line in your running app — no restarts, nothing ships to prod.


Alternative: connect without embedding

Don't want to add a dependency? Start your app directly under a debugger instead:

bash
# Python
python -m debugpy --listen 127.0.0.1:5678 app.py

# Go
dlv debug --headless --listen=127.0.0.1:5678 --api-version=2 main.go

# Rust
lldb-dap --port 5678

Listens on 127.0.0.1 — local only. See the language setup guide for remote and Docker.


How It Works

Detrix is a daemon that runs locally or in the cloud and connects your AI agent to any running process via 29 MCP tools. Under the hood, it talks to your app's debugger via the Debug Adapter Protocol (DAP). It sets logpoints — breakpoints that evaluate an expression and log the result instead of pausing. Your application runs at full speed; Detrix captures the values.

  AI Agent                 Detrix Daemon              Debugger (DAP)         Your App
  (Claude Code, Cursor,    (local or Docker/cloud)    debugpy / dlv /        (Python/Go/Rust,
    Windsurf, local)                                  lldb-dap               local/cloud)
      │                         │                          │                      │
      │── "observe line 127" ──▶│                          │                      │
      │                         │── set logpoint ─────────▶│                      │
      │                         │                          │── captures value ───▶│
      │                         │◀────────────── captured values ─────────────────│
      │◀── structured events ───│                          │                      │
      │                         │                          │                      │
      │         App never pauses. No code changes. No restarts.                   │

The daemon runs locally or alongside your service in Docker — same protocol either way. In cloud mode, source files are fetched automatically so the agent can find the right lines without them on your machine. See the Installation Guide for cloud setup.


App Integration

python
import detrix
detrix.init(name="my-app")   # That's it. Agent controls the rest.
LanguageInstallDocs
Pythonpip install detrix-pyPython Client
Gogo get github.com/flashus/detrix/clients/goGo Client
Rustdetrix-rs = "1.2.0" in Cargo.tomlRust Client

Production pattern: Build one service instance with debug symbols and a Detrix client. Route suspect traffic to it via Kafka, a sidecar, or your load balancer. The rest of your fleet runs unaffected — full-speed, no instrumentation overhead. You get deep observability on one instance without touching production.

See the Clients Manual for full documentation.


Build Configuration for Observability

Detrix uses debugger logpoints to observe variables. For expressions to evaluate successfully, the binary needs debug symbols (DWARF info). The good news: you don't need a debug build. Each language has a production-friendly strategy that preserves most variable visibility with minimal performance impact.

Go

Go's default go build already produces an optimized binary with DWARF debug symbols. Delve attaches to it and evaluates logpoint expressions on most variables — especially heap-allocated struct fields. No special flags needed.

bash
# This is already debuggable. Nothing to change.
go build -o myservice ./cmd/myservice

If the optimizer hides a specific local variable (<optimized out>), use per-package debug flags to disable optimizations only where you need visibility:

bash
# Disable optimizations in the payments package only.
# net/http, encoding/json, and all other packages stay fully optimized.
go build -gcflags="myservice/internal/payments=-N -l" -o myservice ./cmd/myservice
BuildPerformanceVariable visibility
go build (default)Full speedHigh — struct fields, most locals
go build -gcflags="pkg=-N -l"One package slower~100% in that package
go build -gcflags="all=-N -l"All packages slower100% everywhere (dev only)

Stripping symbols (-ldflags="-s -w") removes DWARF info and makes debugging impossible. If you strip for production, keep one instance with symbols for Detrix.

Rust

Rust debug builds (cargo build) are 10-100x slower than release — unusable in production. Instead, use a custom Cargo profile that compiles your dependencies at full optimization (O3) and your code at a lower level (O1) that preserves most variable visibility:

toml
# Cargo.toml — add a "detrix" profile for observable production builds

[profile.detrix]
inherits = "release"
opt-level = 1              # Your code: light optimization, most variables visible
debug = 2                  # Full DWARF debug info
codegen-units = 16         # Default parallelism

[profile.detrix.package."*"]
opt-level = 3              # All dependencies: full optimization
debug = false              # No debug info needed for deps (smaller binary)
bash
cargo build --profile detrix
ProfileYour codeDependenciesPerformance vs releaseVariable visibility
releaseO3, no debugO3, no debugBaselineCannot observe
release + debug = 2O3, DWARFO3, no debug~0-2% overheadLow — many locals optimized out
detrix (recommended)O1, DWARFO3, no debug~5-15% overheadHigh — most variables visible
dev (debug)O0, DWARFO0, DWARF10-100x slower100% (dev only)

Generics caveat: Generic code from dependencies (serde, tokio, axum) is monomorphized in your crate and compiles at your opt-level (O1), not the dependency's (O3). For most services this is negligible since I/O dominates, but serialization-heavy hot paths may see a larger impact.

For functions you want to keep fully visible regardless of optimization:

rust
#[inline(never)]  // Prevents inlining — always visible as a separate stack frame
fn process_order(order: &Order) -> Result<ProcessedOrder> {
    // Detrix can always set logpoints here
}

Python

No special build configuration needed. CPython is always debuggable — debugpy attaches to the running interpreter as-is.

python
import detrix
detrix.init(name="my-app")  # Works on any Python 3.10+ installation

See the Clients Manual for full documentation.


Features

No code changes. The agent instruments your running code via observation points — nothing gets committed, nothing ships to prod.

No pausing. Observation points evaluate expressions at full execution speed, with no breakpoint-style halting. For high-frequency code paths, use sample or throttle modes to control event volume.

No forgotten cleanup. Metrics expire automatically via TTL, or remove everything with one command.

Agent tools29 MCP tools — observe any line, query events, enable/disable observation groups, and clean up; no line number needed
Zero-downtime instrumentationAdd metrics without restarting your app
Multi-variable captureCapture multiple variables per observation point
Capture modesStream, sample, throttle, first-hit, periodic sampling (every N sec)
Runtime introspectionStack traces, memory snapshots, variable inspection, expression evaluation
Multi-languagePython (debugpy), Go (delve), Rust (lldb-dap)
Cloud debuggingObserve Docker containers and remote hosts — no VPN, no port forwarding
Durable storageEvents stored in SQLite on the daemon host. Run Detrix on a remote server, connect your agent in the morning and ask what happened overnight. Daemon auto-reconnects to the debug adapter if it restarts.
ExtensibleNew frontends via open API; new language support by implementing a language adapter — Adding Languages
Safety validationSensitive variable names (password, api_key, token, secret, private_key, etc.) blocked before capture. Configurable blacklist + whitelist for variable names and functions in detrix.toml. Enable safe mode per connection to allow only variable watching — no expression execution, no stack traces, no memory snapshots. Blocked operations return a clear named error so the agent can explain the constraint.
AuthMulti-tenant access control: per-user static tokens or JWT/JWKS, role-based authorization (Admin/User), per-agent metric isolation — Auth Guide
Event streamingForward captured events to Graylog
4 API protocolsMCP (stdio), gRPC, REST, WebSocket

Documentation

Installation GuideInstall, language setup, agent config, cloud debugging
Standalone Agent ModeCentralized Linux/Go/eBPF observation with authenticated agents
AuthenticationAuth modes, per-user tokens, JWT/JWKS, access control
CLI ReferenceCommand-line interface
Clients ManualPython, Go, Rust client libraries
ArchitectureClean Architecture with 13 Rust crates
Adding LanguagesExtend Detrix to new languages

Contributing

bash
cargo fmt --all && cargo clippy --all -- -D warnings && cargo test --all
  1. Fork the repository
  2. Create a feature branch
  3. Run the checks above
  4. Submit a Pull Request

License

MIT License — see LICENSE.

Found a bug? Open an issue. Found in minutes what took you days? Tell us in Discussions.

Usa MCP Detrix con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Detrix, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Detrix come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Detrix.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "detrix": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Detrix, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Detrix.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Detrix per aiutarmi con questa attività?
Detrix
Certo. Ho letto.
Ecco cosa ho trovato con Detrix.

Domande frequenti

A cosa serve il server MCP Detrix?

Detrix è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Detrix MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Detrix con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Detrix con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Detrix, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Detrix MCP a TypingMind?

Detrix funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Detrix MCP in TypingMind?

Detrix mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Detrix MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Detrix richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇