mcp

comcpwork/mcp

3.3

If you are the rightful owner of mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

MCP Database Tools allow users to manage databases like MySQL, Redis, and Pulsar through natural language conversations with AI assistants.

MCP Database Tools

|

Execute MySQL, Redis, ClickHouse and SQLite commands through natural language conversations with AI assistants.

Features

  • MySQL - Execute SQL queries and modifications
  • Redis - Execute Redis commands
  • ClickHouse - Execute ClickHouse SQL statements
  • SQLite - Execute SQLite SQL (file-based or in-memory)
  • SSH Tunneling - Connect to databases through SSH bastion hosts

Installation

Requirements

  • Go 1.21 or higher
  • MCP Client (Claude Code, Cursor, Cline, etc.)

Step 1: Install the Tool

go install github.com/comcpwork/mcp/cmd/cowork-database@latest

Step 2: Configure Your MCP Client

Claude Code

Add the MCP server:

claude mcp add database -- cowork-database database
Cursor / Cline / Other MCP Clients

Add to your MCP configuration file:

{
  "mcpServers": {
    "database": {
      "command": "cowork-database",
      "args": ["database"]
    }
  }
}

Configuration file locations:

  • Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
  • Cursor: Settings > Features > MCP Servers
  • Cline (VS Code): .vscode/mcp.json or VS Code settings

Step 3: Restart Your Client

Restart your MCP client to load the database tools.

Quick Start

Ask your AI assistant:

  • MySQL: "Execute MySQL with DSN root:password@tcp(localhost:3306)/test and SQL: SELECT * FROM users"
  • Redis: "Execute Redis command PING on redis://localhost:6379/0"
  • ClickHouse: "Execute ClickHouse with DSN clickhouse://default:@localhost:9000/default and SQL: SELECT 1"
  • SQLite: "Execute SQLite with DSN :memory: and SQL: SELECT 1"

DSN Formats

DatabaseFormatExample
MySQLuser:pass@tcp(host:port)/dbnameroot:password@tcp(localhost:3306)/mydb
Redisredis://[:password@]host:port/dbredis://localhost:6379/0
ClickHouseclickhouse://user:pass@host:port/dbclickhouse://default:@localhost:9000/default
SQLite/path/to/file.db or :memory:/data/mydb.db or :memory:

SSH Connection

All tools support optional SSH tunneling through the ssh parameter.

SSH URI Formats

FormatExampleDescription
Config referencessh://myserverUse ~/.ssh/config entry
Password authssh://user:pass@host:portDirect password authentication
Key authssh://user@host?key=/path/to/keyPrivate key authentication

Example

{
  "dsn": "root:password@tcp(10.0.0.100:3306)/mydb",
  "sql": "SELECT * FROM users",
  "ssh": "ssh://admin@jump.example.com?key=~/.ssh/id_rsa"
}

Note: SQLite uses remote command execution mode (requires sqlite3 on remote server).

Documentation

License

MIT License - see file for details.