Logo de Detrix

Detrix

Comunidade
flashus

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

Publicado porflashus
Repositóriodetrix
IdiomaRust
Forks
5
Estrelas
23
Ferramentas disponíveis
0
Tipo de transportestdio
Categorias
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Detrix disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    23 estrelas e 5 forks no repositório vinculado.

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.

Use o MCP de Detrix com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Detrix, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Detrix como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de Detrix.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "detrix": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Detrix, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Detrix.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Detrix para me ajudar nesta tarefa?
Detrix
Claro. Já li.
Veja o que encontrei usando Detrix.

Perguntas frequentes

Para que serve o servidor MCP Detrix?

Detrix é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Detrix com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Detrix com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Detrix com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Detrix conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Detrix ao TypingMind?

Detrix funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Detrix oferece no TypingMind?

Detrix disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Detrix?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Detrix exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