multidb-mcp-client


Namemultidb-mcp-client JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA Model Context Protocol (MCP) server that enables secure interaction with MySQL/MariaDB/TiDB/AWS OceanBase/RDS/Aurora MySQL DataBases.
upload_time2025-08-18 07:28:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseMIT
keywords mcp mysql tidb oceanbase xesql ubisql rasesql model-context-protocol async connection-pool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Multi-Database MCP Client

A Model Context Protocol (MCP) server that enables secure interaction with multiple database types including MySQL, MariaDB, TiDB, OceanBase, and AWS RDS/Aurora MySQL. This server exposes database operations as MCP tools and resources while proxying actual SQL execution to a remote HTTP service.

## ๐Ÿš€ Features

- **Universal SQL Execution**: Execute any SQL statement (SELECT, INSERT, UPDATE, DELETE, DDL) through a single tool
- **Multi-Database Support**: Works with MySQL, MariaDB, TiDB, OceanBase, and compatible cloud databases
- **HTTP Proxy Architecture**: Decouples MCP interface from database connections via HTTP forwarding
- **Schema Introspection**: Get table structures and database metadata as MCP resources
- **Test Data Generation**: Built-in tool for generating development test data
- **Flexible Configuration**: Support for multiple database instances with runtime switching
- **Async I/O**: Full asynchronous operation using `aiohttp` and `asyncio`
- **Structured Logging**: Comprehensive logging with `loguru` to both stderr and rotating files

## ๐Ÿ—๏ธ Architecture

The system follows a proxy pattern where the MCP server acts as a client-side interface:

```
MCP Client โ†’ FastMCP Tools/Resources โ†’ HTTP POST โ†’ Remote DB Server โ†’ Database
```

### Key Components

- **`src/server.py`**: MCP server with FastMCP framework, tool/resource definitions
- **`src/utils/db_operate.py`**: HTTP-proxied SQL execution engine
- **`src/utils/db_config.py`**: Singleton configuration loader with multi-instance support
- **`src/resources/db_resources.py`**: Database metadata and configuration resource builders
- **`src/tools/db_tool.py`**: Test data generation utilities
- **`src/utils/http_util.py`**: Async HTTP client helpers
- **`src/utils/logger_util.py`**: Logging setup and configuration path resolution

## ๐Ÿ“‹ Requirements

- Python 3.12+
- A remote database server accessible via the configured `multiDBServer` endpoint

## ๐Ÿ› ๏ธ Installation

### 1. Install from PyPI (Recommended)
```bash
pip install multidb-mcp-client
```

### 2. Configure database connection

Edit `dbconfig.json` with your database credentials:

```json
{
    "dbPoolSize": 5,
    "dbMaxOverflow": 10,
    "dbPoolTimeout": 30,
    "dbType-Comment": "The database currently in use,such as MySQL/MariaDB/TiDB OceanBase/RDS/Aurora MySQL DataBases",
    "dbList": [
        {   "dbInstanceId": "oceanbase_1",
            "dbHost": "localhost",
            "dbPort": 2281,
            "dbDatabase": "oceanbase_db",
            "dbUsername": "root",
            "dbPassword": "123456",
            "dbType": "OceanBase",
            "dbVersion": "V4.0.0",
            "dbActive": true
        },
        {   "dbInstanceId": "mysql_2",
            "dbHost": "localhost",
            "dbPort": 3306,
            "dbDatabase": "mysql_db",
            "dbUsername": "root",
            "dbPassword": "123456",
            "dbType": "MySQL",
            "dbVersion": "8.0",
            "dbActive": false
        },
        {   "dbInstanceId": "tidb_3",
            "dbHost": "localhost",
            "dbPort": 4000,
            "dbDatabase": "tidb_db",
            "dbUsername": "root",
            "dbPassword": "123456",
            "dbType": "TiDB",
            "dbVersion": "8.5.3",
            "dbActive": false
        }
    ],
    "multiDBServer": "http://127.0.0.1:8080/mcp/executeQuery",
    "logPath": "/path/to/logs",
    "logLevel": "INFO"
}
```
### Configuration Properties

- **`dbList`**: Array of database instance configurations
  - **`dbActive`**: Exactly one instance must be `true` (the active database)
  - **`dbType`**: Supported values include MySQL, OceanBase, TiDB, etc.
- **`multiDBServer`**: HTTP endpoint that accepts SQL execution requests
- **`logPath`**: Directory for log files (auto-creates if missing)
- **`logLevel`**: One of TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL

### 3. Configure MCP Client

Add to your MCP client configuration file:

```json
{
  "mcpServers": {
    "multidb-mcp-client": {
      "command": "multidb-mcp-client",
      "env": {
        "config_file": "/path/to/your/dbconfig.json"
      },
      "disabled": false
    }
  }
}
```

**Note**: Replace `/path/to/your/dbconfig.json` with the actual path to your configuration file.

### 4. Clone the repository (Development Mode)
```bash
git clone https://github.com/j00131120/mcp_database_server.git
cd mcp_database_server/multidb_mcp_client
# Import project into your IDE
```

### 5. Configure MCP Client for Development
```json
{
  "mcpServers": {
    "multidb-mcp-client": {
      "command": "/bin/uv",
      "args": ["run", "src/server.py"],
      "cwd": "/path/to/your/project",
      "env": {
        "config_file": "/path/to/your/dbconfig.json"
      },
      "disabled": false,
      "autoApprove": ["describe_table", "sql_exec", "generate_demo_data"]
    }
  }
}

# command
uv absolute path
# cwd
project absolute path
# config_file
dbconfig.json file path
```

## ๐Ÿš€ Running the Server

### Command Line

After installation, use the provided CLI command:

```bash
multidb-mcp-client
```

This starts the MCP server over stdio for consumption by MCP-compatible clients.

### FastMCP CLI (Alternative)

```bash
# List available MCP servers
fastmcp servers list

# Run via entry point (defined in pyproject.toml)
fastmcp run mysql
```

### Environment Variables

- **`config_file`**: Override default config file path
- Standard logging environment variables supported by `loguru`

## ๐Ÿ› ๏ธ MCP Tools

### `sql_exec(sql: str)`

Execute any SQL statement with automatic transaction handling.

**Parameters:**
- `sql` (string): SQL statement to execute

**Returns:**
```json
{
  "success": true,
  "result": [...],  // Query results or affected row count
  "message": "SQL executed successfully"
}
```

**Usage Examples:**
```python
# Query data
await sql_exec("SELECT * FROM users WHERE age > 18")

# Insert data
await sql_exec("INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com')")

# Update records
await sql_exec("UPDATE users SET email = 'newemail@example.com' WHERE id = 1")

# DDL operations
await sql_exec("CREATE TABLE products (id INT PRIMARY KEY, name VARCHAR(100))")
```

### `describe_table(table_name: str)`

Get detailed table structure information.

**Parameters:**
- `table_name` (string): Name of the table (supports `database.table` format)

**Returns:**
Same format as `sql_exec`, with `result` containing column metadata.

**Usage Examples:**
```python
await describe_table("users")
await describe_table("inventory.products")
```

### `generate_demo_data(table_name: str, columns_name: List[str], num: int)`

Generate test data for development and testing.

**Parameters:**
- `table_name` (string): Target table name
- `columns_name` (array): List of column names to populate
- `num` (integer): Number of test records to generate

**Usage Examples:**
```python
# Generate 100 test users
await generate_demo_data("users", ["name", "email", "phone"], 100)

# Generate 50 test products
await generate_demo_data("products", ["product_name", "category", "description"], 50)
```

## ๐Ÿ“Š MCP Resources

### `database://tables`

Provides comprehensive metadata for all database tables.

**Returns:**
```json
{
  "uri": "database://tables",
  "mimeType": "application/json",
  "text": "[{\"name\": \"users\", \"columns\": [...], \"record_count\": 1250}, ...]"
}
```

**Use Cases:**
- Schema exploration and documentation
- Database monitoring and statistics
- Query planning and optimization

### `database://config`

Provides current database configuration (with sensitive data masked).

**Returns:**
```json
{
  "uri": "database://config", 
  "mimeType": "application/json",
  "text": "{\"dbInstanceId\": \"primary_oceanbase\", \"dbHost\": \"localhost\", \"dbPassword\": \"***hidden***\", ...}"
}
```

## ๐Ÿ“ Logging

The system provides comprehensive logging:

- **Console Output**: Logs to stderr for MCP client visibility
- **File Logging**: Rotating log files (10MB max, 7-day retention)
- **Structured Format**: Timestamp, level, function, line number, and message
- **Configurable Levels**: TRACE through CRITICAL

Log files are stored in:
- Configured `logPath` directory
- Default: `<project_root>/logs/mcp_server.log`

## ๐Ÿ”’ Security Considerations

### Current Security Features

- **Password Masking**: Sensitive data hidden in resource responses
- **HTTP Client**: Supports custom headers for authentication
- **Configuration Isolation**: Only active database config exposed

### Security Recommendations

1. **Credential Management**: Store database passwords in environment variables or secure vaults
2. **Network Security**: Use HTTPS for `multiDBServer` endpoint with proper authentication
3. **Access Control**: Restrict `sql_exec` tool usage to trusted environments
4. **File Permissions**: Secure `dbconfig.json` with appropriate file system permissions
5. **Network Isolation**: Deploy `multiDBServer` in a secured network segment

### Production Deployment

```bash
# Use environment variables for sensitive data
export DB_PASSWORD="your_secure_password"
export MULTIDB_SERVER_URL="https://secure-db-proxy.internal.com/api/v1/execute"

# Restrict config file permissions
chmod 600 dbconfig.json

# Run with non-root user
useradd -r mcp-client
sudo -u mcp-client multidb-mcp-client
```

## ๐Ÿงช Development

### Project Structure

```
multidb_mcp_client/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ server.py              # MCP server and tool definitions
โ”‚   โ”œโ”€โ”€ resources/
โ”‚   โ”‚   โ””โ”€โ”€ db_resources.py    # Resource data builders
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ””โ”€โ”€ db_tool.py         # Tool implementations
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ db_config.py       # Configuration management
โ”‚       โ”œโ”€โ”€ db_operate.py      # SQL execution via HTTP
โ”‚       โ”œโ”€โ”€ http_util.py       # HTTP client utilities
โ”‚       โ””โ”€โ”€ logger_util.py     # Logging configuration
โ”œโ”€โ”€ dbconfig.json              # Database configuration
โ”œโ”€โ”€ pyproject.toml             # Project metadata and dependencies
โ””โ”€โ”€ logs/                      # Log output directory
```

### Code Style

- **Explicit naming**: Clear, descriptive function and variable names
- **Early returns**: Reduce nesting with guard clauses
- **Type annotations**: Public APIs include type hints
- **Error handling**: Comprehensive exception handling with logging
- **Async/await**: Proper async patterns throughout

### Key Dependencies

- **`fastmcp`**: MCP framework and protocol implementation
- **`aiohttp`**: Async HTTP client for database proxy calls
- **`loguru`**: Structured logging with rotation and formatting
- **`mcp[cli]`**: MCP command-line tools

## ๐Ÿ“„ License

MIT License - see the LICENSE file for details.

## ๐Ÿ”— Links

- **Homepage**: https://github.com/j00131120/mcp_database_server/tree/main/multidb_mcp_client
- **Documentation**: https://github.com/j00131120/mcp_database_server/blob/main/multidb_mcp_client/README.md
- **Source Code**: https://github.com/j00131120/mcp_database_server.git
- **Issue Tracker**: https://github.com/j00131120/mcp_database_server/issues
- **Changelog**: https://github.com/j00131120/mcp_database_server/blob/main/multidb_mcp_client/CHANGELOG.md

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Commit your changes: `git commit -m 'Add amazing feature'`
4. Push to the branch: `git push origin feature/amazing-feature`
5. Open a Pull Request

## ๐Ÿ“ž Support

For questions, issues, or contributions:

- **Author**: Frank Jin (j00131120@163.com)
- **GitHub Issues**: Use the issue tracker for bug reports and feature requests
- **Documentation**: Check the repository wiki for additional documentation

---

