{"_id":"@ashenud/mcp-mysql-server","name":"@ashenud/mcp-mysql-server","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ashenud/mcp-mysql-server","version":"1.0.0","description":"MySQL MCP server for Cursor IDE integration","type":"module","main":"dist/index.js","types":"dist/index.d.ts","bin":{"mcp-mysql-server":"dist/index.js"},"scripts":{"build":"tsc && chmod +x dist/index.js","dev":"tsc --watch","start":"node dist/index.js","prepublishOnly":"npm run build","test":"jest","test:unit":"jest tests/unit.test.js","test:integration":"jest tests/integration.test.js","test:protocol":"jest tests/mcp-protocol.test.js","test:all":"jest tests/"},"keywords":["mcp","mysql","cursor","database","server"],"author":{"name":"Ashen Udithamal"},"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^0.4.0","mysql2":"^3.6.5","zod":"^3.22.4"},"devDependencies":{"@types/node":"^20.10.0","typescript":"^5.3.0","jest":"^29.7.0","@types/jest":"^29.5.8","@jest/globals":"^29.7.0"},"engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/ashenud/mcp-mysql-server.git"},"bugs":{"url":"https://github.com/ashenud/mcp-mysql-server/issues"},"homepage":"https://github.com/ashenud/mcp-mysql-server#readme","_id":"@ashenud/mcp-mysql-server@1.0.0","gitHead":"9553d83180e27cb15dd3659d7f604d8488b2b2a2","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-uZ2G1LNxd6xB+hYYp8kGoGdXSEEb/CYltjnizxGt/q97aQcSZMcjYTSjg03841tO7yX1w9L0sqN9oyDq7rStAA==","shasum":"3c7067a376a396dbdca2f17c65f2935441620b38","tarball":"https://registry.npmjs.org/@ashenud/mcp-mysql-server/-/mcp-mysql-server-1.0.0.tgz","fileCount":7,"unpackedSize":39303,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHni8+EsxTARfacKgmUIjsBDjjdUS5FwkFtIFpihkMTKAiA1EnU107kxZRKBLtZ3T597r677WGmd9eKctQ+J5X7TYQ=="}]},"_npmUser":{"name":"ashenud","email":"udithamal.lk@gmail.com"},"directories":{},"maintainers":[{"name":"ashenud","email":"udithamal.lk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-mysql-server_1.0.0_1759073948124_0.3862904102121256"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-28T15:39:08.017Z","1.0.0":"2025-09-28T15:39:08.321Z","modified":"2025-09-28T15:39:08.622Z"},"maintainers":[{"name":"ashenud","email":"udithamal.lk@gmail.com"}],"description":"MySQL MCP server for Cursor IDE integration","homepage":"https://github.com/ashenud/mcp-mysql-server#readme","keywords":["mcp","mysql","cursor","database","server"],"repository":{"type":"git","url":"git+https://github.com/ashenud/mcp-mysql-server.git"},"author":{"name":"Ashen Udithamal"},"bugs":{"url":"https://github.com/ashenud/mcp-mysql-server/issues"},"license":"MIT","readme":"# MySQL MCP Server\n\nA Model Context Protocol (MCP) server for MySQL database integration with Cursor IDE. This server provides tools to connect to, query, and manage MySQL databases directly from Cursor.\n\n## Features\n\n- 🔌 **Easy Connection**: Connect to MySQL databases with simple configuration\n- 🔍 **Query Execution**: Run SQL queries and get structured results\n- 📊 **Database Management**: List databases, tables, and table schemas\n- 🛡️ **Secure**: Supports SSL connections and prepared statements\n- ⚡ **Performance**: Connection pooling for optimal performance\n- 🎯 **TypeScript**: Fully typed for better development experience\n\n## Installation\n\n### From npm (recommended)\n\n```bash\nnpm install -g @ashenud/mcp-mysql-server\n```\n\n### From source\n\n```bash\ngit clone https://github.com/ashenud/mcp-mysql-server.git\ncd mcp-mysql-server\nnpm install\nnpm run build\nnpm link\n```\n\n## Usage\n\n### Cursor IDE Configuration\n\nAdd the following to your Cursor MCP settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"@ashenud/mcp-mysql-server\",\n      \"args\": [],\n      \"env\": {\n        \"MYSQL_HOST\": \"localhost\",\n        \"MYSQL_PORT\": \"3306\",\n        \"MYSQL_USER\": \"your_username\",\n        \"MYSQL_PASSWORD\": \"your_password\",\n        \"MYSQL_DATABASE\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\n### Available Tools\n\n#### 1. `mysql_connect`\nConnect to a MySQL database.\n\n**Parameters:**\n- `host` (string, optional): MySQL host (default: \"localhost\")\n- `port` (number, optional): MySQL port (default: 3306)\n- `user` (string, required): MySQL username\n- `password` (string, required): MySQL password\n- `database` (string, optional): Database name\n- `ssl` (boolean, optional): Use SSL connection (default: false)\n- `connectionLimit` (number, optional): Connection pool limit (default: 10)\n\n**Example:**\n```json\n{\n  \"name\": \"mysql_connect\",\n  \"arguments\": {\n    \"host\": \"localhost\",\n    \"port\": 3306,\n    \"user\": \"myuser\",\n    \"password\": \"mypassword\",\n    \"database\": \"mydb\",\n    \"ssl\": false\n  }\n}\n```\n\n#### 2. `mysql_query`\nExecute a SQL query.\n\n**Parameters:**\n- `query` (string, required): SQL query to execute\n- `params` (array, optional): Query parameters for prepared statements\n\n**Example:**\n```json\n{\n  \"name\": \"mysql_query\",\n  \"arguments\": {\n    \"query\": \"SELECT * FROM users WHERE age > ?\",\n    \"params\": [\"25\"]\n  }\n}\n```\n\n#### 3. `mysql_list_databases`\nList all available databases.\n\n**Example:**\n```json\n{\n  \"name\": \"mysql_list_databases\",\n  \"arguments\": {}\n}\n```\n\n#### 4. `mysql_list_tables`\nList tables in a database.\n\n**Parameters:**\n- `database` (string, optional): Database name (uses current if not provided)\n\n**Example:**\n```json\n{\n  \"name\": \"mysql_list_tables\",\n  \"arguments\": {\n    \"database\": \"mydb\"\n  }\n}\n```\n\n#### 5. `mysql_describe_table`\nGet table structure and schema information.\n\n**Parameters:**\n- `table` (string, required): Table name\n- `database` (string, optional): Database name (uses current if not provided)\n\n**Example:**\n```json\n{\n  \"name\": \"mysql_describe_table\",\n  \"arguments\": {\n    \"table\": \"users\",\n    \"database\": \"mydb\"\n  }\n}\n```\n\n#### 6. `mysql_disconnect`\nClose the MySQL connection.\n\n**Example:**\n```json\n{\n  \"name\": \"mysql_disconnect\",\n  \"arguments\": {}\n}\n```\n\n## Development\n\n### Prerequisites\n\n- Node.js 18.0.0 or higher\n- npm or yarn\n\n### Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/ashenud/mcp-mysql-server.git\ncd mcp-mysql-server\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Build the project:\n```bash\nnpm run build\n```\n\n4. Run in development mode:\n```bash\nnpm run dev\n```\n\n### Testing\n\nRun the test suite:\n```bash\nnpm test\n```\n\n## Configuration\n\nThe server can be configured through environment variables or by passing parameters to the `mysql_connect` tool:\n\n- `MYSQL_HOST`: Default MySQL host\n- `MYSQL_PORT`: Default MySQL port\n- `MYSQL_USER`: Default MySQL username\n- `MYSQL_PASSWORD`: Default MySQL password\n- `MYSQL_DATABASE`: Default database name\n- `MYSQL_SSL`: Use SSL connection (true/false)\n\n## Security Considerations\n\n- Always use strong passwords for database connections\n- Enable SSL for production environments\n- Use connection pooling to limit concurrent connections\n- Validate and sanitize all user inputs before executing queries\n- Consider using read-only database users for MCP connections\n\n## Error Handling\n\nThe server provides detailed error messages for common issues:\n\n- Connection failures\n- Invalid SQL queries\n- Authentication errors\n- Database access permissions\n- Network timeouts\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Make your changes and add tests\n4. Commit your changes: `git commit -am 'Add some feature'`\n5. Push to the branch: `git push origin feature-name`\n6. Submit a pull request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Support\n\n- 📧 Email: udithamal.lk@gmail.com\n- 🐛 Issues: [GitHub Issues](https://github.com/ashenud/mcp-mysql-server/issues)\n- 📖 Documentation: [GitHub Wiki](https://github.com/ashenud/mcp-mysql-server/wiki)\n\n## Changelog\n\n### 1.0.0\n- Initial release\n- Basic MySQL connection and query functionality\n- Database and table listing\n- Table schema inspection\n- Connection pooling support\n- SSL connection support\n","readmeFilename":"README.md","_rev":"1-2374deab0889df28746c7bb6f946fabe"}