An MCP (Model Context Protocol) server that provides structured MySQL database tools for AI assistants. Version 1.1.0, actively maintained on GitHub. Built with TypeScript, official MCP SDK, and mysql2/promise. Features read-only queries, data modification, batch execution, CSV import/export, schema discovery, EXPLAIN support, user/permission checks, and policy enforcement (allow/deny tables, approval hooks). Configured via environment variables. Compatible with Claude Desktop, Codex, and OpenCode. Requires Node >=18. Differentiated by its comprehensive tool set, read-only mode, and external policy hook for AI safety.
npm install easy-mysql-mcpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configure an MCP client to launch easy-mysql-mcp via npx and use its tools.
Set MYSQL_READ_ONLY=false or omit it if you need write operations. Alternatively use MYSQL_MCP_MODE=readonly for the same effect.
Ensure the policy endpoint is reachable and responds promptly. Set MYSQL_APPROVAL_TTL_SECONDS appropriately (default 300s).
Convert your CSV to UTF-8 before importing. The first row must contain column names matching the target table.
Use MYSQL_READ_ONLY=true instead of MYSQL_MCP_MODE=readonly.
Increase MYSQL_CONNECTION_LIMIT (default 10) or reduce concurrent tool calls. Pool exhaustion blocks further requests; set MYSQL_WAIT_FOR_CONNECTIONS=true to queue.
Install the package locally: npm install @modelcontextprotocol/sdk
Set MYSQL_HOST to the correct MySQL hostname or IP. Example: MYSQL_HOST=127.0.0.1
Verify MYSQL_USER and MYSQL_PASSWORD. Use correct values and ensure the user has proper permissions.
Create the database first, or change MYSQL_DATABASE to an existing database.
Check MYSQL_HOST and MYSQL_PORT (default 3306). Ensure the MySQL server is running and accessible from the client.