**Note**: This MCP server requires a compatible remote database service running at the configured `multiDBServer` endpoint. Ensure your remote service implements the expected HTTP API contract before running the client.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "multidb-mcp-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": "Frank Jin <j00131120@163.com>",
    "keywords": "mcp, mysql, tidb, oceanbase, xesql, ubisql, rasesql, model-context-protocol, async, connection-pool",
    "author": null,
    "author_email": "Frank Jin <j00131120@163.com>",
    "download_url": "https://files.pythonhosted.org/packages/b3/f5/ab3fe89cf65c36abb3ffcb4f53c6c53715e0235d0be4230603ac10bb3cc5/multidb_mcp_client-0.1.1.tar.gz",
    "platform": null,
    "description": "# Multi-Database MCP Client\n\nA Model Context Protocol (MCP) server that enables secure interaction with multiple database types including MySQL, MariaDB, TiDB, OceanBase, and AWS RDS/Aurora MySQL. This server exposes database operations as MCP tools and resources while proxying actual SQL execution to a remote HTTP service.\n\n## \ud83d\ude80 Features\n\n- **Universal SQL Execution**: Execute any SQL statement (SELECT, INSERT, UPDATE, DELETE, DDL) through a single tool\n- **Multi-Database Support**: Works with MySQL, MariaDB, TiDB, OceanBase, and compatible cloud databases\n- **HTTP Proxy Architecture**: Decouples MCP interface from database connections via HTTP forwarding\n- **Schema Introspection**: Get table structures and database metadata as MCP resources\n- **Test Data Generation**: Built-in tool for generating development test data\n- **Flexible Configuration**: Support for multiple database instances with runtime switching\n- **Async I/O**: Full asynchronous operation using `aiohttp` and `asyncio`\n- **Structured Logging**: Comprehensive logging with `loguru` to both stderr and rotating files\n\n## \ud83c\udfd7\ufe0f Architecture\n\nThe system follows a proxy pattern where the MCP server acts as a client-side interface:\n\n```\nMCP Client \u2192 FastMCP Tools/Resources \u2192 HTTP POST \u2192 Remote DB Server \u2192 Database\n```\n\n### Key Components\n\n- **`src/server.py`**: MCP server with FastMCP framework, tool/resource definitions\n- **`src/utils/db_operate.py`**: HTTP-proxied SQL execution engine\n- **`src/utils/db_config.py`**: Singleton configuration loader with multi-instance support\n- **`src/resources/db_resources.py`**: Database metadata and configuration resource builders\n- **`src/tools/db_tool.py`**: Test data generation utilities\n- **`src/utils/http_util.py`**: Async HTTP client helpers\n- **`src/utils/logger_util.py`**: Logging setup and configuration path resolution\n\n## \ud83d\udccb Requirements\n\n- Python 3.12+\n- A remote database server accessible via the configured `multiDBServer` endpoint\n\n## \ud83d\udee0\ufe0f Installation\n\n### 1. Install from PyPI (Recommended)\n```bash\npip install multidb-mcp-client\n```\n\n### 2. Configure database connection\n\nEdit `dbconfig.json` with your database credentials:\n\n```json\n{\n    \"dbPoolSize\": 5,\n    \"dbMaxOverflow\": 10,\n    \"dbPoolTimeout\": 30,\n    \"dbType-Comment\": \"The database currently in use,such as MySQL/MariaDB/TiDB OceanBase/RDS/Aurora MySQL DataBases\",\n    \"dbList\": [\n        {   \"dbInstanceId\": \"oceanbase_1\",\n            \"dbHost\": \"localhost\",\n            \"dbPort\": 2281,\n            \"dbDatabase\": \"oceanbase_db\",\n            \"dbUsername\": \"root\",\n            \"dbPassword\": \"123456\",\n            \"dbType\": \"OceanBase\",\n            \"dbVersion\": \"V4.0.0\",\n            \"dbActive\": true\n        },\n        {   \"dbInstanceId\": \"mysql_2\",\n            \"dbHost\": \"localhost\",\n            \"dbPort\": 3306,\n            \"dbDatabase\": \"mysql_db\",\n            \"dbUsername\": \"root\",\n            \"dbPassword\": \"123456\",\n            \"dbType\": \"MySQL\",\n            \"dbVersion\": \"8.0\",\n            \"dbActive\": false\n        },\n        {   \"dbInstanceId\": \"tidb_3\",\n            \"dbHost\": \"localhost\",\n            \"dbPort\": 4000,\n            \"dbDatabase\": \"tidb_db\",\n            \"dbUsername\": \"root\",\n            \"dbPassword\": \"123456\",\n            \"dbType\": \"TiDB\",\n            \"dbVersion\": \"8.5.3\",\n            \"dbActive\": false\n        }\n    ],\n    \"multiDBServer\": \"http://127.0.0.1:8080/mcp/executeQuery\",\n    \"logPath\": \"/path/to/logs\",\n    \"logLevel\": \"INFO\"\n}\n```\n### Configuration Properties\n\n- **`dbList`**: Array of database instance configurations\n  - **`dbActive`**: Exactly one instance must be `true` (the active database)\n  - **`dbType`**: Supported values include MySQL, OceanBase, TiDB, etc.\n- **`multiDBServer`**: HTTP endpoint that accepts SQL execution requests\n- **`logPath`**: Directory for log files (auto-creates if missing)\n- **`logLevel`**: One of TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL\n\n### 3. Configure MCP Client\n\nAdd to your MCP client configuration file:\n\n```json\n{\n  \"mcpServers\": {\n    \"multidb-mcp-client\": {\n      \"command\": \"multidb-mcp-client\",\n      \"env\": {\n        \"config_file\": \"/path/to/your/dbconfig.json\"\n      },\n      \"disabled\": false\n    }\n  }\n}\n```\n\n**Note**: Replace `/path/to/your/dbconfig.json` with the actual path to your configuration file.\n\n### 4. Clone the repository (Development Mode)\n```bash\ngit clone https://github.com/j00131120/mcp_database_server.git\ncd mcp_database_server/multidb_mcp_client\n# Import project into your IDE\n```\n\n### 5. Configure MCP Client for Development\n```json\n{\n  \"mcpServers\": {\n    \"multidb-mcp-client\": {\n      \"command\": \"/bin/uv\",\n      \"args\": [\"run\", \"src/server.py\"],\n      \"cwd\": \"/path/to/your/project\",\n      \"env\": {\n        \"config_file\": \"/path/to/your/dbconfig.json\"\n      },\n      \"disabled\": false,\n      \"autoApprove\": [\"describe_table\", \"sql_exec\", \"generate_demo_data\"]\n    }\n  }\n}\n\n# command\nuv absolute path\n# cwd\nproject absolute path\n# config_file\ndbconfig.json file path\n```\n\n## \ud83d\ude80 Running the Server\n\n### Command Line\n\nAfter installation, use the provided CLI command:\n\n```bash\nmultidb-mcp-client\n```\n\nThis starts the MCP server over stdio for consumption by MCP-compatible clients.\n\n### FastMCP CLI (Alternative)\n\n```bash\n# List available MCP servers\nfastmcp servers list\n\n# Run via entry point (defined in pyproject.toml)\nfastmcp run mysql\n```\n\n### Environment Variables\n\n- **`config_file`**: Override default config file path\n- Standard logging environment variables supported by `loguru`\n\n## \ud83d\udee0\ufe0f MCP Tools\n\n### `sql_exec(sql: str)`\n\nExecute any SQL statement with automatic transaction handling.\n\n**Parameters:**\n- `sql` (string): SQL statement to execute\n\n**Returns:**\n```json\n{\n  \"success\": true,\n  \"result\": [...],  // Query results or affected row count\n  \"message\": \"SQL executed successfully\"\n}\n```\n\n**Usage Examples:**\n```python\n# Query data\nawait sql_exec(\"SELECT * FROM users WHERE age > 18\")\n\n# Insert data\nawait sql_exec(\"INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com')\")\n\n# Update records\nawait sql_exec(\"UPDATE users SET email = 'newemail@example.com' WHERE id = 1\")\n\n# DDL operations\nawait sql_exec(\"CREATE TABLE products (id INT PRIMARY KEY, name VARCHAR(100))\")\n```\n\n### `describe_table(table_name: str)`\n\nGet detailed table structure information.\n\n**Parameters:**\n- `table_name` (string): Name of the table (supports `database.table` format)\n\n**Returns:**\nSame format as `sql_exec`, with `result` containing column metadata.\n\n**Usage Examples:**\n```python\nawait describe_table(\"users\")\nawait describe_table(\"inventory.products\")\n```\n\n### `generate_demo_data(table_name: str, columns_name: List[str], num: int)`\n\nGenerate test data for development and testing.\n\n**Parameters:**\n- `table_name` (string): Target table name\n- `columns_name` (array): List of column names to populate\n- `num` (integer): Number of test records to generate\n\n**Usage Examples:**\n```python\n# Generate 100 test users\nawait generate_demo_data(\"users\", [\"name\", \"email\", \"phone\"], 100)\n\n# Generate 50 test products\nawait generate_demo_data(\"products\", [\"product_name\", \"category\", \"description\"], 50)\n```\n\n## \ud83d\udcca MCP Resources\n\n### `database://tables`\n\nProvides comprehensive metadata for all database tables.\n\n**Returns:**\n```json\n{\n  \"uri\": \"database://tables\",\n  \"mimeType\": \"application/json\",\n  \"text\": \"[{\\\"name\\\": \\\"users\\\", \\\"columns\\\": [...], \\\"record_count\\\": 1250}, ...]\"\n}\n```\n\n**Use Cases:**\n- Schema exploration and documentation\n- Database monitoring and statistics\n- Query planning and optimization\n\n### `database://config`\n\nProvides current database configuration (with sensitive data masked).\n\n**Returns:**\n```json\n{\n  \"uri\": \"database://config\", \n  \"mimeType\": \"application/json\",\n  \"text\": \"{\\\"dbInstanceId\\\": \\\"primary_oceanbase\\\", \\\"dbHost\\\": \\\"localhost\\\", \\\"dbPassword\\\": \\\"***hidden***\\\", ...}\"\n}\n```\n\n## \ud83d\udcdd Logging\n\nThe system provides comprehensive logging:\n\n- **Console Output**: Logs to stderr for MCP client visibility\n- **File Logging**: Rotating log files (10MB max, 7-day retention)\n- **Structured Format**: Timestamp, level, function, line number, and message\n- **Configurable Levels**: TRACE through CRITICAL\n\nLog files are stored in:\n- Configured `logPath` directory\n- Default: `<project_root>/logs/mcp_server.log`\n\n## \ud83d\udd12 Security Considerations\n\n### Current Security Features\n\n- **Password Masking**: Sensitive data hidden in resource responses\n- **HTTP Client**: Supports custom headers for authentication\n- **Configuration Isolation**: Only active database config exposed\n\n### Security Recommendations\n\n1. **Credential Management**: Store database passwords in environment variables or secure vaults\n2. **Network Security**: Use HTTPS for `multiDBServer` endpoint with proper authentication\n3. **Access Control**: Restrict `sql_exec` tool usage to trusted environments\n4. **File Permissions**: Secure `dbconfig.json` with appropriate file system permissions\n5. **Network Isolation**: Deploy `multiDBServer` in a secured network segment\n\n### Production Deployment\n\n```bash\n# Use environment variables for sensitive data\nexport DB_PASSWORD=\"your_secure_password\"\nexport MULTIDB_SERVER_URL=\"https://secure-db-proxy.internal.com/api/v1/execute\"\n\n# Restrict config file permissions\nchmod 600 dbconfig.json\n\n# Run with non-root user\nuseradd -r mcp-client\nsudo -u mcp-client multidb-mcp-client\n```\n\n## \ud83e\uddea Development\n\n### Project Structure\n\n```\nmultidb_mcp_client/\n\u251c\u2500\u2500 src/\n\u2502   \u251c\u2500\u2500 server.py              # MCP server and tool definitions\n\u2502   \u251c\u2500\u2500 resources/\n\u2502   \u2502   \u2514\u2500\u2500 db_resources.py    # Resource data builders\n\u2502   \u251c\u2500\u2500 tools/\n\u2502   \u2502   \u2514\u2500\u2500 db_tool.py         # Tool implementations\n\u2502   \u2514\u2500\u2500 utils/\n\u2502       \u251c\u2500\u2500 db_config.py       # Configuration management\n\u2502       \u251c\u2500\u2500 db_operate.py      # SQL execution via HTTP\n\u2502       \u251c\u2500\u2500 http_util.py       # HTTP client utilities\n\u2502       \u2514\u2500\u2500 logger_util.py     # Logging configuration\n\u251c\u2500\u2500 dbconfig.json              # Database configuration\n\u251c\u2500\u2500 pyproject.toml             # Project metadata and dependencies\n\u2514\u2500\u2500 logs/                      # Log output directory\n```\n\n### Code Style\n\n- **Explicit naming**: Clear, descriptive function and variable names\n- **Early returns**: Reduce nesting with guard clauses\n- **Type annotations**: Public APIs include type hints\n- **Error handling**: Comprehensive exception handling with logging\n- **Async/await**: Proper async patterns throughout\n\n### Key Dependencies\n\n- **`fastmcp`**: MCP framework and protocol implementation\n- **`aiohttp`**: Async HTTP client for database proxy calls\n- **`loguru`**: Structured logging with rotation and formatting\n- **`mcp[cli]`**: MCP command-line tools\n\n## \ud83d\udcc4 License\n\nMIT License - see the LICENSE file for details.\n\n## \ud83d\udd17 Links\n\n- **Homepage**: https://github.com/j00131120/mcp_database_server/tree/main/multidb_mcp_client\n- **Documentation**: https://github.com/j00131120/mcp_database_server/blob/main/multidb_mcp_client/README.md\n- **Source Code**: https://github.com/j00131120/mcp_database_server.git\n- **Issue Tracker**: https://github.com/j00131120/mcp_database_server/issues\n- **Changelog**: https://github.com/j00131120/mcp_database_server/blob/main/multidb_mcp_client/CHANGELOG.md\n\n## \ud83e\udd1d Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Commit your changes: `git commit -m 'Add amazing feature'`\n4. Push to the branch: `git push origin feature/amazing-feature`\n5. Open a Pull Request\n\n## \ud83d\udcde Support\n\nFor questions, issues, or contributions:\n\n- **Author**: Frank Jin (j00131120@163.com)\n- **GitHub Issues**: Use the issue tracker for bug reports and feature requests\n- **Documentation**: Check the repository wiki for additional documentation\n\n---\n\n**Note**: This MCP server requires a compatible remote database service running at the configured `multiDBServer` endpoint. Ensure your remote service implements the expected HTTP API contract before running the client.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Model Context Protocol (MCP) server that enables secure interaction with MySQL/MariaDB/TiDB/AWS OceanBase/RDS/Aurora MySQL DataBases.",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/j00131120/mcp_database_server/issues",
        "Changelog": "https://github.com/j00131120/mcp_database_server/blob/main/multidb_mcp_client/CHANGELOG.md",
        "Documentation": "https://github.com/j00131120/mcp_database_server/blob/main/multidb_mcp_client/README.md",
        "Download": "https://github.com/j00131120/mcp_database_server/tree/main/multidb_mcp_client",
        "Homepage": "https://github.com/j00131120/mcp_database_server/tree/main/multidb_mcp_client",
        "Repository": "https://github.com/j00131120/mcp_database_server.git",
        "Source Code": "https://github.com/j00131120/mcp_database_server/tree/main/multidb_mcp_client"
    },
    "split_keywords": [
        "mcp",
        " mysql",
        " tidb",
        " oceanbase",
        " xesql",
        " ubisql",
        " rasesql",
        " model-context-protocol",
        " async",
        " connection-pool"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8228d05d41a1b9621bbe2951900a0e0490959afa5f4c3276b83d7fa918399a25",
                "md5": "c2b65de00e424a69e320acc4b834cb81",
                "sha256": "07e7ec1253e74c1fc299e0374e8bf879d53bed0daa2a6661df8252a59e9171ea"
            },
            "downloads": -1,
            "filename": "multidb_mcp_client-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c2b65de00e424a69e320acc4b834cb81",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 17395,
            "upload_time": "2025-08-18T07:28:47",
            "upload_time_iso_8601": "2025-08-18T07:28:47.559444Z",
            "url": "https://files.pythonhosted.org/packages/82/28/d05d41a1b9621bbe2951900a0e0490959afa5f4c3276b83d7fa918399a25/multidb_mcp_client-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b3f5ab3fe89cf65c36abb3ffcb4f53c6c53715e0235d0be4230603ac10bb3cc5",
                "md5": "c0580d8364e84e503f09b471d0b8be2d",
                "sha256": "d1a8911765da0a63f1b6c45dd73050e382c57292fdda4d2ffb05aeef7ab5981e"
            },
            "downloads": -1,
            "filename": "multidb_mcp_client-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c0580d8364e84e503f09b471d0b8be2d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 14695,
            "upload_time": "2025-08-18T07:28:49",
            "upload_time_iso_8601": "2025-08-18T07:28:49.139971Z",
            "url": "https://files.pythonhosted.org/packages/b3/f5/ab3fe89cf65c36abb3ffcb4f53c6c53715e0235d0be4230603ac10bb3cc5/multidb_mcp_client-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-18 07:28:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "j00131120",
    "github_project": "mcp_database_server",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "multidb-mcp-client"
}
        
Elapsed time: 0.73448s