Sign inSign up

gotlib12345/dbmcp

By gotlib12345

Updated about 2 months ago

MCP server for SQL on PostgreSQL, SQL Server, MySQL, and Oracle.

Image
Machine learning & AI
0

339

gotlib12345/dbmcp repository overview

DBmcp

MCP (Model Context Protocol) server for running SQL against multiple databases via ADO.NET.

Supported databases: PostgreSQL · SQL Server · MySQL / MariaDB · Oracle

Tools

  • Query — execute SQL and return JSON results. By default only read-only SELECT is allowed; set DBMCP_UNSAFE=true to permit INSERT/UPDATE/DELETE/DDL
  • AddDBConfig — save a connection string under an alias
  • GetDBConfig / GetAllDBConfigs — read saved aliases
  • DeleteDBConfig — remove an alias

Quick start

docker run -i --rm \
  --add-host=host.docker.internal:host-gateway \
  -e DBMCP_CONFIG_DIR=/config \
  -e DBMCP_UNSAFE=false \
  -v /host/path/to/configs:/config \
  gotlib12345/dbmcp:latest

Mount a host directory to /config — without a volume, saved connection aliases are lost when the container stops.

MCP client example (Claude Desktop)

{
  "mcpServers": {
    "dbmcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "--add-host=host.docker.internal:host-gateway",
        "-e", "DBMCP_CONFIG_DIR=/config",
        "-e", "DBMCP_UNSAFE=false",
        "-v", "C:\\path\\to\\configs:/config",
        "gotlib12345/dbmcp:latest"
      ]
    }
  }
}

Environment variables

VariableRequiredDescription
DBMCP_CONFIG_DIRYesDirectory for persisted connection configs (use /config with a volume)
DBMCP_UNSAFENotrue / 1 / yes — allow write/DDL SQL. Default: read-only SELECT only
DBMCP_LOCALHOST_HOSTNoReplace localhost / 127.0.0.1 in connection strings (default in Docker: host.docker.internal)

Tags

  • latest — newest build
  • vX.Y.Z — versioned releases

Source

https://github.com/gotylib/DBmcp

Tag summary

Content type

Image

Digest

sha256:74f68f41e

Size

54.7 MB

Last updated

about 2 months ago

docker pull gotlib12345/dbmcp