# SQLX MCP server

> Execute SQL commands across over 30 different database types through encrypted, locally stored connections.

- Repository: https://github.com/OtterMind/sqlx
- Page: https://hostedmcp.org/servers/ottermind/sqlx
- Transport: stdio
- Stars: 3
- Latest version: 0.1.22

## Install

### Claude Code

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

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

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

### VS Code (`.vscode/mcp.json`)

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

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex (`~/.codex/config.toml`)

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

### Gemini CLI (`~/.gemini/settings.json`)

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

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SQLX_TEST_GBASE8S_DRIVER` | no | no |  |
| `SQLX_WORKER_DIR` | no | no |  |

## FAQ

### Which databases are supported?

SQLX supports over 30 databases including MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, MongoDB, Redis, SQLite, and DuckDB.

### How are my database credentials stored?

Connections are saved using encryption, and credentials stay stored locally on your machine.

### Can I use SQLX with an AI agent?

Yes, it provides plugins and extensions for agents like Claude Code, Codex, DeepSeek Harness, and Pi.

### How can I prevent my password from appearing in chat history?

You can use the --ui flag when adding a datasource to allow typing the password in a local web page instead of the terminal.
