Skip to main content
Glama
seraved
by seraved

mcp_db

MCP server for running SQL against PostgreSQL and ClickHouse (HTTP interface) connections, with per-connection allow/deny policy by statement group (DDL/DML/DQL/DCL/TCL).

Built on mcp_core.

Install

poetry install

Related MCP server: Multi-DB MCP Server

Configure

Copy db_connections.example.yaml to db_connections.yaml, edit connections. Secrets are env-var references only (user_env/password_env) — export the actual values before starting the server.

Run

export MCP_DB_CONFIG=/path/to/db_connections.yaml
export PG_USER=... PG_PASSWORD=...
export CH_USER=... CH_PASSWORD=...
poetry run mcp-db

Tools

  • db_query(connection, sql) — DQL only, rows truncated at max_rows.

  • db_execute(connection, sql) — DDL/DML/DCL/TCL, returns rowcount.

  • db_list_connections() — lists configured connection names, drivers, and policy modes.

Policy modes (per connection, mode field)

  • readonly (default) — only DQL allowed.

  • restricted — only groups listed in allow_groups allowed; empty allow_groups denies everything.

  • unrestricted — everything allowed except groups listed in deny_groups.

Tests

poetry run pytest -m "not integration"                       # fast unit tests
docker compose -f docker-compose-test.yml up -d               # postgres + clickhouse test containers
poetry run pytest                                              # full suite
docker compose -f docker-compose-test.yml down
F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    C
    maintenance
    A multi-database MCP server supporting PostgreSQL, ClickHouse, and MySQL that enables database exploration and SQL execution through MCP stdio or HTTP API.
  • A
    license
    -
    quality
    F
    maintenance
    Read-only MCP server for SQL databases (SQL Server, Postgres, SQLite) with multi-server support and three-layer safety using AST validation and linting.
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A self-hostable PostgreSQL MCP server for exploring database schemas and running guarded read/write queries with selectable access modes (readonly, readwrite, admin), plus a dry-run confirm workflow for safety.
    14
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for managing Prisma Postgres.

  • MCP server for interacting with the Supabase platform

  • MCP server for Blockscout

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seraved/mcp_db'

If you have feedback or need assistance with the MCP directory API, please join our Discord server