{"_id":"@maxlmgc/mysql-mcp","_rev":"4-0ac550c9509fee12b23f199778ebe86b","name":"@maxlmgc/mysql-mcp","dist-tags":{"latest":"1.0.9"},"versions":{"1.0.6":{"name":"@maxlmgc/mysql-mcp","version":"1.0.6","keywords":["mysql","mcp","modelcontextprotocol"],"author":"","license":"MIT","_id":"@maxlmgc/mysql-mcp@1.0.6","maintainers":[{"name":"maxlmgc","email":"lmgc.top@gmail.com"}],"bin":{"mysql-mcp":"build/index.js"},"dist":{"shasum":"db5f03d3bba40e7a6a2b225b1e644debd80d6d70","tarball":"https://registry.npmjs.org/@maxlmgc/mysql-mcp/-/mysql-mcp-1.0.6.tgz","fileCount":5,"integrity":"sha512-llQiBBgl7a+7pvGxpNbjV9SbCbSeaUlJp+Hr4w6lKW44jLZO/HBzO6oCpy47qfoyLR5yIdbrXFIMU9AGPQWj3A==","signatures":[{"sig":"MEUCIFN5FJKNFwAnFgTv+ZFhnvMOZ0yucpr+WIXZz6NtmU7UAiEA6Zxm7grTtgn5NlMMnq5O1YIk3URQ35FE0wbLoGa5slE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16538},"main":"./build/index.js","type":"module","gitHead":"161d31b67fdf7a9ef1f01b1e9248cf03aa2a3660","scripts":{"dev":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","build":"tsc","clean":"rimraf build","start":"node ./build/index.js","dev:readonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=true&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","dev:noreadonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=false&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"maxlmgc","email":"lmgc.top@gmail.com"},"_npmVersion":"10.9.8","description":"MySQL Model Context Protocol server","directories":{},"_nodeVersion":"22.23.1","dependencies":{"zod":"^3.25.76","mysql2":"^3.20.0","express":"^5.2.1","@types/express":"^5.0.6","@modelcontextprotocol/sdk":"^1.29.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","rimraf":"^6.1.3","nodemon":"^3.1.14","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/mysql-mcp_1.0.6_1784870230710_0.6590427000455772","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@maxlmgc/mysql-mcp","version":"1.0.7","keywords":["mysql","mcp","modelcontextprotocol"],"author":"","license":"MIT","_id":"@maxlmgc/mysql-mcp@1.0.7","maintainers":[{"name":"maxlmgc","email":"lmgc.top@gmail.com"}],"homepage":"https://github.com/MaxLMGC/mysql-mcp#readme","bin":{"mysql-mcp":"build/index.js"},"dist":{"shasum":"01144f60746ee3365e3dc6106f8ad6de538848f5","tarball":"https://registry.npmjs.org/@maxlmgc/mysql-mcp/-/mysql-mcp-1.0.7.tgz","fileCount":5,"integrity":"sha512-WPpWYE8/h2gVwS2roq5+bafnuv7nkKp7RQOSFg4CLSgsKKUi6Ol/tAwZ3Fvsve5UMta+QkGxpjLbx2+8xZrL5g==","signatures":[{"sig":"MEUCIGyrotWNeCaBPek9o1iDcV2hGfVZBXM3sKkUD7rr4rf2AiEAmJS7FoRc0c3uhwOpis2JpuBEIHgy6VKftztzlPea1PM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16648},"main":"./build/index.js","type":"module","gitHead":"16573197ef3255325cf177b90f1b1d3955510611","scripts":{"dev":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","build":"tsc","clean":"rimraf build","start":"node ./build/index.js","dev:readonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=true&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","dev:noreadonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=false&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"maxlmgc","email":"lmgc.top@gmail.com"},"_npmVersion":"10.9.8","description":"MySQL Model Context Protocol server","directories":{},"_nodeVersion":"22.23.1","dependencies":{"zod":"^3.25.76","mysql2":"^3.20.0","express":"^5.2.1","@types/express":"^5.0.6","@modelcontextprotocol/sdk":"^1.29.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","rimraf":"^6.1.3","nodemon":"^3.1.14","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/mysql-mcp_1.0.7_1784870593354_0.9820285083777613","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@maxlmgc/mysql-mcp","version":"1.0.8","keywords":["mysql","mcp","modelcontextprotocol"],"author":"","license":"MIT","_id":"@maxlmgc/mysql-mcp@1.0.8","maintainers":[{"name":"maxlmgc","email":"lmgc.top@gmail.com"}],"homepage":"https://github.com/MaxLMGC/mysql-mcp#readme","bin":{"mysql-mcp":"build/index.js"},"dist":{"shasum":"84d8d96e39411fa14056b975407465646ba03788","tarball":"https://registry.npmjs.org/@maxlmgc/mysql-mcp/-/mysql-mcp-1.0.8.tgz","fileCount":5,"integrity":"sha512-FnlGIZv5tFELcC2HnTihShe7uZMa1Iyo1g3MuORPRJ1iBjj9fnqlw3+FlqN3ojySWfA8o8omkMS/5rXXS8uPyw==","signatures":[{"sig":"MEUCIF9OPmClDBjNh1v4tvEJLjHZFMWgj2dR6lkEAGBEgX2SAiEAp+EoVvxW3EsbFxD5iFtOZdk9wABCPNGSid9L70jhKdg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16501},"main":"./build/index.js","type":"module","gitHead":"de6473817b6f9257513bfd8702cf6d535b54699e","scripts":{"dev":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","build":"tsc","clean":"rimraf build","start":"node ./build/index.js","dev:readonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=true&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","dev:noreadonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=false&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"maxlmgc","email":"lmgc.top@gmail.com"},"_npmVersion":"10.9.8","description":"MySQL Model Context Protocol server","directories":{},"_nodeVersion":"22.23.1","dependencies":{"zod":"^3.25.76","mysql2":"^3.20.0","express":"^5.2.1","@types/express":"^5.0.6","@maxlmgc/mysql-mcp":"^1.0.7","@modelcontextprotocol/sdk":"^1.29.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","rimraf":"^6.1.3","nodemon":"^3.1.14","typescript":"^6.0.2","@types/node":"^25.5.2"},"_npmOperationalInternal":{"tmp":"tmp/mysql-mcp_1.0.8_1784871260031_0.7060759763211601","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"@maxlmgc/mysql-mcp","version":"1.0.9","description":"MySQL Model Context Protocol server","main":"./build/index.js","type":"module","bin":{"mysql-mcp":"build/index.js"},"scripts":{"build":"tsc","start":"node ./build/index.js","dev":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","dev:readonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=true&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","dev:noreadonly":"set MYSQL_HOST=localhost&& set MYSQL_PORT=3306&& set MYSQL_USER=root&& set MYSQL_PASS=lmgc&& set MYSQL_DB=learn&& set MYSQL_READONLY=false&& set PORT=8090&& nodemon --exec tsx ./src/index.ts","clean":"rimraf build","prepublishOnly":"npm run clean && npm run build"},"keywords":["mysql","mcp","modelcontextprotocol"],"homepage":"https://github.com/MaxLMGC/mysql-mcp#readme","author":"","license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","@types/express":"^5.0.6","express":"^5.2.1","mysql2":"^3.20.0","zod":"^3.25.76"},"devDependencies":{"@types/node":"^25.5.2","nodemon":"^3.1.14","rimraf":"^6.1.3","tsx":"^4.21.0","typescript":"^6.0.2"},"_id":"@maxlmgc/mysql-mcp@1.0.9","gitHead":"33a820bb3d1a85914124c871116c6b16abce3153","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-MHQvZNDDDerhhKPEtPtBRn/fgq+N/Q6QVIZSdt5bTaM/ZLtezz0U46Q8pEj1jFgHe2PR0TqNT1IELl0K8DdvBg==","shasum":"1f1cabdb7a4e3dacae410d58e80ec74f0415ccd2","tarball":"https://registry.npmjs.org/@maxlmgc/mysql-mcp/-/mysql-mcp-1.0.9.tgz","fileCount":6,"unpackedSize":19275,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCFMq3FFqePi2gS4Hv9IYC/qEQ54xUN7Rq/HUZYhhrSSwIhAPPTbYBcyXE2Jzj4zwvsGpfjyaYJrZND5kCaMmO5/E9S"}]},"_npmUser":{"name":"maxlmgc","email":"lmgc.top@gmail.com"},"directories":{},"maintainers":[{"name":"maxlmgc","email":"lmgc.top@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mysql-mcp_1.0.9_1784871477119_0.23807282466102153"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T05:17:10.584Z","modified":"2026-07-24T05:37:57.462Z","1.0.6":"2026-07-24T05:17:10.854Z","1.0.7":"2026-07-24T05:23:13.479Z","1.0.8":"2026-07-24T05:34:20.161Z","1.0.9":"2026-07-24T05:37:57.291Z"},"license":"MIT","homepage":"https://github.com/MaxLMGC/mysql-mcp#readme","keywords":["mysql","mcp","modelcontextprotocol"],"description":"MySQL Model Context Protocol server","maintainers":[{"name":"maxlmgc","email":"lmgc.top@gmail.com"}],"readme":"# @maxlmgc/mysql-mcp\n\n> MySQL MCP Server — a secure, read-only-by-default MySQL integration for AI clients via the Model Context Protocol.\n\n[中文文档](https://github.com/MaxLMGC/mysql-mcp/blob/main/README_CN.md)\n\n## Tools\n\n| Tool | Description | Read-only mode |\n|---|---|---|\n| `sql_query` | Execute SELECT / SHOW / DESCRIBE / EXPLAIN queries | Allowed |\n| `sql_list_tables` | List all tables in the current database | Allowed |\n| `sql_table_schema` | Get column structure and comments of a table | Allowed |\n| `sql_execute` | Execute INSERT / UPDATE / DELETE (auto-rolled back) | Blocked |\n\n## Environment Variables\n\n### Database Connection (required)\n\n| Variable | Description | Default |\n|---|---|---|\n| `MYSQL_HOST` | Database host | - |\n| `MYSQL_PORT` | Database port | `3306` |\n| `MYSQL_USER` | Database user | - |\n| `MYSQL_PASS` | Database password | (empty) |\n| `MYSQL_DB` | Database name | - |\n\n### Read-only Mode\n\n| Variable | Description | Default |\n|---|---|---|\n| `MYSQL_READONLY` | Set to `false` to disable read-only mode | `true` (enabled) |\n| `MYSQL_READONLY_PREFIXES` | Custom SQL keyword whitelist (comma-separated, overrides defaults) | `SELECT,SHOW,DESCRIBE,DESC,EXPLAIN,WITH` |\n\n### Connection Pool\n\n| Variable | Description | Default |\n|---|---|---|\n| `MYSQL_CONNECTION_LIMIT` | Max connections in pool | `10` |\n| `MYSQL_MULTIPLE_STATEMENTS` | Set to `false` to disable multi-statement execution | `true` |\n\n## Installation\n\n```bash\nnpm install @maxlmgc/mysql-mcp\n```\n\n## Usage\n\n### MCP Client Configuration\n\nAdd to your MCP client configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@maxlmgc/mysql-mcp\"],\n      \"env\": {\n        \"MYSQL_HOST\": \"localhost\",\n        \"MYSQL_PORT\": \"3306\",\n        \"MYSQL_USER\": \"root\",\n        \"MYSQL_PASS\": \"your_password\",\n        \"MYSQL_DB\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\n### Read-only Mode (default)\n\nBy default only query operations are allowed; `sql_execute` is not exposed.\n\n### Disable Read-only Mode\n\n```json\n\"env\": {\n  \"MYSQL_HOST\": \"localhost\",\n  \"MYSQL_USER\": \"root\",\n  \"MYSQL_DB\": \"your_database\",\n  \"MYSQL_READONLY\": \"false\"\n}\n```\n\n### Custom Whitelist\n\nOnly allow SELECT and SHOW:\n\n```json\n\"env\": {\n  \"MYSQL_HOST\": \"localhost\",\n  \"MYSQL_USER\": \"root\",\n  \"MYSQL_DB\": \"your_database\",\n  \"MYSQL_READONLY_PREFIXES\": \"SELECT,SHOW\"\n}\n```\n\n## Security\n\n- **Read-only by default**: `sql_execute` is not registered in read-only mode\n- **SQL injection prevention**: Table names validated with regex; parameterized queries used\n- **Startup validation**: Missing required env vars cause immediate failure\n- **Transaction rollback**: `sql_execute` runs in a transaction that is always rolled back\n- **Dual-layer protection**: SQL validation at both tool layer and connection pool layer\n\n## License\n\nMIT\n","readmeFilename":"README.md"}