db-connect-mcp - Multi-Database

A read-only MCP server enabling exploration across PostgreSQL, MySQL, and ClickHouse for safe analytics and data inspection.
  • python

10

GitHub Stars

python

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "yugui923-db-connect-mcp": {
      "command": "python",
      "args": [
        "-m",
        "db_connect_mcp"
      ],
      "env": {
        "DATABASE_URL": "your_database_connection_string_here"
      }
    }
  }
}

This is a read-only MCP server that provides safe, cross-database access for exploring metadata, schemas, and analytics across PostgreSQL, MySQL/MariaDB, and ClickHouse. You can connect with an MCP client to inspect structures, preview data, run read-only queries, and obtain profiling information without modifying your databases.

How to use

You will run a local MCP server that exposes a set of read-only tools to explore and analyze your databases. Once the server is running, connect from your MCP client and use the available tools to list schemas, inspect tables, profile columns, sample data, and execute safe, read-only queries. The server enforces read-only access and validates queries to ensure safety.

How to install

Prerequisites you need before installing are Python 3.10 or higher and access to the databases you want to inspect.

Install the MCP server package with Python’s package manager.

pip install db-connect-mcp

Configuration and usage notes

Set your database connection as an environment variable. The server will detect the database type from the connection string and apply read-only parameters accordingly.

DATABASE_URL=your_database_connection_string_here

Starting the server

Run the MCP server using Python’s module interface. This approach works regardless of whether Python’s Scripts directory is on your PATH.

python -m db_connect_mcp

Security and safety notes

The server is read-only by design. It blocks data modification statements, enforces query limits, and validates queries to ensure safe read-only access across supported databases.

Troubleshooting tips

If you encounter connection issues, verify the DATABASE_URL is correct, confirm network access to the database, and ensure the user has read permissions. For PostgreSQL, ensure SSL handling is configured if required by your setup. For MySQL, check charset settings. For ClickHouse, verify the correct driver is used and the network port is accessible.

Available tools

list_schemas

List all schemas in the current connected database.

list_tables

List all tables in a schema with metadata such as size, row counts, and comments.

describe_table

Provide detailed column information, indexes, and constraints for a specified table.

analyze_column

Analyze a column to produce statistics and distribution data.

sample_data

Return a configurable sample of rows from a table for quick preview.

execute_query

Execute a read-only SQL query and return results, with an optional row limit.

get_table_relationships

Show foreign key relationships among tables in a schema.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational