MCP directory

DB MCP Server

by github.com/stucchi · v1.2.1 · updated Mar 24, 2026

Database MCP server for MySQL, PostgreSQL, MongoDB, and SQLite with SSH tunneling support.

PyPI

Run it locally

Install the package and point your AI client at it.

PyPI

uvx db-mcp-server==1.2.1

Environment variables

  • DB_TYPErequired

    Database type

  • DB_DATABASErequired

    Database name

  • DB_MODE

    Access mode

  • DB_HOST

    Database host (MySQL/PostgreSQL)

  • DB_PORT

    Database port (MySQL: 3306, PostgreSQL: 5432)

  • DB_USER

    Database user (MySQL default: root, PostgreSQL default: postgres)

  • DB_PASSWORDsecret

    Database password (MySQL/PostgreSQL, optional)

  • DB_URLsecret

    MongoDB connection URL (required for MongoDB, e.g. mongodb://...)

  • SSH_HOST

    SSH bastion host for tunneling (MySQL/PostgreSQL only)

  • SSH_PORT

    SSH port

  • SSH_USER

    SSH username (default: current OS user)

  • SSH_KEY

    Path to SSH private key (e.g. ~/.ssh/id_rsa)

  • SSH_PASSWORDsecret

    SSH password (if no key provided)

More from github.com/stucchi

More MCP servers