{"_id":"@chenyingxian/mysql-readonly-mcp","_rev":"4-e2d8deadb22ca4e3969455f06826c8b8","name":"@chenyingxian/mysql-readonly-mcp","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@chenyingxian/mysql-readonly-mcp","version":"0.1.0","keywords":["mcp","mysql","readonly","database","model-context-protocol"],"author":"","license":"MIT","_id":"@chenyingxian/mysql-readonly-mcp@0.1.0","maintainers":[{"name":"chenyingxian","email":"a1030307996@gmail.com"}],"bin":{"mysql-readonly-mcp":"dist/index.js"},"dist":{"shasum":"395b93d1f9bcb804748f9aba68ea9ffa9c3c3509","tarball":"https://registry.npmjs.org/@chenyingxian/mysql-readonly-mcp/-/mysql-readonly-mcp-0.1.0.tgz","fileCount":9,"integrity":"sha512-Bd5XirH8H0Yjm/ZLSLo7ny0oyCjqNYgLO4hXZNSRgOkjQdK1Jik388kMMsF9TtR8UaP38s/E+lJUzw75aVEIqQ==","signatures":[{"sig":"MEQCIAZwxMI3ANRXaJhoXD+HoPqcnLfiAgdBoi+T1KLNMR0KAiAqSJlY5O83dZqwwCQw7rH81b6Fxhk7g8E6kFfNNfAe2A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26363},"main":"dist/index.js","type":"commonjs","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenyingxian","email":"a1030307996@gmail.com"},"_npmVersion":"11.9.0","description":"Read-only MySQL MCP server for safe schema inspection and SELECT queries.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^4.4.3","mysql2":"^3.22.3","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","typescript":"^6.0.3","@types/node":"^25.7.0"},"_npmOperationalInternal":{"tmp":"tmp/mysql-readonly-mcp_0.1.0_1779349857993_0.37595878481329525","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@chenyingxian/mysql-readonly-mcp","version":"0.1.1","keywords":["mcp","mysql","readonly","database","model-context-protocol"],"author":"","license":"MIT","_id":"@chenyingxian/mysql-readonly-mcp@0.1.1","maintainers":[{"name":"chenyingxian","email":"a1030307996@gmail.com"}],"homepage":"https://github.com/a1030307996-hash/mysql-mcp#readme","bugs":{"url":"https://github.com/a1030307996-hash/mysql-mcp/issues"},"bin":{"mysql-readonly-mcp":"dist/index.js"},"dist":{"shasum":"fc2c3b478f043e08568ba137eb7b17e6406856c3","tarball":"https://registry.npmjs.org/@chenyingxian/mysql-readonly-mcp/-/mysql-readonly-mcp-0.1.1.tgz","fileCount":10,"integrity":"sha512-2oAh+aGSGpJNbQbl3+pFEeUTsLVtS8s5Obhvt6sRgSOtNC7cuv8usJCNlMJGdazD5Yze4D+COUxwOb3glmDhlg==","signatures":[{"sig":"MEUCIDi42d9EqNCAB29jZ8hSPXV1GAmqlrj43uYlKsd3GsYWAiEA0QhLeqtmu0Z2RJ3HY1cnOQMrol7p+DeshvldL4J3GC0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28172},"main":"dist/index.js","type":"commonjs","gitHead":"61383fa01b2828b2672897a26dad7f0b79e4cf6e","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenyingxian","email":"a1030307996@gmail.com"},"repository":{"url":"git+https://github.com/a1030307996-hash/mysql-mcp.git","type":"git"},"_npmVersion":"11.9.0","description":"Read-only MySQL MCP server for safe schema inspection and SELECT queries.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^4.4.3","mysql2":"^3.22.3","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","typescript":"^6.0.3","@types/node":"^25.7.0"},"_npmOperationalInternal":{"tmp":"tmp/mysql-readonly-mcp_0.1.1_1780103542453_0.7141746129114783","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@chenyingxian/mysql-readonly-mcp","version":"0.1.2","keywords":["mcp","mysql","readonly","database","model-context-protocol"],"author":"","license":"MIT","_id":"@chenyingxian/mysql-readonly-mcp@0.1.2","maintainers":[{"name":"chenyingxian","email":"a1030307996@gmail.com"}],"homepage":"https://github.com/a1030307996-hash/mysql-mcp#readme","bugs":{"url":"https://github.com/a1030307996-hash/mysql-mcp/issues"},"bin":{"mysql-readonly-mcp":"dist/index.js"},"dist":{"shasum":"a5d54521d53338adb4cb87cae4e92879a2acceeb","tarball":"https://registry.npmjs.org/@chenyingxian/mysql-readonly-mcp/-/mysql-readonly-mcp-0.1.2.tgz","fileCount":10,"integrity":"sha512-RvCDINRZ/oAeGlLqzGegN/3JeXlWLkIp8awzkEiKNG2ctmGxUFbaXchUEpD5/03j95nqcC3jym775lH8ByMEpw==","signatures":[{"sig":"MEUCIQDQefkWr4LYFgTr/jN7jl7XD9ZB3LMUkSv8jVc2PAyhAQIgOCzpQNaO8cCq3pkCaOFStz9CdOowHYxnXJ8IIJKDVlw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35209},"main":"dist/index.js","type":"commonjs","gitHead":"29323011a82a19ec4994ef6316497d7de123648c","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenyingxian","email":"a1030307996@gmail.com"},"repository":{"url":"git+https://github.com/a1030307996-hash/mysql-mcp.git","type":"git"},"_npmVersion":"11.9.0","description":"Read-only MySQL MCP server for safe schema inspection and SELECT queries.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^4.4.3","mysql2":"^3.22.3","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","typescript":"^6.0.3","@types/node":"^25.7.0"},"_npmOperationalInternal":{"tmp":"tmp/mysql-readonly-mcp_0.1.2_1780104293030_0.4185899832138624","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@chenyingxian/mysql-readonly-mcp","version":"0.1.3","description":"Read-only MySQL MCP server for safe schema inspection and SELECT queries.","repository":{"type":"git","url":"git+https://github.com/a1030307996-hash/mysql-mcp.git"},"bugs":{"url":"https://github.com/a1030307996-hash/mysql-mcp/issues"},"homepage":"https://github.com/a1030307996-hash/mysql-mcp#readme","main":"dist/index.js","bin":{"mysql-readonly-mcp":"dist/index.js"},"scripts":{"build":"tsc","dev":"tsx src/index.ts","start":"node dist/index.js","typecheck":"tsc --noEmit"},"keywords":["mcp","mysql","readonly","database","model-context-protocol"],"author":"","license":"MIT","type":"commonjs","publishConfig":{"access":"public"},"dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","mysql2":"^3.22.3","zod":"^4.4.3"},"devDependencies":{"@types/node":"^25.7.0","tsx":"^4.21.0","typescript":"^6.0.3"},"gitHead":"3a4a29cdfb7843e278d6ea24224d9a622afd4428","_id":"@chenyingxian/mysql-readonly-mcp@0.1.3","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-giDSuRYSigWDmFCiwCulXLQvSyurgPGURszRYz/MZwrdF4ANhOzfyZFJwJHXJC/r7Owg/apHTblq9TzT250zDw==","shasum":"2152310541d64a640eaee5f9d6d4709799213155","tarball":"https://registry.npmjs.org/@chenyingxian/mysql-readonly-mcp/-/mysql-readonly-mcp-0.1.3.tgz","fileCount":10,"unpackedSize":36754,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCbbz1FGTYXggXPM0WlcdNWfKu+cO/WlfHxFJ3o2DeTxAIhAMJ9TBL1FB2uc7K+3tqAwzVs68VN/467o6sj9ZBnglaS"}]},"_npmUser":{"name":"chenyingxian","email":"a1030307996@gmail.com"},"directories":{},"maintainers":[{"name":"chenyingxian","email":"a1030307996@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mysql-readonly-mcp_0.1.3_1782111057561_0.4631033547802341"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-21T07:50:57.805Z","modified":"2026-06-22T06:50:57.810Z","0.1.0":"2026-05-21T07:50:58.152Z","0.1.1":"2026-05-30T01:12:22.631Z","0.1.2":"2026-05-30T01:24:53.204Z","0.1.3":"2026-06-22T06:50:57.703Z"},"bugs":{"url":"https://github.com/a1030307996-hash/mysql-mcp/issues"},"license":"MIT","homepage":"https://github.com/a1030307996-hash/mysql-mcp#readme","keywords":["mcp","mysql","readonly","database","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/a1030307996-hash/mysql-mcp.git"},"description":"Read-only MySQL MCP server for safe schema inspection and SELECT queries.","maintainers":[{"name":"chenyingxian","email":"a1030307996@gmail.com"}],"readme":"# @chenyingxian/mysql-readonly-mcp\r\n\r\n只读 MySQL MCP Server，用于让 MCP 客户端安全读取 MySQL 表结构、索引信息和少量样例数据。\r\n\r\n服务会拒绝常见写入和 DDL SQL，但仍建议使用专门的只读 MySQL 账号运行。\r\n\r\n## 文档\n\n- [配置说明](https://github.com/a1030307996-hash/mysql-mcp/blob/main/CONFIG.zh-CN.md)\n- [工具说明](https://github.com/a1030307996-hash/mysql-mcp/blob/main/MCP_TOOLS.zh-CN.md)\n- [English README](https://github.com/a1030307996-hash/mysql-mcp/blob/main/README.md)\n- [GitHub 仓库](https://github.com/a1030307996-hash/mysql-mcp)\n\n## 安装\n\r\n```bash\r\nnpm install -g @chenyingxian/mysql-readonly-mcp\r\n```\r\n\r\n也可以不全局安装，直接通过 `npx` 运行：\r\n\r\n```bash\r\nnpx @chenyingxian/mysql-readonly-mcp\r\n```\r\n\r\n## 快速配置\r\n\r\n把真实数据库配置写到本地配置文件：\r\n\r\n```bash\r\nMYSQL_HOST=127.0.0.1\r\nMYSQL_PORT=3306\r\nMYSQL_USER=readonly_user\r\nMYSQL_PASSWORD=your_password\r\nMYSQL_DATABASE=your_database\r\nMYSQL_MCP_MAX_LIMIT=500\r\nMYSQL_MCP_QUERY_TIMEOUT_MS=10000\r\nMYSQL_MCP_CONNECTION_LIMIT=5\r\n```\r\n\r\n然后 MCP 客户端只配置文件路径：\r\n\r\n```json\r\n{\r\n  \"mcpServers\": {\r\n    \"mysql-readonly\": {\r\n      \"command\": \"npx\",\r\n      \"args\": [\"-y\", \"@chenyingxian/mysql-readonly-mcp@latest\"],\r\n      \"env\": {\r\n        \"MYSQL_CONFIG_FILE\": \"/path/to/mysql-readonly.env\"\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n环境变量会覆盖 `MYSQL_CONFIG_FILE` 文件里的同名配置。\r\n\r\n## 工具\r\n\r\n- `list_tables`：列出数据库表和视图。\r\n- `describe_table`：读取表字段和索引元数据。\r\n- `sample_table`：按限制数量读取表样例数据。\r\n- `execute_readonly_sql`：执行只读 `SELECT`、`SHOW`、`DESCRIBE`、`DESC`、`EXPLAIN` 或 `WITH` 语句。\r\n\r\n## 安全说明\r\n\r\n- 建议使用专门的只读 MySQL 账号。\r\n- 不要在 MCP 客户端配置中直接暴露生产数据库密码。\r\n- 不要发布真实 `.env` 文件、内部主机、数据库名、用户名或密码。\r\n\r\n","readmeFilename":"README.zh-CN.md"}