Skip to main content
Glama
adamrpostjr

sqlmate-mcp

by adamrpostjr

🗄️ 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.

Node.js MCP License: MIT npm

npm install -g sqlmate-mcp
claude mcp add --transport stdio sqlmate-mcp sqlmate-mcp

That'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 — 8 focused tools to inspect schemas, run queries, and make guarded writes.

  • 👀 For you — a browser GUI that opens automatically, 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 DB_* vars or DATABASE_URL straight from your project's .env

🔌 5 databases

MySQL, MariaDB, SQLite, MSSQL, and PostgreSQL from one server

🧠 Schema intelligence

get_schema returns every table's columns, PKs, foreign keys, and indexes in a single call

📊 Query plans

explain_query returns the execution plan without running your statement — opt into analyze for real timing

🛡️ Write safety

DELETE/UPDATE without WHERE, DROP, and TRUNCATE require explicit confirmation

🖥️ 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 node:sqlite — nothing to compile


📦 Setup

1. Install

npm install -g sqlmate-mcp

2. Register with your editor

claude mcp add --transport stdio sqlmate-mcp sqlmate-mcp

Open 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=secret

Or 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/myapp

Supported 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_connections

List all detected connections (id, name, type, source)

add_connection

Add a connection for the session via URL, config file, or params

list_tables(connectionId)

List table names for a connection

describe_table(connectionId, table)

Column names, types, nullability, and primary key info

get_schema(connectionId, [table])

Full schema graph — columns, PKs, foreign keys, and indexes

run_query(connectionId, sql)

Run a read-only query (SELECT, EXPLAIN, SHOW, PRAGMA)

explain_query(connectionId, sql, [analyze])

Return the execution plan; analyze runs read-only statements for real timing

run_write(connectionId, sql)

Run an INSERT, UPDATE, DELETE, or DDL statement

run_write runs a risk assessment first. Operations affecting all rows (no WHERE), DROP, TRUNCATE, or ALTER…DROP COLUMN pause and ask Claude to confirm with confirm: true before proceeding.


🖥️ Browser GUI

Opens automatically at http://localhost:4737 on startup.

  • 📄 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 first process to start binds the GUI port (SQLMATE_PORT, default 4737), becomes the host, and opens the browser.

  • Every other process detects the port is taken, confirms it's a compatible sqlmate-mcp host, and attaches — no second tab, no error.

  • 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.

  • If the host exits, a remaining attached process automatically takes over — the GUI keeps working.

Fully automatic, zero configuration.


⚙️ Environment Variables

Variable

Default

Description

SQLMATE_PROJECT_ROOT

cwd

Directory to search for .env and .sqlmaterc

SQLMATE_PORT

4737

Port for the browser GUI

SQLMATE_NO_OPEN

Set to 1 to skip auto-opening the browser


🧑‍💻 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:sqlite module)


📄 License

MIT  ·  Built by Adam Post

If sqlmate-mcp saves you a trip to a database client, consider giving it a ⭐

Available Tools

