Skip to content
MCP server

SQLX

Run SQL and commands on 30+ databases through saved, encrypted local connections

Runs locally

SQLX is a free MCP server for databases. It runs locally on your machine and is started by your AI client.

Pricing
Free
Platforms
CLI, macOS, Linux
Runs
Locally
What it can do
Can change data (1 tool)
Version
0.1.23

Similar MCP servers

Install

Add with the CLI

Run in a terminal

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.

Or share it with your project

Add to .mcp.json

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

Claude Code setup guide

Add to claude_desktop_config.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.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.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.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.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.

VS Code setup guide

Add with the CLI

Run in a terminal

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

Or add to config.toml

Add to ~/.codex/config.toml

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

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "sqlx": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/ottermind/sqlx:0.1.23"
      ]
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.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

    Antigravity

    Add to ~/.gemini/config/mcp_config.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.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.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.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.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.

    Cline setup guide

  • Zed

    Add to Zed settings.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.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

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

    Junie

    Add to ~/.junie/mcp/mcp.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.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.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.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

About SQLX

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.

Tools this server provides (2)

Taken from the project documentation; the running server may differ.

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_executeName suggests: changes
Runs SQL statements or commands; marked destructive.
sqlx_sql_viewName suggests: reads
Runs SQL for viewing results; marked destructive.

What it does

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

Pricing

Free

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

How AIPoweredBot checks servers