SQLX logo

SQLX

Run SQL and database commands through MCP across remote databases and local SQLite, DuckDB, or H2 files.

Install SQLX

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "sqlx": {
      "command": "npx",
      "args": [
        "-y",
        "@ottermind/sqlx@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @ottermind/sqlx@latest

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

SQLX MCP server connects agents to remote databases and local database files through the SQLX command-line interface. It supports SQL execution, datasource management, connection testing, and command execution for systems including PostgreSQL, MySQL, Redis, MongoDB, SQLite, DuckDB, and H2. Connections are saved in encrypted form, while results are returned as complete structured data. Reach for it when an agent needs one CLI-based interface across multiple database engines.

Use cases

  • Query production or development SQL databases from an agent
  • Run database commands across Redis and MongoDB connections
  • Inspect local SQLite, DuckDB, or H2 files
  • Manage encrypted database datasources from a CLI
  • Execute multiple SQL statements in one agent request

Key features

  • MCP access through the sqlx CLI
  • Encrypted saved connections
  • Structured query and command results
  • Support for remote and local database engines
  • Datasource creation and connection testing
  • Codex and Claude Code plugins

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 43d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · @ottermind/sqlx@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads688Package downloads in the last 30 days.
Last commit12d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity10 viewsConfig copies, upvotes, and views on AllMCPs.

How SQLX works

What the SQLX MCP server does

The SQLX MCP server gives an agent access to database connections through the SQLX CLI and MCP. It can work with remote database services such as MySQL, MariaDB, PostgreSQL, CockroachDB, Oracle, SQL Server, ClickHouse, Trino, Presto, Redis, and MongoDB. It can also open local SQLite, DuckDB, and H2 files.

Connections are created as named datasources and stored in encrypted form. An agent can test a datasource, run one or more SQL statements, or send database-specific commands. SQLX returns complete structured results rather than requiring the agent to parse terminal text.

How it works

The SQLX MCP server runs through the sqlx mcp command. Agent integrations start that process and invoke its exposed operations. The Codex plugin starts the MCP process directly; its read-only operations can run without approval, while sqlx_sql_execute and sqlx_sql_view are treated as destructive and require approval by default.

SQLX selects a worker based on the datasource type. Some engines use native workers, while others use JDBC workers with downloaded database support and a private JRE when needed. The CLI accepts multiple --command values in a single invocation. For Redis, each command is a Redis command rather than SQL; MongoDB uses one command document per command.

Setup and configuration

Release packages are available for macOS ARM64 and x64, Linux ARM64 and x64, and Windows x64. Installation can use GitHub Releases, platform scripts, or npx @ottermind/sqlx@latest; the npx route requires Node.js 22 or newer for installation, but Node.js is not needed by the installed CLI. The Linux release baseline is Ubuntu 24.04.

After installation, create and test a datasource with commands such as:

sh
sqlx datasource add --name dev --type postgresql --host db.example.com --port 5432 --database app
sqlx datasource test --id dev
sqlx sql execute --datasource dev --command "SELECT current_database()"

Codex and Claude Code provide plugins, while DeepSeek Harness and Pi have their own packages. A managed Skill can also be installed for Codex, Claude, dsh, Pi, or another agent’s skill directory. Codex and Claude Code plugins install the CLI when it is missing and enforce their documented minimum CLI version.

Tools and capabilities

The SQLX MCP server covers these operations and connection patterns:

  • Create, test, and use named datasources.
  • Execute SQL and return structured results.
  • Run multiple statements or commands in one invocation.
  • Connect to MySQL-compatible, PostgreSQL-compatible, JDBC-based, and native-worker databases.
  • Open local SQLite, DuckDB, and H2 files.
  • Use database-specific settings such as SQLite read-only mode, DuckDB thread count, and H2 TCP access.
  • Update the CLI and inspect update status independently of saved connections.

Supported datasource types include MySQL, MariaDB, TiDB, GreatSQL, OceanBase, StarRocks, Apache Doris, PostgreSQL, CockroachDB, YugabyteDB, openGauss, Oracle, SQL Server, ClickHouse, Trino, Presto, Hive, Apache Kylin, TDengine, Dameng, KingbaseES, XuguDB, Redis, MongoDB, SQLite, DuckDB, and H2.

Limitations and notes

The CLI installers support the listed release targets; the prebuilt package does not cover every operating system or architecture. Oracle requires a service name, Trino and Presto require a catalog or schema database value, and local SQLite or DuckDB connections use a file path instead of host credentials. Presto requires a username, and its password is sent only over TLS.

Installing or updating the CLI does not automatically update Skills or plugins. A separate sqlx skill update command updates managed Skills. The SQLX_NO_UPDATE_CHECK=1 setting disables the interactive background update check, while piped and CI commands skip that check automatically.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about SQLX

SQLX is an MCP server that connects AI agents to remote databases and local SQLite, DuckDB, or H2 files. Its main tools manage and test named datasources, execute SQL statements, and run Redis or MongoDB commands, returning complete structured results through the SQLX command-line interface.

Install SQLX from GitHub Releases, a platform script, or `npx -y @ottermind/sqlx@latest`. The npx installer requires Node.js 22 or newer, while the installed CLI does not require Node.js. Then install the Codex or Claude Code plugin, or configure another agent to run `sqlx mcp`.

SQLX supports the database types listed in its datasource documentation, including MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, Trino, Presto, Redis, MongoDB, SQLite, DuckDB, and H2. It also supports several compatible and region-specific engines such as CockroachDB, YugabyteDB, TiDB, and OceanBase.

Yes. SQLX supports MongoDB and Redis datasources, but these connections do not use SQL. Each `--command` value is one Redis command or one MongoDB command document, and the resulting data is returned in structured form.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSQLX AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/sqlx?style=directory)](https://allmcps.com/mcp/sqlx)
HTML Embed
<a href="https://allmcps.com/mcp/sqlx"><img src="https://allmcps.com/api/badge/sqlx?style=directory" alt="SQLX on AllMCPs" /></a>