# SQLX

> SQLX is a free MCP server for databases. Run SQL and commands on 30+ databases through saved, encrypted local connections. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, macOS, Linux, Windows, Self-hosted
- **Repository:** https://github.com/ottermind/sqlx
- **MCP Registry name:** io.github.OtterMind/sqlx
- **Categories:** [databases](https://ai-powered.com/categories/databases), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

SQLX is a CLI whose `sqlx mcp` mode serves agents. Connections are saved encrypted and credentials stay local; the agent calls them by name. The list covers MySQL and relatives, PostgreSQL and relatives, Oracle, SQL Server, ClickHouse, Trino, StarRocks, Db2, Redis and MongoDB, plus local SQLite, DuckDB and H2 files.

One invocation runs one or more statements and returns complete structured results. The two execution tools, `sqlx_sql_execute` and `sqlx_sql_view`, are marked destructive so clients ask first. Plugins exist for Codex, Claude Code, DeepSeek Harness and Pi, and the installer also installs a Skill with engine knowledge. The registry lists a container image, but the README recommends the package for credential entry.

## Features

- **30+ databases:** SQL engines, Redis and MongoDB, plus local files.
- **Encrypted connections:** Credentials are stored encrypted and stay local.
- **Multi-statement runs:** One call runs several commands.
- **Agent plugins:** Plugins for Codex, Claude Code, dsh and Pi.
- **Skill install:** Installs engine-specific guidance for the agent.

## Good for

- Query a Postgres dev database from chat
- Inspect a ClickHouse table
- Run Redis commands
- Open a local DuckDB file

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add sqlx -- docker run -i --rm ghcr.io/ottermind/sqlx:0.1.23
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add sqlx -- docker run -i --rm ghcr.io/ottermind/sqlx:0.1.23
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.sqlx]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/ottermind/sqlx:0.1.23"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user sqlx docker -- run -i --rm ghcr.io/ottermind/sqlx:0.1.23

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 2 tools changes data. From the server's own tool labels and tool names; not verified by us.

- `sqlx_sql_execute` (name suggests: changes): Runs SQL statements or commands; marked destructive.
- `sqlx_sql_view` (name suggests: reads): Runs SQL for viewing results; marked destructive.

## FAQ

### Where are credentials kept?

Saved encrypted on your machine.

### Which tools run SQL?

sqlx_sql_execute and sqlx_sql_view, both marked destructive.

### What does SQLX need?

Node.js 22 or newer for the installer; the CLI itself doesn't need it.

### Can SQLX run in Docker?

Yes, but only the SQL path works fully.

### Is SQLX free?

Yes. SQLX is free to use.

### How do I add SQLX to Claude Code?

Run this command in your terminal: claude mcp add sqlx -- docker run -i --rm ghcr.io/ottermind/sqlx:0.1.23

### What are the best alternatives to SQLX?

The closest alternatives to SQLX are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/sqlx
