Back to Home
scopweb icon

mcp-go-mysql

Verified Safe

by scopweb

Overview

Provides a secure MySQL database management interface via the Model Context Protocol (MCP) for AI tools like Claude Desktop, featuring intelligent security and operation blocking.

Installation

Run Command
./mysql-mcp

Environment Variables

  • MYSQL_HOST
  • MYSQL_USER
  • MYSQL_PASSWORD
  • MYSQL_DATABASE

Security Notes

The project demonstrates a strong focus on security, implementing a multi-layered defense against common database attacks. It features comprehensive SQL injection, path traversal, and command injection prevention (23+ SQLi patterns blocked), explicit blocking of dangerous SQL operations (e.g., DROP DATABASE, DELETE/UPDATE without WHERE), configurable DDL blocking, and a table access whitelist. Credentials are handled via environment variables and masked in logs. Connection pooling, context timeouts, and TLS support are documented. A robust security test suite is included, covering various CVEs, CWEs, and injection types, with recommendations for `govulncheck` and `staticcheck`. A minor concern is the `allowNativePasswords=true` option in the DSN used by `internal/mysql.go::getDB()`. While the primary `internal/client.go::Connect()` method (used for core tools like 'query' and 'execute') does not include this, `internal/mysql.go`'s `getDB()` is used by `internal/analysis.go` (e.g., ExplainQuery) and some simpler list/describe functions. This specific DSN setting could allow unencrypted password transmission for those particular calls if the MySQL server itself is not configured to enforce TLS, potentially downgrading security for these operations.

Similar Servers

Stats

Interest Score30
Security Score9
Cost ClassLow
Avg Tokens1000
Stars1
Forks0
Last Update2025-11-30

Tags

MySQLDatabase ManagementSecurityMCPGo