{
  "markdown": "# db-connect-mcp - Multi-Database MCP Server\n\n<!-- mcp-name: io.github.yugui923/db-connect-mcp -->\n\n[![CI](https://github.com/yugui923/db-connect-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/yugui923/db-connect-mcp/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/yugui923/db-connect-mcp/actions/workflows/codeql.yml/badge.svg)](https://github.com/yugui923/db-connect-mcp/actions/workflows/codeql.yml)\n[![codecov](https://codecov.io/gh/yugui923/db-connect-mcp/graph/badge.svg)](https://codecov.io/gh/yugui923/db-connect-mcp)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/yugui923/db-connect-mcp/badge)](https://scorecard.dev/viewer/?uri=github.com/yugui923/db-connect-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA read-only MCP (Model Context Protocol) server for exploratory data analysis across multiple database systems. This server provides safe, read-only access to PostgreSQL, MySQL, and ClickHouse databases with comprehensive analysis capabilities.\n\n## Demo\n\n![db-connect-mcp demo](demo/demo.gif)\n\n## Quick Start\n\n1. **Install:**\n\n   ```bash\n   pip install db-connect-mcp\n   ```\n\n2. **Add to Claude Desktop** `claude_desktop_config.json`:\n\n   ```json\n   {\n     \"mcpServers\": {\n       \"db-connect\": {\n         \"command\": \"python\",\n         \"args\": [\"-m\", \"db_connect_mcp\"],\n         \"env\": {\n           \"DATABASE_URL\": \"postgresql://user:pass@localhost:5432/mydb\"\n         }\n       }\n     }\n   }\n   ```\n\n3. **Restart Claude Desktop** and start querying your database!\n\n> **Note**: Using `python -m db_connect_mcp` ensures the command works even if Python's Scripts directory isn't in your PATH.\n\n## Features\n\n### 🗄️ Multi-Database Support\n\n- **PostgreSQL** - Full support with advanced metadata and statistics\n- **MySQL** - Complete support for MySQL and MariaDB databases\n- **ClickHouse** - Support for analytical workloads and columnar storage\n\n### 🔍 Database Exploration\n\n- **List schemas** - View all schemas in the database\n- **List tables** - See all tables with metadata (size, row counts, comments)\n- **Describe tables** - Get detailed column information, indexes, and constraints\n- **View relationships** - Understand foreign key relationships between tables\n\n### 📊 Data Analysis\n\n- **Column profiling** - Statistical analysis of column data\n  - Basic statistics (count, unique values, nulls)\n  - Numeric statistics (mean, median, std dev, quartiles)\n  - Value frequency distribution\n  - Cardinality analysis\n- **Data sampling** - Preview table data with configurable limits\n- **Custom queries** - Execute read-only SQL queries safely\n- **Object search** - Find schemas, tables, views, columns, and indexes without loading the full catalog\n- **Query plans** - Inspect estimated plans or opt into `EXPLAIN ANALYZE` where supported\n\n### 🔒 Safety Features\n\n- **Read-only enforcement** - All connections are read-only at multiple levels\n- **Query validation** - Only SELECT and WITH queries are allowed\n- **Automatic limits** - Queries are automatically limited to prevent large result sets\n- **Connection string safety** - Automatically adds read-only parameters\n- **Database-specific safety** - Each adapter implements appropriate safety measures\n\n### 🔭 Observability\n\ndb-connect-mcp inherits the MCP SDK's built-in OpenTelemetry server\ninstrumentation. The API is a no-op until the launching process configures an\nSDK and exporter. Review exporter sampling and redaction before production use,\nbecause database identifiers and error details may be sensitive.\n\n### 💡 Best Practices\n\n> **Tip:** db-connect-mcp works best with databases that have **proper comments on tables and columns**. When your database includes descriptive comments, the MCP server can provide richer context to AI assistants, leading to better understanding of your data model and more accurate query suggestions.\n\n**Adding comments in PostgreSQL:**\n\n```sql\nCOMMENT ON TABLE users IS 'Registered user accounts with profile information';\nCOMMENT ON COLUMN users.email IS 'Primary email address, used for authentication';\nCOMMENT ON COLUMN users.is_verified IS 'Whether email has been verified via confirmation link';\n```\n\n**Adding comments in MySQL:**\n\n```sql\nALTER TABLE users COMMENT = 'Registered user accounts with profile information';\nALTER TABLE users MODIFY COLUMN email VARCHAR(255) COMMENT 'Primary email address, used for authentication';\n```\n\nThe server automatically retrieves and displays these comments when describing tables, helping AI assistants understand the purpose and semantics of your data.\n\n### 🔐 SSH Tunnel Support\n\n- **Secure remote access** - Connect to databases behind firewalls via SSH tunnels\n- **Automatic tunnel management** - Tunnel lifecycle handled transparently (start, health check, restart, cleanup)\n- **Reliable native forwarding** - Paramiko `SSHClient` transport with target preflight and stable-port recovery\n- **Flexible authentication** - Password or private key based SSH authentication\n- **Any database type** - Works with PostgreSQL, MySQL, and ClickHouse through the same tunnel\n\nSee the [SSH Tunnel Guide](docs/guides/SSH_TUNNEL.md) for configuration details.\n\n## Installation\n\n### Prerequisites\n\n- **Python 3.10 or higher**\n- **A database**: PostgreSQL (9.6+), MySQL/MariaDB (5.7+/10.2+), or ClickHouse\n\n### Install via pip\n\n```bash\npip install db-connect-mcp\n```\n\nThat's it! The package is now ready to use.\n\n> **For developers**: See [Development Guide](docs/guides/DEVELOPMENT.md) for setting up a development environment.\n\n## Configuration\n\nCreate a `.env` file with your database connection string:\n\n```env\nDATABASE_URL=your_database_connection_string_here\n```\n\nThe server automatically detects the database type and adds appropriate read-only parameters.\n\n### Connection String Examples\n\nThe server now provides more flexible and secure URL handling:\n\n- **Automatic driver detection**: Async drivers are automatically added if not specified\n- **JDBC URL support**: JDBC prefixes are automatically handled\n  - `jdbc:postgresql://...` → `postgresql+asyncpg://...`\n  - `jdbc:mysql://...` → `mysql+aiomysql://...`\n  - Works with all dialect variations (e.g., `jdbc:postgres://`, `jdbc:mariadb://`)\n- **Database dialect variations**: Common variations are automatically normalized\n  - PostgreSQL: `postgresql`, `postgres`, `pg`, `psql`, `pgsql`\n  - MySQL/MariaDB: `mysql`, `mariadb`, `maria`\n  - ClickHouse: `clickhouse`, `ch`, `click`\n- **Allowlist-based parameter filtering**: Only known-safe parameters are preserved\n- **Database-specific parameters**: Each database type has its own set of supported parameters\n- **Robust parsing**: Handles various URL formats gracefully\n\n**PostgreSQL:**\n\n```\n# Simple URL (driver automatically added)\nDATABASE_URL=postgresql://user:password@localhost:5432/mydb\n\n# Common variations (all normalized to postgresql+asyncpg)\nDATABASE_URL=postgres://user:pass@host:5432/db  # Heroku, AWS RDS style\nDATABASE_URL=pg://user:pass@host:5432/db         # Short form\nDATABASE_URL=psql://user:pass@host:5432/db       # CLI style\n\n# JDBC URLs (automatically converted)\nDATABASE_URL=jdbc:postgresql://user:pass@host:5432/db  # From Java apps\nDATABASE_URL=jdbc:postgres://user:pass@host:5432/db    # JDBC with variant\n\n# With explicit async driver\nDATABASE_URL=postgresql+asyncpg://user:pass@host:5432/db\n\n# With supported parameters (see list below)\nDATABASE_URL=postgres://user:pass@host:5432/db?application_name=myapp&connect_timeout=10\n```\n\n**Supported PostgreSQL Parameters:**\n\n- `application_name` - Identifies your app in pg_stat_activity (useful for monitoring)\n- `connect_timeout` - Connection timeout in seconds\n- `command_timeout` - Default timeout for operations\n- `ssl` / `sslmode` - SSL connection requirements (automatically converted for asyncpg compatibility)\n- `server_settings` - Server settings dictionary\n- `options` - Command-line options to send to server\n- Performance tuning: `prepared_statement_cache_size`, `max_cached_statement_lifetime`, etc.\n\n**MySQL/MariaDB:**\n\n```\n# Simple URL (driver automatically added)\nDATABASE_URL=mysql://root:password@localhost:3306/mydb\n\n# MariaDB URLs (normalized to mysql+aiomysql)\nDATABASE_URL=mariadb://user:pass@host:3306/db    # MariaDB style\nDATABASE_URL=maria://user:pass@host:3306/db      # Short form\n\n# JDBC URLs (automatically converted)\nDATABASE_URL=jdbc:mysql://user:pass@host:3306/db     # From Java apps\nDATABASE_URL=jdbc:mariadb://user:pass@host:3306/db   # JDBC MariaDB\n\n# With explicit async driver\nDATABASE_URL=mysql+aiomysql://user:pass@host:3306/db\n\n# With charset (critical for proper Unicode support)\nDATABASE_URL=mariadb://user:pass@remote.host:3306/db?charset=utf8mb4\n```\n\n**Supported MySQL Parameters:**\n\n- `charset` - Character encoding (e.g., utf8mb4) - **critical for data integrity**\n- `use_unicode` - Enable Unicode support\n- `connect_timeout`, `read_timeout`, `write_timeout` - Various timeouts\n- `autocommit` - Transaction autocommit mode\n- `init_command` - Initial SQL command to run\n- `sql_mode` - SQL mode settings\n- `time_zone` - Time zone setting\n\n**ClickHouse:**\n\n```\n# Simple URL (driver automatically added)\nDATABASE_URL=clickhouse://default:@localhost:9000/default\n\n# Short forms (normalized to clickhouse+asynch)\nDATABASE_URL=ch://user:pass@host:9000/db         # Short form\nDATABASE_URL=click://user:pass@host:9000/db      # Alternative\n\n# JDBC URLs (automatically converted)\nDATABASE_URL=jdbc:clickhouse://user:pass@host:9000/db  # From Java apps\nDATABASE_URL=jdbc:ch://user:pass@host:9000/db         # JDBC with short form\n\n# With explicit async driver\nDATABASE_URL=clickhouse+asynch://user:pass@host:9000/db\n\n# With performance settings\nDATABASE_URL=ch://user:pass@host:9000/db?timeout=60&max_threads=4\n```\n\n**Supported ClickHouse Parameters:**\n\n- `database` - Default database selection\n- `timeout`, `connect_timeout`, `send_receive_timeout` - Various timeouts\n- `compress`, `compression` - Enable compression\n- `max_block_size`, `max_threads` - Performance tuning\n\n**Note:**\n\n- SSL parameters (`ssl`, `sslmode`) are automatically converted to the correct format for asyncpg\n- Certificate file parameters (`sslcert`, `sslkey`, `sslrootcert`) are filtered out as they can cause compatibility issues\n- Only parameters known to work with async drivers are preserved\n\n## Usage\n\n### Running the Server\n\n```bash\n# Run the server (works everywhere, no PATH configuration needed)\npython -m db_connect_mcp\n\n# With environment variable\nDATABASE_URL=\"postgresql://user:pass@host:5432/db\" python -m db_connect_mcp\n```\n\n> **Note**: Using `python -m db_connect_mcp` works regardless of whether Python's Scripts directory is in your PATH.\n\n### Using with Claude Code\n\nAdd the MCP server to your project's `.mcp.json`:\n\n```bash\nclaude mcp add --transport stdio db-connect --scope project \\\n  --env DATABASE_URL=postgresql://user:pass@host:5432/db \\\n  -- python -m db_connect_mcp\n```\n\nOr manually create `.mcp.json` in your project root. Below are examples for each supported database:\n\n**PostgreSQL:**\n\n```json\n{\n  \"mcpServers\": {\n    \"db-connect-mcp\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"postgresql+asyncpg://user:pass@host:5432/mydb\"\n      }\n    }\n  }\n}\n```\n\n**MySQL:**\n\n```json\n{\n  \"mcpServers\": {\n    \"db-connect-mcp\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"mysql+aiomysql://user:pass@host:3306/mydb\"\n      }\n    }\n  }\n}\n```\n\n**ClickHouse:**\n\n```json\n{\n  \"mcpServers\": {\n    \"db-connect-mcp\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"clickhouse+asynch://default:@host:9000/default\"\n      }\n    }\n  }\n}\n```\n\n**PostgreSQL via SSH tunnel** (database behind a firewall, reachable only through a bastion host):\n\n```json\n{\n  \"mcpServers\": {\n    \"db-connect-mcp\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"postgresql+asyncpg://user:pass@db-internal:5432/mydb\",\n        \"SSH_HOST\": \"bastion.example.com\",\n        \"SSH_PORT\": \"22\",\n        \"SSH_USERNAME\": \"deployer\",\n        \"SSH_PRIVATE_KEY_PATH\": \"/home/user/.ssh/id_rsa\"\n      }\n    }\n  }\n}\n```\n\n**MySQL via SSH tunnel:**\n\n```json\n{\n  \"mcpServers\": {\n    \"db-connect-mcp\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"mysql+aiomysql://user:pass@db-internal:3306/mydb\",\n        \"SSH_HOST\": \"bastion.example.com\",\n        \"SSH_PORT\": \"22\",\n        \"SSH_USERNAME\": \"deployer\",\n        \"SSH_PASSWORD\": \"secret\"\n      }\n    }\n  }\n}\n```\n\n**Multiple databases** (each MCP server instance connects to one database):\n\n```json\n{\n  \"mcpServers\": {\n    \"postgres-prod\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"postgresql+asyncpg://user:pass@pg-host:5432/prod\"\n      }\n    },\n    \"mysql-analytics\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"mysql+aiomysql://user:pass@mysql-host:3306/analytics\"\n      }\n    }\n  }\n}\n```\n\nAfter creating `.mcp.json`, restart Claude Code and verify with `/mcp`. You should see `db-connect-mcp` listed with all available tools.\n\n> **Tip:** Instead of `SSH_PRIVATE_KEY_PATH`, you can use `SSH_PRIVATE_KEY` to pass the private key content directly as a string (raw PEM or base64-encoded PEM). This is useful in CI/CD or cloud environments where mounting key files is impractical.\n\nSee the [SSH Tunnel Guide](docs/guides/SSH_TUNNEL.md) for full tunnel configuration reference.\n\n### Using with Claude Desktop\n\nAdd the server to your Claude Desktop configuration (`claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"db-connect\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"db_connect_mcp\"],\n      \"env\": {\n        \"DATABASE_URL\": \"postgresql+asyncpg://user:pass@host:5432/db\"\n      }\n    }\n  }\n}\n```\n\nThe same database URL formats and SSH tunnel environment variables shown in the Claude Code examples above work identically with Claude Desktop.\n\n> **For development**: See [Development Guide](docs/guides/DEVELOPMENT.md) for running from source with uv.\n\n## Database Feature Support\n\n| Feature      | PostgreSQL | MySQL    | ClickHouse |\n| ------------ | ---------- | -------- | ---------- |\n| Schemas      | ✅ Full    | ✅ Full  | ✅ Full    |\n| Tables       | ✅ Full    | ✅ Full  | ✅ Full    |\n| Views        | ✅ Full    | ✅ Full  | ✅ Full    |\n| Indexes      | ✅ Full    | ✅ Full  | ⚠️ Limited |\n| Foreign Keys | ✅ Full    | ✅ Full  | ❌ No      |\n| Constraints  | ✅ Full    | ✅ Full  | ⚠️ Limited |\n| Table Size   | ✅ Exact   | ✅ Exact | ✅ Exact   |\n| Row Count    | ✅ Exact   | ✅ Exact | ✅ Exact   |\n| Column Stats | ✅ Full    | ✅ Full  | ✅ Full    |\n| Sampling     | ✅ Full    | ✅ Full  | ✅ Full    |\n\n## MCP Resources\n\nModern MCP clients can discover database context as private, cache-aware JSON\nresources in addition to calling tools:\n\n- `db-connect://database` — database identity, dialect, and capabilities\n- `db-connect://schema/{schema}` — schema counts and metadata\n- `db-connect://table/{schema}/{table}` — columns, indexes, constraints, and comments\n\nThe schema and table forms are also advertised as resource templates for direct\naccess when the identifier is already known.\n\nResource catalogs are URI-sorted and cursor-paginated in pages of 100. Cursors\nare tied to a catalog snapshot; if schemas or tables change between pages, the\nserver asks the client to restart pagination instead of returning an\ninconsistent traversal.\n\n## Available Tools\n\nAll tools publish JSON Schema input and output contracts, read-only behavior\nannotations, and machine-readable structured results. The same result remains\navailable as JSON text for clients that do not yet consume MCP structured\ncontent. Structured list results use an `items` envelope while their legacy\ntext form remains a JSON array.\n\n### get_database_info\n\nGet database metadata, including the dialect, version, connection details,\nread-only status, and capabilities.\n\n### list_schemas\n\nList all schemas in the database.\n\n### list_tables\n\nList all tables in a schema with metadata.\n\n- Parameters:\n  - `schema` (optional): Schema name (default: \"public\")\n\n### describe_table\n\nGet detailed information about a table.\n\n- Parameters:\n  - `table`: Name of the table\n  - `schema` (optional): Schema name (default: \"public\")\n\n### analyze_column\n\nAnalyze a column with statistics and distribution.\n\n- Parameters:\n  - `table`: Name of the table\n  - `column`: Name of the column\n  - `schema` (optional): Schema name (default: \"public\")\n\n### sample_data\n\nGet a sample of data from a table.\n\n- Parameters:\n  - `table`: Name of the table\n  - `schema` (optional): Schema name (default: \"public\")\n  - `limit` (optional): Number of rows (default: 100, max: 1000)\n\n### execute_query\n\nExecute a read-only SQL query.\n\n- Parameters:\n  - `query`: SQL query (must be SELECT or WITH)\n  - `limit` (optional): Maximum rows (default: 1000, max: 10000)\n\n### get_table_relationships\n\nGet foreign key relationships for a table.\n\n- Parameters:\n  - `table`: Name of the table\n  - `schema` (optional): Schema name (default: \"public\")\n\n### explain_query\n\nGet a database-specific query execution plan.\n\n- Parameters:\n  - `query`: SQL query to explain\n  - `analyze` (optional): Execute the query and include actual runtime statistics (default: false)\n\n### search_objects\n\nSearch schemas, tables, views, columns, and indexes with progressive detail.\n\n- Parameters:\n  - `pattern`: SQL `LIKE` pattern, such as `%user%`\n  - `object_types` (optional): Object types to include\n  - `detail_level` (optional): `names`, `summary`, or `full` (default: `summary`)\n  - `schema` (optional): Restrict the search to a schema\n  - `table` (optional): Restrict column and index searches to a table\n  - `limit` (optional): Maximum matches (default: 100, max: 1000)\n\n## Example Usage in Claude\n\nOnce configured, you can use the server in Claude:\n\n```\n\"Can you analyze my database and tell me about the table structure?\"\n\n\"Show me the relationships between tables in the public schema\"\n\n\"What's the distribution of values in the users.created_at column?\"\n\n\"Give me a sample of data from the orders table\"\n\n\"Run this query: SELECT COUNT(*) FROM users WHERE created_at > '2024-01-01'\"\n```\n\n### Database-Specific Examples\n\n**Working with PostgreSQL:**\n\n```\n\"List all schemas except system ones\"\n\"Show me the foreign key relationships in the sales schema\"\n\"Analyze the performance of indexes on the products table\"\n```\n\n**Working with MySQL:**\n\n```\n\"What storage engines are being used in my database?\"\n\"Show me all tables in the information_schema\"\n\"Analyze the customer_orders table structure\"\n```\n\n**Working with ClickHouse:**\n\n```\n\"Show me the partitions for the events table\"\n\"What's the compression ratio for the analytics.clicks table?\"\n\"Sample 1000 rows from the metrics table\"\n```\n\n## Safety and Security\n\n- **Read-only by design**: The server enforces read-only access at multiple levels:\n  - Connection string parameters\n  - Session-level settings\n  - Query validation\n\n- **No data modification**: INSERT, UPDATE, DELETE, CREATE, DROP, and other modification statements are blocked\n\n- **Query limits**: All queries are automatically limited to prevent excessive resource usage\n\n- **No sensitive operations**: No access to system catalogs or administrative functions\n\n## Development\n\nFor detailed development setup, testing, and contribution guidelines, see the [Development Guide](docs/guides/DEVELOPMENT.md).\n\n### Project Structure\n\n```\ndb-connect-mcp/\n├── src/\n│   └── db_connect_mcp/\n│       ├── adapters/         # Database-specific adapters\n│       │   ├── __init__.py\n│       │   ├── base.py      # Base adapter interface\n│       │   ├── postgresql.py # PostgreSQL adapter\n│       │   ├── mysql.py     # MySQL adapter\n│       │   └── clickhouse.py # ClickHouse adapter\n│       ├── core/            # Core functionality\n│       │   ├── __init__.py\n│       │   ├── connection.py # Database connection management\n│       │   ├── executor.py  # Query execution\n│       │   ├── inspector.py # Metadata inspection\n│       │   ├── analyzer.py  # Statistical analysis\n│       │   └── tunnel.py   # SSH tunnel management\n│       ├── models/          # Data models\n│       │   ├── __init__.py\n│       │   ├── capabilities.py # Database capabilities\n│       │   ├── config.py    # Configuration models\n│       │   ├── database.py  # Database models\n│       │   ├── query.py     # Query models\n│       │   ├── statistics.py # Statistics models\n│       │   └── table.py     # Table metadata models\n│       ├── __init__.py\n│       ├── __main__.py      # Module entry point\n│       └── server.py        # Main MCP server implementation\n├── tests/\n│   ├── unit/            # Unit tests (mocked)\n│   ├── module/          # Module tests (single component + DB)\n│   ├── integration/     # Integration tests (full stack)\n│   └── conftest.py      # Shared fixtures\n├── .env.example         # Example environment configuration\n├── pyproject.toml      # Project dependencies and console scripts\n└── README.md          # This file\n```\n\n### Architecture\n\nThe server uses an adapter pattern to support multiple database systems:\n\n- **Adapters**: Each database type has its own adapter that implements database-specific functionality\n- **Core**: Shared functionality for connection management, query execution, and metadata inspection\n- **Models**: Pydantic models for type safety and validation\n- **Server**: MCP server implementation that routes requests to appropriate components\n\n### Running Tests\n\n```bash\n# Start local test database (PostgreSQL 17 with sample data)\ncd tests/docker && docker-compose up -d && cd ../..\n\n# Run all tests in parallel (preferred - 6 workers)\nuv run pytest -n 6\n\n# Run specific test modules\nuv run pytest tests/module/test_inspector.py -v -n 6\nuv run pytest tests/integration/ -v -n 6\n\n# Stop test database\ncd tests/docker && docker-compose down && cd ../..\n\n# Reset database (clean slate with fresh data)\ncd tests/docker && docker-compose down -v && docker-compose up -d && cd ../..\n```\n\n**Local Test Database:**\n\n- PostgreSQL 17 with 50K+ rows of sample data across 7 tables\n- Automatically initialized via Docker Compose\n- No cloud database or .env configuration required\n- See [Docker Setup](docs/guides/DOCKER.md) for details\n\nSee the [Development Guide](docs/guides/DEVELOPMENT.md#running-tests) and [Testing Guide](docs/guides/TESTING.md) for detailed testing instructions.\n\n## Troubleshooting\n\n### Connection Issues\n\n- Verify your DATABASE_URL is correct and includes the appropriate driver\n- Check network connectivity to the database\n- Ensure the database user has appropriate read permissions\n- For PostgreSQL: Check if SSL is required (`?ssl=require`)\n- For MySQL: Verify charset settings (`?charset=utf8mb4`)\n- For ClickHouse: Check port (default is 9000 for native, 8123 for HTTP)\n\n### Database-Specific Issues\n\n**PostgreSQL:**\n\n- Ensure `asyncpg` driver is specified for async operations\n- SSL certificates may be required for cloud databases\n\n**MySQL/MariaDB:**\n\n- Use `aiomysql` driver for async support\n- Check MySQL version compatibility (5.7+ or MariaDB 10.2+)\n- Verify charset and collation settings\n\n**ClickHouse:**\n\n- Use `asynch` driver for async operations\n- Note that ClickHouse has limited support for foreign keys and constraints\n- Some statistical functions may not be available\n\n### Permission Errors\n\n- The database user needs at least SELECT permissions on the schemas/tables you want to analyze\n- Some statistical functions may require additional permissions\n- ClickHouse may require specific permissions for system tables\n\n### Large Result Sets\n\n- Use the `limit` parameter to control result size\n- The server automatically limits results to prevent memory issues\n- For large analyses, consider using more specific queries\n\n## Author\n\nCreated by [Yuri Gui](https://github.com/yugui923).\n\n## Contributing\n\nContributions are welcome! The server is designed to be read-only and safe by default. Any new features should maintain these safety guarantees.\n\n## License\n\nMIT License - See LICENSE file for details\n",
  "bytes": 24301,
  "sha": "0c901edf0d1ebd1005d0aec8823adb6c2f040b6f8aed8f066fdc5dc0b27fb93e",
  "repo_slug": "yugui923/db-connect-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_yugui923_db_connect_mcp_25a7eb32/readme"
}