# SQLX [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/OtterMind/sqlx  
**GitHub Stars:** 2  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sqlx

## Description
Database CLI for agents: 31 engines, encrypted credentials, complete structured results.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "sqlx": {
    "command": "npx",
    "args": ["-y","@ottermind/sqlx@latest"]
  }
}
```

## Documentation

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

_Full upstream README: https://allmcps.com/mcp/sqlx/readme_

