Metadata-Version: 2.4
Name: dbskiter-mcp-server
Version: 1.0.0
Summary: MCP Server for DBSKiter - Database monitoring, diagnosis, and SQL processing
Author-email: DBSKiter Team <team@dbskiter.dev>
License: MIT
Project-URL: Homepage, https://github.com/magicCzc/dbskiter-mcp-server
Project-URL: Repository, https://github.com/magicCzc/dbskiter-mcp-server.git
Project-URL: Issues, https://github.com/magicCzc/dbskiter-mcp-server/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: dbskiter>=2.0.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"

# DBSKiter MCP Server

A Model Context Protocol (MCP) server that exposes DBSKiter database skills to AI assistants.

## Overview

DBSKiter MCP Server provides AI assistants with powerful database monitoring, diagnosis, SQL optimization, and security auditing capabilities through the Model Context Protocol.

## Features

**Diagnose Tools**
- diagnose_realtime - Real-time database performance diagnosis
- diagnose_sql - SQL statement analysis with execution plan
- diagnose_slow_queries - Slow query analysis

**Monitor Tools**
- monitor_health - Database health checks
- monitor_metrics - Performance metrics collection

**SQL Tools**
- sql_execute - Execute SQL statements
- sql_rewrite - SQL optimization and rewriting

**Security Tools**
- security_sql_injection - SQL injection detection
- security_score - Database security scoring

## Installation

```bash
pip install dbskiter-mcp-server
```

## Configuration

### Environment Variables

Create a `.env` file with your database connections:

```env
# MySQL Example
DB_DIALECT=mysql
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=your_database

# Oracle Example
ORACLE_DIALECT=oracle+oracledb
ORACLE_HOST=localhost
ORACLE_PORT=1521
ORACLE_USER=system
ORACLE_PASSWORD=your_password
ORACLE_SERVICE_NAME=ORCL
```

### Claude Desktop Configuration

Add to your Claude Desktop configuration (`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "dbskiter": {
      "command": "dbskiter-mcp",
      "env": {
        "DB_DIALECT": "mysql",
        "DB_HOST": "localhost",
        "DB_PORT": "3306",
        "DB_USER": "root",
        "DB_PASSWORD": "your_password",
        "DB_NAME": "your_database"
      }
    }
  }
}
```

## Usage

### Running the Server

```bash
# Run directly
dbskiter-mcp

# Or with Python
python -m dbskiter_mcp
```

### Using with Claude

Once configured, you can ask Claude to:

- "Check the health of my database"
- "Analyze this slow SQL query: SELECT * FROM users WHERE name LIKE '%test%'"
- "Show me the top 10 slow queries"
- "Execute this SQL: SELECT COUNT(*) FROM orders"

## Development

### Setup

```bash
git clone https://github.com/magicCzc/dbskiter-mcp-server.git
cd dbskiter-mcp-server
pip install -e ".[dev]"
```

### Testing

```bash
pytest
```

### Code Formatting

```bash
black src/
```

## Architecture

```
dbskiter_mcp/
├── __init__.py          # Package initialization
├── server.py            # MCP server implementation
└── tools.py             # Tool definitions and handlers
```

The server uses the official MCP Python SDK and follows the Model Context Protocol specification.

## Requirements

- Python 3.10+
- dbskiter >= 2.0.0
- mcp >= 1.0.0

## License

MIT License - see LICENSE file for details.

## Contributing

Contributions are welcome! Please submit issues and pull requests on GitHub.

## Support

For issues and questions:
- GitHub Issues: https://github.com/magicCzc/dbskiter-mcp-server/issues
- Documentation: https://github.com/magicCzc/dbskiter-mcp-server/wiki
