mcp-win-stdio-db
Unified Database Model Context Protocol (MCP) server for PostgreSQL and MySQL with multi-server in-memory pooling, sibling database auto-derivation, cross-schema resolution, and complete DBA operations.
Part of the mcp-win-stdio Windows-optimized suite.
🚀 Features (20 Tools)
- Polyglot Database Engine: Handles PostgreSQL (
psycopg2) and MySQL (pymysql) transparently side-by-side. - In-Memory Connection Pooling: Fast continuous queries with zero reconnection latency and persistent
use_databasesticky state. - Detailed Diagnostic Error Reporting: Forwards native PostgreSQL error codes (e.g. 23503 FK violation), offending constraint names, column names, and error details directly to Claude so issues can be diagnosed immediately.
- Sibling Database Auto-Derivation: On PostgreSQL (
localhost:5432), auto-discovers sibling databases (showreel,dsr,location_booking,sap, etc.) on the fly. - DBA & Management Tools:
create_database,drop_database(with safety guard),clone_database(instant template clone),terminate_connections,list_active_queries,dump_database, andrestore_database. - Self-Contained
SERVERSJSON: Configure multiple database instances in one environment variable without external files.
🛠️ Included Tools (20 Tools)
list_connections: Lists all active and configured database connections.use_database: Switches active connection or switches database on current server.list_databases: Lists all databases on the active server.list_schemas: Lists all schemas in the active PostgreSQL database.describe_table: Detailed schema inspection (columns, nullability, PKs, FKs, indexes). Auto-resolves cross-schema tables in PostgreSQL.schema_overview: Compact overview of all user tables and views.get_table_sample: Returns sample rows and estimated row count.search_schema: Case-insensitive regex search for table, view, or column names.read_query: Safe SELECT queries returning structured JSON with row counts.execute_query: Executes DML / DDL statements with transaction commit/rollback and detailed error forwarding.explain_query: Generates EXPLAIN query execution plan.get_database_stats: Table sizes, row estimates, index sizes, and total database size.add_connection: Dynamically adds a new PostgreSQL or MySQL connection string at runtime.create_database: Creates a new database on the active server.drop_database: Safety-guarded DROP DATABASE (requiresconfirmNamematching target name).clone_database: Fast database cloning using PostgreSQL TEMPLATE mechanism.terminate_connections: Terminates active connections to a specific database (PostgreSQL only).list_active_queries: Lists running queries, connection duration, and process IDs.dump_database: Dumps database to SQL file using nativepg_dumpormysqldump.restore_database: Restores database from SQL dump file using nativepsqlormysql.
📦 Installation
pip install mcp-win-stdio-db
(Installing this package automatically installs mws CLI orchestrator).
🚀 One-Command Claude Setup
mws setup db
# or:
mws add db
Manual Configuration Example
In %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"db": {
"command": "python",
"args": ["-m", "mcp_win_stdio.db"],
"env": {
"SERVERS": "{\"postgres\":\"postgresql://postgres:password@localhost:5432/mydb\",\"mysql\":\"mysql://user:pass@localhost:3306/mydb\"}"
}
}
}
}
📖 CLI Commands & Interactive Guide
mws db guide # Complete tool reference & prompt recipes
mws db doctor # Verify PostgreSQL/MySQL adapters and native dump tools
mws db setup # Configure Claude Desktop / Claude Code
mws db run # Launch server over stdio
📜 License
MIT License. Copyright (c) 2026 Mohan Kumar Indala.
Release files for mcp-win-stdio-db 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_win_stdio_db-0.2.3.tar.gz | 26.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_win_stdio_db-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.4 kB
Release files / mcp_win_stdio_db-0.2.3.tar.gz
| Download URL | mcp_win_stdio_db-0.2.3.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee958fcf4f2186155c3ef25a8d0afd76d57e04740b08cf26fc5e25850bd6ed5a
|
|
BLAKE2b-256 checksum How to use checksums |
1aab999362a99a049d5a2fd64344a977004f24ff32e594e64da7a56683935496
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / mcp_win_stdio_db-0.2.3-py3-none-any.whl
| Download URL | mcp_win_stdio_db-0.2.3-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
424730cbb743ee11aa32e2d8b6ddb40cc7b08452e767846b5466fc6f76809bf7
|
|
BLAKE2b-256 checksum How to use checksums |
425832d40e39215c3275265dd88ec903e7ccd8196399dd0c7e64839801b0c68a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|