{"id":22889299,"url":"https://github.com/designcomputer/mysql_mcp_server","last_synced_at":"2025-05-15T15:08:59.803Z","repository":{"id":266358042,"uuid":"898128804","full_name":"designcomputer/mysql_mcp_server","owner":"designcomputer","description":"A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases","archived":false,"fork":false,"pushed_at":"2025-03-29T17:01:52.000Z","size":69,"stargazers_count":236,"open_issues_count":15,"forks_count":69,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T22:35:40.959Z","etag":null,"topics":["ai","mcp","model-context-protocol","mysql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/designcomputer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T20:53:52.000Z","updated_at":"2025-04-04T16:09:33.000Z","dependencies_parsed_at":"2024-12-03T21:55:22.206Z","dependency_job_id":null,"html_url":"https://github.com/designcomputer/mysql_mcp_server","commit_stats":null,"previous_names":["designcomputer/mysql_mcp_server"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/designcomputer%2Fmysql_mcp_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/designcomputer%2Fmysql_mcp_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/designcomputer%2Fmysql_mcp_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/designcomputer%2Fmysql_mcp_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/designcomputer","download_url":"https://codeload.github.com/designcomputer/mysql_mcp_server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","mcp","model-context-protocol","mysql"],"created_at":"2024-12-13T21:28:08.546Z","updated_at":"2025-04-08T00:39:42.698Z","avatar_url":"https://github.com/designcomputer.png","language":"Python","readme":"![Tests](https://github.com/designcomputer/mysql_mcp_server/actions/workflows/test.yml/badge.svg)\n[![smithery badge](https://smithery.ai/badge/mysql-mcp-server)](https://smithery.ai/server/mysql-mcp-server)\n# MySQL MCP Server\nA Model Context Protocol (MCP) implementation that enables secure interaction with MySQL databases. This server component facilitates communication between AI applications (hosts/clients) and MySQL databases, making database exploration and analysis safer and more structured through a controlled interface.\n\n\u003e **Note**: MySQL MCP Server is not designed to be used as a standalone server, but rather as a communication protocol implementation between AI applications and MySQL databases.\n\n## Features\n- List available MySQL tables as resources\n- Read table contents\n- Execute SQL queries with proper error handling\n- Secure database access through environment variables\n- Comprehensive logging\n\n## Installation\n### Manual Installation\n```bash\npip install mysql-mcp-server\n```\n\n### Installing via Smithery\nTo install MySQL MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mysql-mcp-server):\n```bash\nnpx -y @smithery/cli install mysql-mcp-server --client claude\n```\n\n## Configuration\nSet the following environment variables:\n```bash\nMYSQL_HOST=localhost     # Database host\nMYSQL_PORT=3306         # Optional: Database port (defaults to 3306 if not specified)\nMYSQL_USER=your_username\nMYSQL_PASSWORD=your_password\nMYSQL_DATABASE=your_database\n```\n\n## Usage\n### With Claude Desktop\nAdd this to your `claude_desktop_config.json`:\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"--directory\", \n        \"path/to/mysql_mcp_server\",\n        \"run\",\n        \"mysql_mcp_server\"\n      ],\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### Debugging with MCP Inspector\nWhile MySQL MCP Server isn't intended to be run standalone or directly from the command line with Python, you can use the MCP Inspector to debug it.\n\nThe MCP Inspector provides a convenient way to test and debug your MCP implementation:\n\n```bash\n# Install dependencies\npip install -r requirements.txt\n# Use the MCP Inspector for debugging (do not run directly with Python)\n```\n\nThe MySQL MCP Server is designed to be integrated with AI applications like Claude Desktop and should not be run directly as a standalone Python program.\n\n## Development\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/mysql_mcp_server.git\ncd mysql_mcp_server\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # or `venv\\Scripts\\activate` on Windows\n# Install development dependencies\npip install -r requirements-dev.txt\n# Run tests\npytest\n```\n\n## Security Considerations\n- Never commit environment variables or credentials\n- Use a database user with minimal required permissions\n- Consider implementing query whitelisting for production use\n- Monitor and log all database operations\n\n## Security Best Practices\nThis MCP implementation requires database access to function. For security:\n1. **Create a dedicated MySQL user** with minimal permissions\n2. **Never use root credentials** or administrative accounts\n3. **Restrict database access** to only necessary operations\n4. **Enable logging** for audit purposes\n5. **Regular security reviews** of database access\n\nSee [MySQL Security Configuration Guide](https://github.com/designcomputer/mysql_mcp_server/blob/main/SECURITY.md) for detailed instructions on:\n- Creating a restricted MySQL user\n- Setting appropriate permissions\n- Monitoring database access\n- Security best practices\n\n⚠️ IMPORTANT: Always follow the principle of least privilege when configuring database access.\n\n## License\nMIT License - see LICENSE file for details.\n\n## Contributing\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n","funding_links":[],"categories":["👥 Community Contributions","Databases","Database \u0026 Messaging MCP Servers","サーバー実装","MCP 服务器精选列表","📚 Projects (1974 total)","Community Servers","Legend","🗄️ Database","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","MCP Servers","APIs and HTTP Requests","Containerised MCP Servers","Uncategorized","Table of Contents","Python","🗂️ Extensions by Category","Data \u0026 Analytics"],"sub_categories":["Database Integrations","SQL Databases","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eデータベース","🗄️ 数据库交互","MCP Servers","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","🗄️ Databases","💾 Databases","Database \u0026 Storage","Databases","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesigncomputer%2Fmysql_mcp_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdesigncomputer%2Fmysql_mcp_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesigncomputer%2Fmysql_mcp_server/lists"}