{"id":26570832,"url":"https://github.com/f4ww4z/mcp-mysql-server","last_synced_at":"2025-07-20T00:34:19.276Z","repository":{"id":267931903,"uuid":"902797828","full_name":"f4ww4z/mcp-mysql-server","owner":"f4ww4z","description":"A Model Context Protocol server for MySQL database operations","archived":false,"fork":false,"pushed_at":"2025-05-03T02:58:09.000Z","size":49,"stargazers_count":86,"open_issues_count":8,"forks_count":18,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T05:55:33.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/f4ww4z.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-13T09:39:28.000Z","updated_at":"2025-07-01T17:54:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"c11ec7aa-296b-4093-b803-a52e186dad79","html_url":"https://github.com/f4ww4z/mcp-mysql-server","commit_stats":null,"previous_names":["f4ww4z/server-mysql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/f4ww4z/mcp-mysql-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4ww4z%2Fmcp-mysql-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4ww4z%2Fmcp-mysql-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4ww4z%2Fmcp-mysql-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4ww4z%2Fmcp-mysql-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f4ww4z","download_url":"https://codeload.github.com/f4ww4z/mcp-mysql-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f4ww4z%2Fmcp-mysql-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048706,"owners_count":23868744,"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":[],"created_at":"2025-03-22T22:19:17.051Z","updated_at":"2025-07-20T00:34:19.256Z","avatar_url":"https://github.com/f4ww4z.png","language":"JavaScript","funding_links":[],"categories":["Databases","Database \u0026 Messaging MCP Servers","📚 Projects (1974 total)","MCP 服务器精选列表","Legend","پیاده‌سازی‌های سرور","MCP Servers","Cloud Services","Uncategorized","🌐 Web Development","Table of Contents","Server Implementations"],"sub_categories":["SQL Databases","MCP Servers","🗄️ 数据库交互","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eپایگاه‌های داده","🗄️ Databases","How to Submit","Uncategorized","Databases"],"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\u003ca href=\"https://glama.ai/mcp/servers/qma33al6ie\"\u003e\u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/qma33al6ie/badge\" alt=\"mcp-mysql-server MCP server\" /\u003e\u003c/a\u003e\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\u003e recommended use\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@f4ww4z/mcp-mysql-server\", \"mysql://user:password@localhost:port/database\"],\n    }\n  }\n}\n```\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\n\n## Running evals\n\nThe evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found [here](https://www.mcpevals.io/docs).\n\n```bash\nOPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff4ww4z%2Fmcp-mysql-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff4ww4z%2Fmcp-mysql-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff4ww4z%2Fmcp-mysql-server/lists"}