Database · MODEL CONTEXT PROTOCOL

michael7736 mysql mcp server

MySQL MCP server project

WHAT IT CONNECTS

What michael7736 mysql mcp server gives an AI Agent

  • Execute SQL queries against a MySQL database:
  • Read data (SELECT statements)
  • Create tables (CREATE TABLE statements)
  • Insert data (INSERT INTO statements)
  • Update data (UPDATE statements)
  • Delete data (DELETE FROM statements)
  • Returns query results in JSON format
  • Configurable database connection settings
  • Transaction logging with unique IDs
  • Node.js (v14 or higher)
  • MySQL server
  • MCP SDK
  • Clone or download this repository
  • Install dependencies:
  • Build the server:
  • `MYSQL_HOST`: MySQL server hostname (default: 'localhost')
  • `MYSQL_PORT`: MySQL server port (default: 3306)
  • `MYSQL_USER`: MySQL username (default: 'mcp101')
  • `MYSQL_PASSWORD`: MySQL password (default: '123qwe')
  • `MYSQL_DATABASE`: MySQL database name (default: 'mcpdb')
  • Create a MySQL database:
  • Create a MySQL user with access to the database:
  • Create a test table with sample data:
  • `query`: The SQL SELECT query to execute.
  • `query`: The SQL CREATE TABLE query to execute.
  • `query`: The SQL INSERT INTO query to execute.
  • `query`: The SQL UPDATE query to execute.
  • `query`: The SQL DELETE FROM query to execute.
  • Use a dedicated MySQL user with appropriate privileges for the MCP server
  • Consider using read-only privileges if you only need to query data
  • Store sensitive information like database credentials securely
  • All operations are logged with unique transaction IDs for auditing

SECURITY

An MCP listing is not a security review

An MCP server may receive model context, credentials, local files, or permission to call external systems. Review its code, requested environment variables, network behavior, package provenance, and maintenance status before connecting it to an agent.