vi-sql MCP
vi-sql is a terminal SQL client with a built-in MCP server: the agent sees the schema and drafts queries straight in your editor
- 212 ★ on the repository
- Last commit
Extended access
Why this level
- The agent gets the schema of the connected database, and with execution enabled reads and changes its data
- The app stores connection strings and passwords, encrypting them with a keyring key or a master password
Install
- Works in
Manual install
brew install vi-sqlThere is also `curl -fsSL https://vi-sql.com/install.sh | sh`, prebuilt binaries on the releases page and a build with Go 1.25.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The agent gets the schema of the connected database, and with execution enabled reads and changes its data
- The app stores connection strings and passwords, encrypting them with a keyring key or a master password
This is third-party code. Review the repository files before installing.
What it does
vi-sql is a terminal interface written in Go for working with SQL databases. It shows the schema, runs queries, edits rows, builds EXPLAIN and ANALYZE plans and works with PostgreSQL, MySQL and SQLite (the connection examples use `postgres://`, `mysql://` and `file:`). Inside are editor tabs with highlighting, autocomplete and history, a Vim mode with `hjkl`, `gg`, `dd`, and import and export to CSV, JSON, SQL and Markdown. For agents the program raises an HTTP MCP server. It is switched on in the options page and the client gets the address `http://localhost:9741/mcp`. While the app runs, Claude Code, Cursor and other clients browse your session's schema and draft queries into the editor. Letting the agent execute queries is a separate opt-in, off by default. Connections are stored encrypted with AES-256-GCM, and the key can come from the OS keyring, a master password or an environment variable. The app updates itself from the actions palette.
Who it is for. Developers and analysts who live in the terminal, work Vim-style and want an agent to see their database but run queries only with permission.
Good fit when
- The agent needs the current database schema to draft a query in your editor without direct data access
- Query results are easier to edit right in the table: filters, sorting, batch edits and following foreign keys
- A slow query plan needs EXPLAIN ANALYZE with cost per step
- Data must be exported to CSV or JSON or loaded from them
- Connections must be stored encrypted with the key in the OS keyring
Not a fit when
- You need a persistent MCP server without the interface running: the server works while the app is open
- Your database is outside PostgreSQL, MySQL and SQLite: the README connection examples are limited to them
- You prefer a graphical client to a terminal
- The agent must run queries on its own without your confirmation: that mode is a separate opt-in and off by default
Example request
Look at my current database schema and draft a query in the editor showing customers with no orders in the last 90 daysMCP
- Transport
- http
- Authentication
- not required
Limitations
- The MCP server is available while the app is running and the server is enabled on the options page. The default address is `http://localhost:9741/mcp`.
- The `vi-sql --paths` command shows where the config, keybindings, themes and log live.
- The Apache 2.0 license is stated at the bottom of the README, but GitHub metadata does not detect it.
- The `curl ... | sh` install runs a remote script: read it first or take a prebuilt binary from the releases page.
How to disable. Switch the MCP server off on the app options page and remove the address from the client settings. To remove vi-sql itself use `curl -fsSL https://vi-sql.com/uninstall.sh | sh`: the script asks before deleting the binary, config directory, log file and keyring entry.
FAQ
How do I connect vi-sql to Claude Code?
Run vi-sql, enable the MCP server on the options page and run `claude mcp add --transport http vi-sql http://localhost:9741/mcp`. Details are in the docs at vi-sql.com.
Can the agent change my data?
By default the agent sees the schema and drafts queries into the editor. Query execution is a separate setting, so changes without your consent are not possible by default.
Which databases are supported?
The README examples cover PostgreSQL, MySQL and SQLite: the `postgres://`, `mysql://` and `file:` addresses.
How are connection passwords stored?
Connections are encrypted with AES-256-GCM. The key comes from the operating system keyring, a master password or an environment variable.
How does vi-sql differ from DBHub?
vi-sql is primarily a human interface with an editor and tables, and MCP is secondary in it. DBHub is built as an MCP server for several databases, with no interactive terminal work for a human.
Discussion
No questions or reviews yet.
Related
MCP serversA desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use
One MCP server for SQLite, SQL Server, PostgreSQL and MySQL: read and change data, edit schemas and export to CSV and JSON
MCP server and Claude Code plugin for SQL: validation, formatting, linting and injection scanning across eight dialects.
A SQLite-based SQL engine with plugins for apps, databases and files: the anyquery mcp command exposes that data to Claude, Cursor and other MCP clients
An MCP server and the dbcode-cli skill: an agent runs SQL through connections already saved in the DBCode editor extension.
A lightweight database workspace with an MCP server: the agent reads the schema, runs queries and explores data in PostgreSQL, MySQL and more
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| vi-sql (this card) | no | not required | 212 | |
| DBHub | no | not required | 3,795 | an MCP server for databases without an interactive terminal client |
| sqlit | no | 4,973 | an SQL client with batch queries for agents and JSON output, while vi-sql leans on an interactive interface |
README in short
The README opens with a video and a feature list: editor tabs, tables, Vim, schema, EXPLAIN, import, MCP, updating, encryption and themes. It then covers install by curl, Homebrew, binaries and a Go 1.25 build, a quickstart with DSNs and a short section on the MCP server.