6 tools
add_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoConnection URL (mysql://, sqlite://, sqlserver://)
fileNoAbsolute path to a .sqlmaterc or .env file
hostNoDatabase host
nameNoDisplay name for this connection
pathNoFile path for SQLite databases
portNoDatabase port
typeNoDatabase type
databaseNoDatabase name
passwordNoDatabase password
usernameNoDatabase username

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It explains the configuration action and suggests a verification step, but lacks details on side effects, idempotency, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph of four sentences, front-loaded with the purpose, includes examples and a post-usage suggestion, and has no redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters with full schema coverage, no required fields, and no output schema, the description adequately covers how to use the tool and what to expect, but lacks details on success/failure behavior or error handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with basic descriptions; the description adds significant value by explaining the three connection modes with concrete URL examples and clarifying optionality among parameter groups.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Configure a database connection for this session' with a specific verb and resource, and clearly distinguishes from sibling tools like list_connections and run_query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It enumerates three mutually exclusive modes (url, file, individual params) and recommends calling list_connections to verify, providing clear usage context without explicit alternatives or when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

describe_tableB

Get column schema for a table

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable name
connectionIdYesConnection ID from list_connections
project_rootNoAbsolute path to the current project directory (same value passed to list_connections)

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description offers no additional behavioral context beyond the basic operation. There is no mention of how the tool handles errors, permissions, or whether it might have side effects. For a tool with no annotations, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no fluff, but it could be slightly more informative without being verbose. It earns a 4 for being concise and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description does not provide enough context about the return format, edge cases, or prerequisites. The tool has three parameters but the description is minimal.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no extra meaning beyond what is already in the input schema; for instance, 'project_root' is not explained further.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get column schema for a table' uses a specific verb and resource, clearly distinguishing it from sibling tools like list_tables (which lists table names) and run_query (which executes SQL queries).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit usage guidance or alternatives are mentioned; however, the context of sibling tools implies this tool is used after listing tables to inspect their schema. This is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_rootNoAbsolute path to the current project directory. Always provide this so connections are loaded for the right project.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description carries full burden. It discloses that it lists connections and returns setup instructions if none exist, implying a read-only operation. However, it does not explicitly state the absence of side effects, which would be beneficial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two purposeful sentences plus a highlighted important note. It is front-loaded with the main action and provides critical usage guidance efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema, the description adequately conveys what the tool returns (a list or setup instructions). It is complete enough for a simple listing tool, though it could optionally mention the format of the returned list.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the description adds value by explaining why the project_root parameter is important (shared server context) beyond the schema's description. It reinforces the correct usage without redundancy.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'lists all configured database connections' with a specific verb and resource. It distinguishes well from siblings that perform different operations like adding connections or querying tables.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes an important note about always providing the project_root parameter with an absolute path, explaining why it's needed for multi-project server sharing. It also mentions what happens if no connections are found, but lacks explicit exclusions or when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesA

List all tables in a database connection

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionIdYesConnection ID from list_connections
project_rootNoAbsolute path to the current project directory (same value passed to list_connections)

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden. It correctly implies a read operation but lacks details on authentication, rate limits, or output behavior. Acceptable but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, efficient sentence with no wasted words. Front-loaded and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple but the description does not mention the return format (e.g., list of table names). With no output schema, this information would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%. The description adds no additional meaning beyond the schema's parameter descriptions, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list' and resource 'tables in a database connection', distinguishing it from sibling tools like describe_table and run_query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., describe_table). The description does not provide context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_queryA

Run a read-only SQL query (SELECT, EXPLAIN, SHOW, PRAGMA). Write statements are rejected.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to run
connectionIdYesConnection ID from list_connections
project_rootNoAbsolute path to the current project directory (same value passed to list_connections)

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the read-only nature and rejection of writes, but lacks details on error handling, rate limits, or side effects beyond the core behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, direct sentence with no extraneous information. Every word is purposeful and front-loaded with the most critical detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is adequate for a simple read-only query tool, but lacks details about return format, pagination, or limitations (e.g., query timeout). Without an output schema, the agent may need more context about results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so description adds no additional meaning beyond the schema. The description does not elaborate on parameter usage or constraints beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs read-only SQL queries (SELECT, EXPLAIN, SHOW, PRAGMA) and explicitly rejects write statements, making the purpose unambiguous and distinguishing it from the sibling 'run_write'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description specifies allowed query types and that write statements are rejected, providing clear context for when to use. However, it does not explicitly state alternatives or when not to use, though the sibling 'run_write' implies the contrast.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL statement to execute
confirmNoSet to true only after the user has explicitly approved the risk shown by a prior call to this tool
connectionIdYesConnection ID from list_connections
project_rootNoAbsolute path to the current project directory (same value passed to list_connections)

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses the two-step confirmation requirement for destructive operations, which is critical. However, does not describe the format of the risk summary return or any error/authentication behavior. With no annotations, more could be said, but the main safety feature is well communicated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both essential. First sentence states purpose, second provides critical usage instruction. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, confirmation flow, and sibling relationship. Could be improved by explicitly stating what happens when confirm is false (returns risk summary) and any preconditions (e.g., user authentication). But overall sufficient for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds meaningful context: explains confirm parameter's usage pattern and notes connectionId comes from list_connections. This goes beyond the schema's descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description explicitly states it runs write SQL statements (INSERT, UPDATE, DELETE, TRUNCATE, DROP, ALTER), clearly distinguishing from the read-only sibling run_query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit step-by-step guidance: for destructive operations, first call without confirm to get a risk summary, then call with confirm: true only after user approval. Also warns against passing confirm: true on first call.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4/5.0
Disambiguation5/5

Each tool addresses a distinct operation: connection setup, schema inspection, connection listing, table listing, read-only queries, and write queries. No functional overlap exists.

Naming Consistency5/5

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.

Tool Count5/5

With 6 tools, the surface is well-scoped for a database management tool, covering essential tasks without being overly minimal or bloated.

Completeness4/5

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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    MCP server that allows Claude AI to interact directly with MySQL databases, enabling query execution and table information retrieval through natural language.
    1
    5
    4
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for Claude that connects to MySQL, MariaDB, and SQLite databases. Query your databases using natural language.
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A database-agnostic MCP server that enables natural language queries to your database through Claude or Copilot, automatically writing and executing SQL.
    16
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adamrpostjr/sqlmate-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server