A read-only MCP (Model Context Protocol) server for querying MySQL databases via stdio transport, supporting multi-database connections, custom table hints, and automatic LIMIT/timeout enforcement. Current stable version is 2.0.0. It is published on npm and can be run immediately with npx without cloning or building. Key differentiators include zero-install usage, multi-source configuration via a single JSON file, table description prompts for AI awareness, and strict read-only enforcement at the protocol level (only SELECT/SHOW/DESCRIBE/EXPLAIN allowed). Uses mysql2 connection pools (max 5 concurrent) and formats results as Markdown tables. Designed for integration with Claude Code, OpenAI Codex, Claude Desktop, Cursor, and Windsurf. Published under MIT license.
npm install lzc-mysql-mcpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal setup: create JSON config, run npx lzc-mysql-mcp, and integrate with an MCP-compatible AI client.
Always explicitly specify a LIMIT clause if you need a specific number of rows; otherwise be aware the default limit applies.
Use one of the supported file names or set MYSQL_CONFIG_FILE environment variable to the full path.
Use npx (CLI) or dynamic import() if you need to use programmatically.
Ensure each connection's database field is unique across the entire config.
Configure your AI client (e.g., Claude Desktop) to spawn the server as a subprocess using npx lzc-mysql-mcp.
Migrate to mysql-config.json or ~/.mysql-mcp/config.json for persistent configuration.
Ensure the config file has restrictive permissions (e.g., chmod 600 on Unix). Consider using environment variables or a secrets manager for production.
Ensure you have internet access and npm is configured correctly. Run: npm install -g lzc-mysql-mcp@latest (but prefer npx).
Create one of the supported configuration files or set the required environment variables. See README for details.
Verify the credentials in the config file. For testing, use a user with SELECT privileges only.
Run: npx lzc-mysql-mcp (it will install dependencies automatically). If that fails, manually install: npm install -g lzc-mysql-mcp.