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.4
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.4.tar.gz | 26.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_win_stdio_db-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.4 kB
Release files / mcp_win_stdio_db-0.2.4.tar.gz
| Download URL | mcp_win_stdio_db-0.2.4.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9c7cbdd5b932cfb4543272de723631c62a9ae40805d87337e08a5b5028c599f
|
|
BLAKE2b-256 checksum How to use checksums |
c30a980ef5e855cc253917a597b4d518292d3fcdc7b20a0097f329062122f3fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / mcp_win_stdio_db-0.2.4-py3-none-any.whl
| Download URL | mcp_win_stdio_db-0.2.4-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e89a15d0a90eb766c5c4212892e390e1a9f162e57f6a6e178317257adb321419
|
|
BLAKE2b-256 checksum How to use checksums |
b7e48f1546ba0e4bc7ac1577a43f8f4f70afb9ad174dc9c534e35097050fbbf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|