Skip to content
MCP server

Lomberk

Postgres gateway that blocks destructive SQL, holds risky writes and can undo applied ones

Runs locally

Lomberk is an MCP server for databases. It runs locally on your machine and is started by your AI client.

Platforms
CLI
Runs
Locally
Version
0.2.1
Listing updated

Similar MCP servers

Install

You install MCP servers on a computer. Send yourself the link.

Add with the CLI

Run in a terminal

claude mcp add lomberk --env LOMBERK_CONFIG='<LOMBERK_CONFIG>' --env LOMBERK_AGENT_DSN='<LOMBERK_AGENT_DSN>' --env LOMBERK_ADMIN_DSN='<LOMBERK_ADMIN_DSN>' -- uvx lomberk

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": {
    "lomberk": {
      "command": "uvx",
      "args": [
        "lomberk"
      ],
      "env": {
        "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
        "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
        "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
      }
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "lomberk": {
      "command": "uvx",
      "args": [
        "lomberk"
      ],
      "env": {
        "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
        "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
        "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
      }
    }
  }
}

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

Claude Desktop setup guide

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "lomberk": {
      "command": "uvx",
      "args": [
        "lomberk"
      ],
      "env": {
        "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
        "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
        "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
      }
    }
  }
}

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

Cursor setup guide

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "lomberk": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "lomberk"
      ],
      "env": {
        "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
        "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
        "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
      }
    }
  }
}

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 lomberk --env LOMBERK_CONFIG='<LOMBERK_CONFIG>' --env LOMBERK_AGENT_DSN='<LOMBERK_AGENT_DSN>' --env LOMBERK_ADMIN_DSN='<LOMBERK_ADMIN_DSN>' -- uvx lomberk

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.lomberk]
command = "uvx"
args = ["lomberk"]
env = { LOMBERK_CONFIG = "<LOMBERK_CONFIG>", LOMBERK_AGENT_DSN = "<LOMBERK_AGENT_DSN>", LOMBERK_ADMIN_DSN = "<LOMBERK_ADMIN_DSN>" }

Codex setup guide

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

{
  "mcpServers": {
    "lomberk": {
      "command": "uvx",
      "args": [
        "lomberk"
      ],
      "env": {
        "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
        "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
        "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
      }
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    Or run: gemini mcp add -s user -e LOMBERK_CONFIG='<LOMBERK_CONFIG>' -e LOMBERK_AGENT_DSN='<LOMBERK_AGENT_DSN>' -e LOMBERK_ADMIN_DSN='<LOMBERK_ADMIN_DSN>' lomberk uvx -- lomberk

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    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": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    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": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

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

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    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": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    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": {
        "lomberk": {
          "command": "uvx",
          "args": [
            "lomberk"
          ],
          "env": {
            "LOMBERK_CONFIG": "<LOMBERK_CONFIG>",
            "LOMBERK_AGENT_DSN": "<LOMBERK_AGENT_DSN>",
            "LOMBERK_ADMIN_DSN": "<LOMBERK_ADMIN_DSN>"
          }
        }
      }
    }

    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.

Configuration

  • LOMBERK_CONFIGAbsolute path to the lomberk.yaml that `lomberk setup` wrote. The connection strings and keys are read from the .env beside it.Required
  • LOMBERK_AGENT_DSNConnection string for the low-privilege role the agent's SQL runs as. Only needed when the .env beside lomberk.yaml doesn't set it.
  • LOMBERK_ADMIN_DSNConnection string for the control role that owns the lomberk schema (checkpoints, undo, ledger). Only needed when the .env beside lomberk.yaml doesn't set it.

About Lomberk

Lomberk sits between an agent and PostgreSQL so the agent never holds the database password. It runs agent SQL as a low-privilege role, refuses DDL using Postgres's own parser, rejects writes without a WHERE clause, and allows only an allowlist of pure built-in functions. Writes that touch more rows than a limit, or hit protected tables, are rolled back and queued for a person who reads the exact SQL.

Undo works from a trigger that records each changed row, cascades included. Rows are restored parents first, and undo stops and names the row if it changed after the checkpoint or the schema drifted. Checkpoints form an append-only SHA-256 chain that lomberk verify-ledger can check.

The site lists limits: cloud tokens held by an agent are out of scope, superusers can disable triggers, and tables with rules or classic inheritance are refused. It reports 18.3 ms for a captured write.

What it does

Destructive SQL blocked
DDL and unbounded writes are refused.
Held risky writes
Large or protected-table changes wait for a person.
Undo with FK order
Deleted rows return parents first.
Hash-chained ledger
Verify the checkpoint ledger for tampering.
Least-privilege roles
`lomberk setup` creates two roles and installs it.
Client config line
Prints setup for Claude Code, Cursor, VS Code, Codex.

Good for

  • Let an agent write to Postgres without raw credentials
  • Review risky updates before they apply
  • Reverse a bad DELETE without a point-in-time restore
  • Audit agent writes with a verifiable ledger

Lomberk FAQ

Which Postgres versions are tested?

Postgres 14 to 18.

Does undo overwrite later changes?

No, it stops and names the row if it changed since the checkpoint.

What does Lomberk not cover?

Cloud tokens, superusers and some tables with rules or inheritance.

How is Lomberk installed?

Run `uvx lomberk setup`, then add the server line to your client.

How do I add Lomberk to Claude Code?

Run this command in your terminal: claude mcp add lomberk --env LOMBERK_CONFIG='<LOMBERK_CONFIG>' --env LOMBERK_AGENT_DSN='<LOMBERK_AGENT_DSN>' --env LOMBERK_ADMIN_DSN='<LOMBERK_ADMIN_DSN>' -- uvx lomberk

What are the best alternatives to Lomberk?

The closest alternatives to Lomberk are REA, MCP Toolbox for Databases, redamon, AiSOC and Bernstein.

Where this comes from

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

How AIPoweredBot checks servers