# Quarry

> Quarry is an MCP server for databases. Let agents query Postgres, MySQL, SQLite and Redis with read-only defaults and row caps. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, macOS, Linux, Self-hosted, Web
- **Website:** https://yiminspace.github.io/quarry/
- **Repository:** https://github.com/yiminspace/quarry
- **MCP Registry name:** io.github.yiminspace/quarry
- **Categories:** [databases](https://ai-powered.com/categories/databases), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-14

## About

Quarry is a database workbench written in Rust whose kernel handles connections, query execution, schema introspection and safety rules, with the CLI, browser GUI and MCP server as thin shells over it. The pitch is that agents cannot be careful, so the tool has to be: queries share read-only defaults and row caps, and write attempts without authorisation are blocked with a distinct exit code.

Supported engines are PostgreSQL, MySQL, SQLite and Redis, with experimental Neptune. MCP writes need authorisation on both the server and the request, and connections marked as production add a confirmation. Results come back as structured columns, rows, row counts and a truncated flag.

The qy command also opens a local GUI with schema browsing, EXPLAIN and history, and a SQL assistant whose proposals never execute themselves. A Docker image hosts the workbench behind your own sign-in. The registry entry ships on PyPI as quarry-db.

## Features

- **Read-only defaults:** Queries are limited and writes need explicit authorisation.
- **Structured results:** Columns, rows, row count, truncated flag and timing.
- **Four engines:** Postgres, MySQL, SQLite and Redis.
- **Local workbench:** qy gui opens schema browsing, SQL tabs and history.
- **SQL assistant:** Proposes SQL without running it.
- **Hosted option:** Docker image with your own IAM.

## Good for

- Let an agent explore a database without write risk
- Run bounded queries from scripts and CI
- Review a schema and run EXPLAIN in a GUI
- Host a read-only query workbench for a team

## Install

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

```sh
claude mcp add quarry -- uvx quarry-db
```

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": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "quarry": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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 quarry -- uvx quarry-db
```

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

```toml
[mcp_servers.quarry]
command = "uvx"
args = ["quarry-db"]
```

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

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user quarry uvx -- quarry-db

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

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

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": {
    "quarry": {
      "command": "uvx",
      "args": [
        "quarry-db"
      ]
    }
  }
}
```

## FAQ

### Can an agent write to my database?

Only with explicit authorisation. CLI writes need --write, and MCP writes need server and request approval.

### Which databases work?

PostgreSQL, MySQL, SQLite and Redis, plus experimental Neptune.

### Where do credentials live?

The README says they remain local.

### Which platforms does Quarry run on?

macOS and Linux on arm64 and x86_64, with Linux glibc 2.28 or newer.

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

Run this command in your terminal: claude mcp add quarry -- uvx quarry-db

### What are the best alternatives to Quarry?

The closest alternatives to Quarry are PostgreSQL MCP Server, Mcpg, Seqora, Warehouse MCP and dryrun.

## Where this comes from

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

## Alternatives

- [PostgreSQL MCP Server](https://ai-powered.com/mcp/postgresql-mcp-server-5): PostgreSQL MCP Server is an open-source MCP server for databases.
- [Mcpg](https://ai-powered.com/mcp/mcpg): Mcpg is an open-source MCP server for databases.
- [Seqora](https://ai-powered.com/mcp/seqora): Seqora is a freemium MCP server for databases.
- [Warehouse MCP](https://ai-powered.com/mcp/warehouse-mcp-2): Warehouse MCP is an open-source MCP server for databases.
- [dryrun](https://ai-powered.com/mcp/dryrun): dryrun is an open-source MCP server for databases.
- [PlatypusDB](https://ai-powered.com/mcp/platypusdb): PlatypusDB is an open-source MCP server for databases.
- [Mysql](https://ai-powered.com/mcp/mysql): Mysql is an open-source MCP server for databases.
- [Universal DB (read-only)](https://ai-powered.com/mcp/universal-db-read-only): Universal DB (read-only) is an open-source MCP server for databases.

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