mcp-server-mysql

This repository provides a Model Context Protocol (MCP) server for read-only access to MySQL databases, enabling LLMs to inspect schemas and execute secure, parameterized queries with configurable timeouts and pagination.

296
18

MCP Server for MySQL based on NodeJS

This project provides a Model Context Protocol (MCP) server designed for read-only access to MySQL databases, enabling Large Language Models (LLMs) to inspect schemas and execute queries. It can be installed via Smithery, MCP Get, or manually using NPM/PNPM.

Key components include a mysql_query tool for executing SQL queries within read-only transactions, supporting prepared statements, timeouts, and pagination. The server offers resources like table schemas with column types, indexes, and foreign key relationships.

Security features encompass SQL injection prevention, query whitelisting/blacklisting, rate limiting, and connection encryption. Performance optimizations include connection pooling, query result caching, and large result set streaming. Monitoring and debugging tools provide query logging, performance metrics, and health check endpoints.

Configuration can be automated with Smithery or done manually by modifying the claude_desktop_config.json file, setting environment variables for connection details, performance, security, and monitoring. Comprehensive testing instructions are provided, along with troubleshooting tips for common issues. Contributions are welcome under the MIT License.

Repository

BE
benborla

benborla/mcp-server-mysql

Created

December 9, 2024

Updated

March 28, 2025

Language

TypeScript

Category

Database