# DBShield Database Guardrail & Sandboxing MCP Server

> DBShield Database Guardrail & Sandboxing MCP Server is an open-source MCP server for databases. Guardrail MCP server that dry-runs agent SQL and masks sensitive tables. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/ritualdev-lab/dbshield
- **MCP Registry name:** io.github.RitualDev-Lab/dbshield
- **Categories:** [databases](https://ai-powered.com/categories/databases), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-23

## About

DBShield targets the gap between what an AI coding agent says it wants and what its SQL does. A mutation is run inside a transaction that is rolled back, so the agent sees the affected rows and column changes before anything touches the real database.

If the effect looks out of line, such as a delete hitting far more rows than expected or a role column changing, the change is held for sign-off through a Slack or Teams card. The README also describes virtual schema masking, which hides tables like credentials or api_keys from introspection queries, plus query normalisation against comment and Unicode tricks and an HMAC-signed audit trail.

It supports PostgreSQL, MySQL and SQLite and is configured with a dialect and a connection URL. It is MIT licensed and runs over stdio from npm.

## Features

- **Dry-run sandbox:** Runs writes in a rolled-back transaction to preview exact row impact.
- **Intent versus effect check:** Compares the stated intent with the simulated blast radius.
- **Schema masking:** Hides sensitive tables and columns from introspection.
- **Human approval:** Sends risky changes to Slack or Teams for sign-off.
- **Signed audit trail:** Records commits with an HMAC-SHA256 ledger.

## Good for

- Stop a missing WHERE clause from wiping a table
- Keep API keys and PII out of an agent's context
- Require sign-off on bulk production changes
- Preview what an agent's migration would change

## Install

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

```sh
claude mcp add dbshield -- npx -y @ritualdev-lab/dbshield
```

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": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbshield": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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 dbshield -- npx -y @ritualdev-lab/dbshield
```

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

```toml
[mcp_servers.dbshield]
command = "npx"
args = ["-y", "@ritualdev-lab/dbshield"]
```

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

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user dbshield npx -- -y @ritualdev-lab/dbshield

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

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

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": {
    "dbshield": {
      "command": "npx",
      "args": [
        "-y",
        "@ritualdev-lab/dbshield"
      ]
    }
  }
}
```

## FAQ

### Which databases work?

PostgreSQL, MySQL and SQLite.

### How is DBShield Database Guardrail & Sandboxing MCP Server configured?

With DBSHIELD_DIALECT (default sqlite) and DBSHIELD_DB_URL for the target.

### Which clients does DBShield Database Guardrail & Sandboxing MCP Server name?

Cursor, Claude Desktop, Antigravity and Windsurf.

### What licence is DBShield Database Guardrail & Sandboxing MCP Server under?

MIT, per the README badge.

### Is DBShield Database Guardrail & Sandboxing MCP Server free?

Yes. DBShield Database Guardrail & Sandboxing MCP Server is open source, so you can use and self-host it for free.

### How do I add DBShield Database Guardrail & Sandboxing MCP Server to Claude Code?

Run this command in your terminal: claude mcp add dbshield -- npx -y @ritualdev-lab/dbshield

### What are the best alternatives to DBShield Database Guardrail & Sandboxing MCP Server?

The closest alternatives to DBShield Database Guardrail & Sandboxing MCP Server are REA, AiSOC, x64dbg-mcp-server, redamon and Treasure Map.

## 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.
- [AiSOC](https://ai-powered.com/mcp/aisoc): AiSOC is an open-source MCP server for ai models and llm tooling.
- [x64dbg-mcp-server](https://ai-powered.com/mcp/x64dbg-mcp-server): x64dbg-mcp-server is an open-source MCP server for ai models and llm tooling.
- [redamon](https://ai-powered.com/mcp/redamon): redamon is an open-source MCP server for ai models and llm tooling.
- [Treasure Map](https://ai-powered.com/mcp/treasure-map): Treasure Map is an open-source MCP server for security.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [NostrPulse](https://ai-powered.com/mcp/nostrpulse): NostrPulse is an open-source MCP server for finance and payments.
- [Runeward](https://ai-powered.com/mcp/runeward): Runeward is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/dbshield-database-guardrail-and-sandboxing-mcp-server
