sqlmate-mcp
sqlmate-mcp is a zero-config MCP server that gives AI assistants read/write access to MySQL, MariaDB, SQLite, MSSQL, and PostgreSQL databases, plus a live browser GUI for humans.
List configured connections — see detected databases from
.envor.sqlmaterc.Add connections on the fly — via URL, config file, or manual parameters.
Inspect database structure — list tables, describe columns, and fetch full schema with primary/foreign keys and indexes.
Run read-only SQL — execute SELECT, EXPLAIN, SHOW, and PRAGMA queries safely.
Explain query plans — get execution plans, optionally with real timing.
Run guarded writes — INSERT/UPDATE/DELETE/DDL with a risk assessment; destructive operations require explicit user confirmation.
Use the browser GUI — paginated data grid, inline cell editing, row deletion, schema view, SQL editor with EXPLAIN and timing, and an interactive ERD visualizer.
Watch the live agent feed — see every MCP tool call stream into the dashboard in real time.
Manage multiple projects — one dashboard groups connections by project, and each MCP process attaches to a shared GUI daemon.
Provides tools to connect to and interact with MariaDB databases: list tables, describe schema, run read queries, and execute write operations with risk assessment for destructive commands.
Provides tools to connect to and interact with MySQL databases: list tables, describe schema, run read queries, and execute write operations with risk assessment for destructive commands.
Provides tools to connect to and interact with SQLite databases: list tables, describe schema, run read queries, and execute write operations with risk assessment for destructive commands.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sqlmate-mcp show me the tables in my database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🗄️ sqlmate-mcp
Give Claude a database. Give yourself a GUI.
Zero-config SQL database MCP server with a live browser GUI — for Claude Code, Zed, and any MCP client.
Point it at your project, and Claude can explore your MySQL · MariaDB · SQLite · MSSQL · PostgreSQL databases while you browse, edit, and query them in a beautiful browser dashboard that updates in real time.
npm install -g sqlmate-mcp
claude mcp add --transport stdio sqlmate-mcp sqlmate-mcpThat's the whole setup. It reads your existing .env — no config files to write.
✨ Why sqlmate-mcp?
Most database MCP servers give the AI tools and leave you in the dark. sqlmate-mcp does both halves:
🤖 For Claude — 9 focused tools to inspect schemas, run queries, and make guarded writes.
👀 For you — a browser GUI (run once as a background daemon, not per session) so you can watch what the agent touches, edit data by hand, and run your own SQL side by side.
No API keys. No cloud. No node-gyp. It reads the config you already have.
Related MCP server: Database Tools for Claude AI
🚀 Features
⚡ Zero config | Reads |
🔌 5 databases | MySQL, MariaDB, SQLite, MSSQL, and PostgreSQL from one server |
🧠 Schema intelligence |
|
📊 Query plans |
|
🛡️ Write safety | DELETE/UPDATE without |
🖥️ Browser GUI | Paginated grid, inline cell editing, row delete, schema view, and a SQL editor with EXPLAIN + timing |
🕸️ ERD visualizer | Interactive entity-relationship diagram per connection, with foreign-key edges and click-to-open tables |
🗂️ Unified dashboard | Open several projects at once and see them all in one GUI, grouped by project |
📡 Live agent feed | Watch every MCP tool call stream into the browser in real time |
🪶 No native builds | SQLite uses Node's built-in |
📦 Setup
1. Install
npm install -g sqlmate-mcp2. Register with your editor
claude mcp add --transport stdio sqlmate-mcp sqlmate-mcpOpen your Zed settings.json (Cmd/Ctrl + ,) and add:
{
"context_servers": {
"sqlmate-mcp": {
"command": "sqlmate-mcp",
"args": [],
"env": {}
}
}
}To pin a specific project's database, set SQLMATE_PROJECT_ROOT in the env block:
{
"context_servers": {
"sqlmate-mcp": {
"command": "sqlmate-mcp",
"args": [],
"env": { "SQLMATE_PROJECT_ROOT": "/absolute/path/to/your/project" }
}
}
}The sqlmate-mcp tools then appear in the Zed Agent Panel.
3. That's it
sqlmate-mcp reads connections from the root of whichever project you open (the directory you launch your editor from). Each project uses its own .env or .sqlmaterc — no global config. See Connection Setup.
🔧 Connection Setup
sqlmate-mcp reads connections from your project root at startup (defaults to cwd, override with SQLMATE_PROJECT_ROOT).
Option 1 — .env
Laravel-style variables:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myapp
DB_USERNAME=root
DB_PASSWORD=secretOr a connection URL:
DATABASE_URL=mysql://root:secret@127.0.0.1:3306/myapp
DATABASE_URL=sqlite:///relative/path/app.db
DATABASE_URL=sqlserver://sa:pass@localhost:1433/master
DATABASE_URL=postgres://postgres:secret@127.0.0.1:5432/myappSupported schemes: mysql, mariadb, sqlite, sqlserver / mssql, pgsql / postgres / postgresql.
Option 2 — .sqlmaterc
A JSON array of connection objects in your project root:
[
{ "name": "Local MySQL", "type": "mysql", "host": "127.0.0.1", "port": 3306, "username": "root", "password": "", "database": "myapp" },
{ "name": "App SQLite", "type": "sqlite", "path": "./database/app.db" },
{ "name": "Local Postgres", "type": "postgres", "host": "127.0.0.1", "port": 5432, "username": "postgres", "password": "", "database": "myapp" }
]A copy-paste starting point lives in docs/sqlmaterc-example.json.
🛠️ MCP Tools
Tool | Description |
| List all detected connections (id, name, type, source) |
| Add a connection for the session via URL, config file, or params |
| List table names for a connection |
| Column names, types, nullability, and primary key info |
| Full schema graph — columns, PKs, foreign keys, and indexes |
| Run a read-only query (SELECT, EXPLAIN, SHOW, PRAGMA) |
| Return the execution plan; |
| Run an INSERT, UPDATE, DELETE, or DDL statement |
| Write a restorable |
run_writeruns a risk assessment first. Operations affecting all rows (noWHERE),DROP,TRUNCATE, orALTER…DROP COLUMNpause and ask Claude to confirm withconfirm: truebefore proceeding.
dump_databaseis meant to be called before risky writes or migrations. The dump goes to.sqlmate/dumps/<connection>-<timestamp>.sqlin your project (a.sqlmate/.gitignorekeeps it out of git) and only the file path and row counts are returned to Claude. Example: "Back up theordersandcustomerstables, gzipped, before running this migration" →dump_database({ connectionId: "app", tables: ["orders", "customers"], gzip: true }). MySQL, Postgres and SQLite dump from a consistent snapshot; MSSQL is best-effort. Views, routines and triggers are not included (SQLite triggers are).
🖥️ Browser GUI
Available at http://localhost:4737 once the GUI daemon is running.
📄 Browse any table with a paginated data grid
✏️ Click a cell to edit it inline; delete rows with the trash icon
🔀 Toggle between data view and column schema view
💬 Run arbitrary SQL in the built-in editor, with Explain for the plan and per-query timing
🕸️ Visualize a database as an interactive ERD — PK/FK badges, relationship edges, click-to-open
🔄 Reconnect a database without restarting the server
📡 Watch a live feed of every MCP tool call Claude makes
🗂️ Multiple Projects, One Dashboard
Open your editor in more than one project at a time and each runs its own sqlmate-mcp process — but you only ever see one browser GUI, showing all projects at once.
The sidebar groups connections by project (each labeled with its host/database); open tables, run SQL, and view ERDs across projects side by side. The live feed spans every project, labeled by project.
Every MCP process is attach-only: it never binds the GUI port itself and never opens a browser tab. It just registers its connections with whatever GUI is already running and streams its tool activity into the live feed.
This means the GUI's lifetime is decoupled from any single editor session — see below.
Run the GUI as a standalone daemon
Instead of a browser tab popping up (and a new host getting elected) every time an editor session starts, run the GUI once as its own long-lived process and let every sqlmate-mcp process just attach to it:
sqlmate-mcp gui # start the GUI daemon, opens the browser once
sqlmate-mcp gui --install-autostart # (Windows) start it automatically at login
sqlmate-mcp gui --uninstall-autostart # remove the login itemIf no daemon is running, an MCP process just logs a hint to stderr and keeps working without a GUI — it retries attaching in the background every 30s, so starting the daemon later (or after it restarts) picks the session back up without restarting your editor.
Running
sqlmate-mcp guiagain while one is already running just opens the browser to the existing instance instead of erroring.--install-autostartdrops a hidden startup shortcut (%APPDATA%\...\Startup\sqlmate-gui.vbs) that launchessqlmate-mcp guiat login with no visible console window. If the project lives on a drive that isn't attached yet at login (a mapped or slow-to-mount drive), it waits — checking every 3s, up to 5 minutes by default — instead of failing silently. Override with--max-wait=<seconds>, e.g.sqlmate-mcp gui --install-autostart --max-wait=60.
Fully optional — without it, sqlmate-mcp behaves as a normal attach-only client and simply runs with no GUI until you start one.
⚙️ Environment Variables
Variable | Default | Description |
|
| Directory to search for |
|
| Port for the browser GUI |
| — | Set to |
🧑💻 Development
git clone https://github.com/adamrpostjr/sqlmate-mcp.git
cd sqlmate-mcp
npm install
npm run build # builds the Svelte GUI into /public
node src/index.js # start the backend (serves the GUI at :4737)
cd frontend && npm run dev # frontend hot-reload (proxies /api to :4737)The frontend is Svelte 5 + Vite + Tailwind. Production build output goes to /public, served statically by Express. Backend is pure Node.js ES modules — no TypeScript, no build step.
📋 Requirements
Node.js ≥ 22.5 (for the native
node:sqlitemodule)
📄 License
MIT · Built by Adam Post
If sqlmate-mcp saves you a trip to a database client, consider giving it a ⭐
Available Tools
6 toolsadd_connectionA
Configure a database connection for this session. Provide ONE of: (a) url — a connection URL like mysql://user:pass@host:3306/db or sqlite:///path/to/db.sqlite, (b) file — an absolute path to a .sqlmaterc (JSON) or .env file containing DB credentials, (c) individual params — type (mysql|sqlite|mssql), host, port, username, password, database, and optionally name. After adding, call list_connections to verify.
Inputs: url, file, host, name, +6 more.
describe_tableB
Get column schema for a table
Inputs: table (required), connectionId (required), project_root.
list_connectionsA
List all configured database connections. IMPORTANT: Always pass project_root set to the absolute path of the current project directory. This ensures the correct database connections are loaded for the active project, since the server may be shared across multiple projects. If no connections are found, returns setup instructions.
Inputs: project_root.
list_tablesA
List all tables in a database connection
Inputs: connectionId (required), project_root.
run_queryA
Run a read-only SQL query (SELECT, EXPLAIN, SHOW, PRAGMA). Write statements are rejected.
Inputs: sql (required), connectionId (required), project_root.
run_writeA
Run a write SQL statement (INSERT, UPDATE, DELETE, TRUNCATE, DROP, ALTER). IMPORTANT: For destructive operations (DELETE, TRUNCATE, DROP, UPDATE without WHERE, ALTER TABLE ... DROP COLUMN) you MUST first call this tool WITHOUT confirm to get a risk summary, show it to the user and ask for explicit approval, then call again with confirm: true. Never pass confirm: true on the first call without user approval.
Inputs: sql (required), connectionId (required), confirm, project_root.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool addresses a distinct operation: connection setup, schema inspection, connection listing, table listing, read-only queries, and write queries. No functional overlap exists.
All tool names follow a consistent 'verb_noun' pattern using snake_case (e.g., describe_table, run_query), making the API predictable and easy to navigate.
With 6 tools, the surface is well-scoped for a database management tool, covering essential tasks without being overly minimal or bloated.
The set covers core CRUD and schema inspection, but lacks connection management operations (e.g., remove, update) and support for other database objects like views or stored procedures, which are minor gaps.
Maintenance
Related MCP Connectors
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Hosted MySQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseCqualityDmaintenanceAn MCP server that enables MySQL database integration with Claude. You can execute SQL queries and manage database connections.29MIT
- AlicenseBqualityDmaintenanceMCP server that allows Claude AI to interact directly with MySQL databases, enabling query execution and table information retrieval through natural language.15 npm4MIT
- AlicenseAqualityDmaintenanceMCP server for Claude that connects to MySQL, MariaDB, and SQLite databases. Query your databases using natural language.3MIT
- AlicenseAqualityDmaintenanceA database-agnostic MCP server that enables natural language queries to your database through Claude or Copilot, automatically writing and executing SQL.87 npmMIT