convez.ai
MCP ServerDevOps & InfraestruturaIntermediário
Nonanti

Narwhal – Workbench de Banco de Dados Nativo para Agentes

Nonanti/narwhal

DBA workbench no terminal + MCP server, 6 bancos, vim-mode, um binário

Ver no GitHub
BomPluginScore · de 0 a 100

Cliente TUI de banco de dados com servidor MCP integrado, suportando Postgres, MySQL, SQLite, DuckDB, ClickHouse e MSSQL. Oferece ferramentas de nível DBA como diff de schema, auditoria, sandboxing de plugins Lua/WASM, diagramas ER e editor SQL com vim-mode. Funciona como ferramenta standalone ou integrada com agentes Claude/Cursor via MCP.

Instalação

$npx convez-ai Nonanti/narwhal

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
46
Forks
1
Acompanhando
1
Saúde
100%
Último commit
há 1 mês
Versão
v2.3.0
Issues abertas
6
Contribuidores
4

Casos de uso

  • Consultar e gerenciar múltiplos bancos de dados via TUI
  • Integrar Claude/Cursor com acesso seguro ao schema e queries
  • Auditar e differenciar schemas com geração DDL dialect-aware
  • Executar queries canceláveis com streaming de resultados
  • Automatizar operações via MCP com guardrails de leitura/escrita

Veredito

Ferramenta madura e bem-arquitetada que resolve friction real em workflows de banco de dados, especialmente para quem quer integração nativa com agentes IA. O suporte a múltiplos engines e operações DBA-grade a diferencia de REPLs simples; a implementação MCP é forward-looking para uso com assistentes.

README

A tradução para o português deste README ainda está na fila.

narwhal

The agent-native database workbench for the terminal. A DBA toolkit, an MCP server, and a vim-mode SQL editor — in one static binary.

CI Crates.io Downloads MSRV License

Install · Quick start · Why narwhal · Docs


narwhal demo

What is narwhal?

narwhal is a terminal database client built around two things every other client misses:

  1. DBA-grade tooling, not a toy REPL. Schema diff with dialect-aware DDL emit, append-only audit log, capability-gated plugin sandbox, streaming cancellable queries, ER diagrams, SSH tunnels, secret vault — the operational surface a real database day needs.
  2. First-class agent integration. A built-in MCP server exposes your connections, schema, and query execution to Claude, Cursor, Zed, and any MCP-aware client. No proxy, no adapter — narwhal mcp and you're wired.

Six engines (Postgres, MySQL, SQLite, DuckDB, ClickHouse, SQL Server), three editor modes (vim / basic / emacs), one static binary.

Install

curl -fsSL https://github.com/Nonanti/narwhal/releases/latest/download/install.sh | sh

Other channels — cargo install narwhaldb, Homebrew, AUR, Nix flake, prebuilt tarballs — are listed in docs/install.md.

Quick start

narwhal                                    # launches the TUI

Inside:

  1. :add — connection wizard, or :url postgres://user:pass@host/db
  2. :open <name> — connect; the sidebar fills with schemas and tables
  3. F6 — run the buffer; results stream into the lower pane
  4. F1 — full keymap

Headless:

narwhal exec --conn prod 'SELECT count(*) FROM orders' --format json

Agent-native: wire it to your editor

narwhal embeds an MCP server over stdio. Run it once and your AI assistant can browse schema, sample data, and run queries against your saved connections — with the same read-only / per-connection guards the TUI uses.

narwhal mcp --read-only

Claude Desktop (~/.config/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "narwhal": {
      "command": "narwhal",
      "args": ["mcp", "--read-only"]
    }
  }
}

Cursor, Zed, Continue, Aider, and custom clients work the same way. Full setup: docs/mcp.md.

Database support

EngineDriverTLSStreamingCancelDDL emit
PostgreSQLtokio-postgres + rustlsverify-full✅✅✅
MySQL / MariaDBmysql_async✅✅✅✅
SQLiterusqlite (bundled)n/a✅—✅
DuckDBduckdb (bundled)n/a✅—✅
ClickHouseHTTP + rustls✅✅✅✅
SQL Servertiberius + rustls✅buffered—✅

Highlights

  • Six engines, one TUI. Switch with :open, every driver speaks the same Connection trait — same streaming, same cancellation, same schema introspection.
  • Three editor modes. vim (with motions, text objects, registers, marks, macros), basic (modeless), emacs — sharing one buffer.
  • Full mouse. Click, drag-select, double / triple-click word and line, middle-click paste, right-click context menu.
  • Schema tooling. ER diagrams in the terminal, :schema-diff between two connections with dialect-aware DDL emit (Postgres ↔ MySQL ↔ MSSQL ↔ generic).
  • Plugins. Lua (trusted, fast) and WASM (sandboxed, capability-gated filesystem / network / clipboard) — the same surface used by the built-ins.
  • Streaming, cancellable. Rows arrive incrementally; Ctrl-C cancels mid-run on every backend that supports it.
  • Secrets. Vault, 1Password, OS keyring, ~/.pgpass — no plaintext-on-disk fallback.
  • Audit log. Append-only JSONL with redaction rules, suitable as compliance evidence.
  • Inline output. Charts, pivot tables, JSON viewer, row detail pane, exports to CSV / JSON / Markdown / Parquet.
  • SSH tunnels. Single config block, no ~/.ssh/config plumbing required.

Documentation

TopicFile
Install (all methods)docs/install.md
Configurationdocs/configuration.md
Editor modesdocs/editor-modes.md
Mousedocs/mouse.md
MCP serverdocs/mcp.md
Headless execdocs/headless.md
Plugins (Lua + WASM)docs/plugins.md
Connection vaultdocs/vault.md
Audit logdocs/audit.md
Schema diffdocs/schema-diff.md
Architecturedocs/ARCHITECTURE.md
Building from sourcedocs/dev/build.md
Upgradingdocs/upgrading.md

Contributing

Issues and PRs welcome. See CONTRIBUTING.md. Commit messages follow Conventional Commits; the four CI checks (fmt, clippy -D warnings, doc -D warnings, test) must pass.

License

Dual-licensed under MIT and Apache 2.0, at your option.

Ver o original no GitHub

Bom para

Relacionados