{"_id":"@duxvfeng/mcp-server-mysql","name":"@duxvfeng/mcp-server-mysql","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@duxvfeng/mcp-server-mysql","version":"1.0.0","description":"MCP Server for MySQL - Enables AI assistants to interact with MySQL databases","main":"index.js","bin":{"mcp-server-mysql":"bin/mcp-server-mysql"},"scripts":{"postinstall":"node scripts/install.js","start":"node bin/mcp-server-mysql"},"keywords":["mcp","mysql","database","ai","claude","model-context-protocol"],"author":{"name":"dxf"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/your-username/mcp-server-mysql-java17.git"},"engines":{"node":">=16.0.0"},"os":["darwin","linux","win32"],"gitHead":"d80ceac69c206c2275ce4d58ab7181ba50a4f8bf","_id":"@duxvfeng/mcp-server-mysql@1.0.0","bugs":{"url":"https://github.com/your-username/mcp-server-mysql-java17/issues"},"homepage":"https://github.com/your-username/mcp-server-mysql-java17#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-HXchCgDr3QHTI20kPDa9NO4pZjYoV2IE1sTLUt7cC6t2Z+YSt1uAMZ5vux1Kt3gFMHzEiqXEseQgnSEqSD5Tyw==","shasum":"ea39864e8bdd344a5a2b16db8368f1b075174faa","tarball":"https://registry.npmjs.org/@duxvfeng/mcp-server-mysql/-/mcp-server-mysql-1.0.0.tgz","fileCount":6,"unpackedSize":14219051,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICRrlPXduvaBhlhNedctGrGLZKxb5mCd+KUeNiW7hY5PAiBp6Q8mvqKXzXWXamaopLHxWceJM/jiWTbdUWaTm0pRmA=="}]},"_npmUser":{"name":"duxvfeng","email":"395781596@qq.com"},"directories":{},"maintainers":[{"name":"duxvfeng","email":"395781596@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server-mysql_1.0.0_1780640475841_0.5941655882483461"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-05T06:21:15.646Z","1.0.0":"2026-06-05T06:21:16.194Z","modified":"2026-06-05T06:21:16.517Z"},"maintainers":[{"name":"duxvfeng","email":"395781596@qq.com"}],"description":"MCP Server for MySQL - Enables AI assistants to interact with MySQL databases","homepage":"https://github.com/your-username/mcp-server-mysql-java17#readme","keywords":["mcp","mysql","database","ai","claude","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/your-username/mcp-server-mysql-java17.git"},"author":{"name":"dxf"},"bugs":{"url":"https://github.com/your-username/mcp-server-mysql-java17/issues"},"license":"MIT","readme":"# MCP Server for MySQL\n\nA Model Context Protocol (MCP) server that enables AI assistants to interact with MySQL databases.\n\n## Features\n\n- **Query**: Execute SELECT queries against the database\n- **List Databases**: List all available databases\n- **List Tables**: List tables in a database\n- **Describe Table**: Get table schema/column information\n- **Execute**: Execute INSERT/UPDATE/DELETE statements (with confirmation)\n\n## Security\n\n- **Read-only mode** by default\n- **SQL injection protection** with identifier sanitization\n- **Table-level access control** with whitelist/blacklist\n- **Blocked SQL keywords** (DROP, TRUNCATE, ALTER, etc.)\n- **Audit logging** for all operations\n\n## Requirements\n\n- Node.js 16+ (JDK 17 is automatically downloaded during installation)\n- MySQL 5.7+ or 8.0+\n\n## Installation\n\n### Option 1: Using npx (Recommended)\n\nNo installation required! Just configure Claude Desktop:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@anthropic/mcp-server-mysql\"],\n      \"env\": {\n        \"MYSQL_HOST\": \"localhost\",\n        \"MYSQL_PORT\": \"3306\",\n        \"MYSQL_USER\": \"root\",\n        \"MYSQL_PASSWORD\": \"your_password\",\n        \"MYSQL_DATABASE\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\n### Option 2: Global Install\n\n```bash\nnpm install -g @anthropic/mcp-server-mysql\n```\n\nThen configure Claude Desktop:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"mcp-server-mysql\",\n      \"env\": {\n        \"MYSQL_HOST\": \"localhost\",\n        \"MYSQL_PORT\": \"3306\",\n        \"MYSQL_USER\": \"root\",\n        \"MYSQL_PASSWORD\": \"your_password\",\n        \"MYSQL_DATABASE\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\n**Note**: JDK 17 is automatically downloaded during installation. No manual Java installation required!\n\n## Configuration\n\n### Environment Variables\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `MYSQL_HOST` | `localhost` | MySQL host |\n| `MYSQL_PORT` | `3306` | MySQL port |\n| `MYSQL_USER` | `root` | MySQL username |\n| `MYSQL_PASSWORD` | `\"\"` | MySQL password |\n| `MYSQL_DATABASE` | `\"\"` | Default database |\n| `MYSQL_USE_SSL` | `false` | Enable SSL connection |\n| `MCP_READ_ONLY` | `true` | Read-only mode (blocks INSERT/UPDATE/DELETE) |\n| `MCP_MAX_ROWS` | `100` | Maximum rows returned per query |\n| `MCP_AUDIT_ENABLED` | `true` | Enable audit logging |\n| `MCP_BLOCKED_SQL` | `DROP,TRUNCATE,ALTER,...` | Blocked SQL keywords |\n| `MCP_ALLOWED_TABLES` | `\"\"` (all) | Allowed tables (comma-separated) |\n| `MCP_BLOCKED_TABLES` | `\"\"` (none) | Blocked tables (comma-separated) |\n\n### Examples\n\n#### Read-only with specific tables\n\n```json\n{\n  \"env\": {\n    \"MYSQL_HOST\": \"localhost\",\n    \"MYSQL_USER\": \"readonly_user\",\n    \"MYSQL_PASSWORD\": \"password\",\n    \"MYSQL_DATABASE\": \"mydb\",\n    \"MCP_READ_ONLY\": \"true\",\n    \"MCP_ALLOWED_TABLES\": \"users,orders,products\"\n  }\n}\n```\n\n#### Read-write with blocked tables\n\n```json\n{\n  \"env\": {\n    \"MYSQL_HOST\": \"localhost\",\n    \"MYSQL_USER\": \"app_user\",\n    \"MYSQL_PASSWORD\": \"password\",\n    \"MYSQL_DATABASE\": \"mydb\",\n    \"MCP_READ_ONLY\": \"false\",\n    \"MCP_BLOCKED_TABLES\": \"admin_users,sessions\"\n  }\n}\n```\n\n## How It Works\n\n1. When you run `npm install` or `npx`, the package automatically downloads Adoptium JDK 17 for your platform\n2. The JDK is stored in the `jdk/` directory within the package\n3. The MCP server uses this local JDK to run the Java application\n4. No system-wide Java installation is required\n\n## Development\n\n### Build from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-username/mcp-server-mysql-java17.git\ncd mcp-server-mysql-java17\n\n# Build\nmvn clean package\n\n# Run\njava -jar target/mcp-server-mysql-java17-1.0-SNAPSHOT.jar\n```\n\n### Publish to npm\n\n1. Update version in `package.json`\n2. Run:\n   ```bash\n   npm publish --access public\n   ```\n\n## Troubleshooting\n\n### JDK Download Fails\n\nIf the automatic JDK download fails, you can manually install Java 17:\n- Download from: https://adoptium.net/\n- The package will use the system Java if the local JDK is not available\n\n### Permission Denied (macOS/Linux)\n\nIf you get permission errors:\n```bash\nchmod +x node_modules/@anthropic/mcp-server-mysql/bin/mcp-server-mysql\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-c3e39124ac612206361b5225a465d94f"}