{"_id":"@arronbillwsy61/mcp-server-mysql","name":"@arronbillwsy61/mcp-server-mysql","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@arronbillwsy61/mcp-server-mysql","version":"1.0.0","author":{"name":"arronbillwsy61"},"description":"A Model Context Protocol server for MySQL database operations","type":"module","bin":{"mcp-server-mysql":"dist/index.js"},"scripts":{"build":"tsc && node -e \"require('fs').chmodSync('dist/index.js', '755')\"","prepare":"npm run build","watch":"tsc --watch","inspector":"npx @modelcontextprotocol/inspector dist/index.js"},"keywords":["mcp","model-context-protocol","mysql","database","claude","anthropic"],"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"0.6.0","dotenv":"^16.4.7","mysql2":"^3.11.5"},"devDependencies":{"@types/node":"^20.11.24","typescript":"^5.3.3"},"repository":{"type":"git","url":"git+https://github.com/f4ww4z/mcp-mysql-server.git"},"publishConfig":{"access":"public"},"_id":"@arronbillwsy61/mcp-server-mysql@1.0.0","bugs":{"url":"https://github.com/f4ww4z/mcp-mysql-server/issues"},"homepage":"https://github.com/f4ww4z/mcp-mysql-server#readme","_nodeVersion":"22.14.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-fquz+sLbPawOHXqt8enkEf7fDN0COdywPluZfVFSa9tDOUtv8IWAw6rr+wvVLU5fgEoyxoaFAXPiRKEMbV2wRQ==","shasum":"1ccdc3ea8edeb5ee9e1e5aceb77e2475e17991c9","tarball":"https://registry.npmjs.org/@arronbillwsy61/mcp-server-mysql/-/mcp-server-mysql-1.0.0.tgz","fileCount":3,"unpackedSize":16031,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDc4LuwMF5hLyTQLmujnyL4vDUrQypCl3WIFvzPQ7YCvAiA3ksRkL/gofKo0OvN8bDVHOLfDO6gBJgfepAicnV4usA=="}]},"_npmUser":{"name":"arronbillwsy","email":"arronbillwsy@163.com"},"directories":{},"maintainers":[{"name":"arronbillwsy","email":"arronbillwsy@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server-mysql_1.0.0_1743581675442_0.5047366554603894"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-02T08:14:35.344Z","1.0.0":"2025-04-02T08:14:35.603Z","modified":"2025-04-02T08:14:36.191Z"},"maintainers":[{"name":"arronbillwsy","email":"arronbillwsy@163.com"}],"description":"A Model Context Protocol server for MySQL database operations","homepage":"https://github.com/f4ww4z/mcp-mysql-server#readme","keywords":["mcp","model-context-protocol","mysql","database","claude","anthropic"],"repository":{"type":"git","url":"git+https://github.com/f4ww4z/mcp-mysql-server.git"},"author":{"name":"arronbillwsy61"},"bugs":{"url":"https://github.com/f4ww4z/mcp-mysql-server/issues"},"license":"MIT","readme":"# @f4ww4z/mcp-mysql-server\n[![smithery badge](https://smithery.ai/badge/@f4ww4z/mcp-mysql-server)](https://smithery.ai/server/@f4ww4z/mcp-mysql-server)\n\nA Model Context Protocol server that provides MySQL database operations. This server enables AI models to interact with MySQL databases through a standardized interface.\n\n<a href=\"https://glama.ai/mcp/servers/qma33al6ie\"><img width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/qma33al6ie/badge\" alt=\"mcp-mysql-server MCP server\" /></a>\n\n## Installation\n\n### Installing via Smithery\n\nTo install MySQL Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@f4ww4z/mcp-mysql-server):\n\n```bash\nnpx -y @smithery/cli install @f4ww4z/mcp-mysql-server --client claude\n```\n\n### Manual Installation\n```bash\nnpx @f4ww4z/mcp-mysql-server\n```\n\n## Configuration\n\nThe server requires the following environment variables to be set in your MCP settings configuration file:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@f4ww4z/mcp-mysql-server\"],\n      \"env\": {\n        \"MYSQL_HOST\": \"your_host\",\n        \"MYSQL_USER\": \"your_user\",\n        \"MYSQL_PASSWORD\": \"your_password\",\n        \"MYSQL_DATABASE\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\n### 1. connect_db\nEstablish connection to MySQL database using provided credentials.\n\n```typescript\nuse_mcp_tool({\n  server_name: \"mysql\",\n  tool_name: \"connect_db\",\n  arguments: {\n    host: \"localhost\",\n    user: \"your_user\",\n    password: \"your_password\",\n    database: \"your_database\"\n  }\n});\n```\n\n### 2. query\nExecute SELECT queries with optional prepared statement parameters.\n\n```typescript\nuse_mcp_tool({\n  server_name: \"mysql\",\n  tool_name: \"query\",\n  arguments: {\n    sql: \"SELECT * FROM users WHERE id = ?\",\n    params: [1]\n  }\n});\n```\n\n### 3. execute\nExecute INSERT, UPDATE, or DELETE queries with optional prepared statement parameters.\n\n```typescript\nuse_mcp_tool({\n  server_name: \"mysql\",\n  tool_name: \"execute\",\n  arguments: {\n    sql: \"INSERT INTO users (name, email) VALUES (?, ?)\",\n    params: [\"John Doe\", \"john@example.com\"]\n  }\n});\n```\n\n### 4. list_tables\nList all tables in the connected database.\n\n```typescript\nuse_mcp_tool({\n  server_name: \"mysql\",\n  tool_name: \"list_tables\",\n  arguments: {}\n});\n```\n\n### 5. describe_table\nGet the structure of a specific table.\n\n```typescript\nuse_mcp_tool({\n  server_name: \"mysql\",\n  tool_name: \"describe_table\",\n  arguments: {\n    table: \"users\"\n  }\n});\n```\n\n## Features\n\n- Secure connection handling with automatic cleanup\n- Prepared statement support for query parameters\n- Comprehensive error handling and validation\n- TypeScript support\n- Automatic connection management\n\n## Security\n\n- Uses prepared statements to prevent SQL injection\n- Supports secure password handling through environment variables\n- Validates queries before execution\n- Automatically closes connections when done\n\n## Error Handling\n\nThe server provides detailed error messages for common issues:\n- Connection failures\n- Invalid queries\n- Missing parameters\n- Database errors\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request to https://github.com/f4ww4z/mcp-mysql-server\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-5a0aad7987d69b566b139087d3f9887b"}