{"id":29113768,"url":"https://github.com/devakone/mysql-query-mcp-server","last_synced_at":"2026-02-16T01:53:26.021Z","repository":{"id":287406797,"uuid":"964627826","full_name":"devakone/mysql-query-mcp-server","owner":"devakone","description":"MySQL Query MCP server for AI assistants - execute read-only MySQL queries","archived":false,"fork":false,"pushed_at":"2025-05-31T14:33:26.000Z","size":215,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T01:08:54.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/devakone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-04-11T14:17:03.000Z","updated_at":"2025-05-31T14:33:29.000Z","dependencies_parsed_at":"2025-04-11T15:47:21.202Z","dependency_job_id":null,"html_url":"https://github.com/devakone/mysql-query-mcp-server","commit_stats":null,"previous_names":["devakone/mysql-query-mcp-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devakone/mysql-query-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devakone%2Fmysql-query-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devakone%2Fmysql-query-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devakone%2Fmysql-query-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devakone%2Fmysql-query-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devakone","download_url":"https://codeload.github.com/devakone/mysql-query-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devakone%2Fmysql-query-mcp-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262581381,"owners_count":23331913,"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-06-29T11:05:48.764Z","updated_at":"2026-02-16T01:53:25.995Z","avatar_url":"https://github.com/devakone.png","language":"TypeScript","funding_links":[],"categories":["Databases","🌐 Web Development"],"sub_categories":["How to Submit"],"readme":"# MySQL Query MCP Server\n\n[![npm version](https://img.shields.io/npm/v/mysql-query-mcp-server.svg)](https://www.npmjs.com/package/mysql-query-mcp-server)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Model Context Protocol (MCP) server that provides **read-only** MySQL database queries for AI assistants. Execute queries, explore database structures, and investigate your data directly from your AI-powered tools.\n\n\u003ca href=\"https://glama.ai/mcp/servers/@devakone/mysql-query-mcp-server\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@devakone/mysql-query-mcp-server/badge\" alt=\"MySQL Query Server MCP server\" /\u003e\n\u003c/a\u003e\n\n## Supported AI Tools\n\nThis MCP server works with any tool that supports the Model Context Protocol, including:\n\n- **Cursor IDE**: Set up in `.cursor/mcp.json`\n- **Anthropic Claude**: Use with a compatible MCP client\n- **Other MCP-compatible AI assistants**: Follow the tool's MCP configuration instructions\n\n## Features \u0026 Limitations\n\n### What It Does\n- ✅ Execute **read-only** MySQL queries (SELECT, SHOW, DESCRIBE only)\n- ✅ Work with predefined environments (local, development, staging, production)\n- ✅ Provide database information and metadata\n- ✅ List available database environments\n- ✅ Support SSL connections for secure database access\n- ✅ Implement query timeouts to prevent long-running operations\n\n### What It Doesn't Do\n- ❌ Execute write operations (INSERT, UPDATE, DELETE, CREATE, ALTER, etc.)\n- ❌ Support custom environment names (limited to local, development, staging, production)\n- ❌ Provide database design or schema generation capabilities\n- ❌ Function as a full database management tool\n\nThis tool is designed specifically for **data investigation and exploration** through read-only queries. It is not intended for database administration, schema management, or data modification.\n\n![MySQL Query MCP Demo](https://github.com/devakone/mysql-query-mcp-server/raw/main/docs/demo.gif)\n\n## Quick Install\n\n```bash\n# Install globally with npm\nnpm install -g mysql-query-mcp-server\n\n# Or run directly with npx\nnpx mysql-query-mcp-server\n```\n\n## Setup Instructions\n\n### Configure Your AI Tool to Use the MCP Server\n\nCreate or edit your MCP configuration file (e.g., `.cursor/mcp.json` for Cursor IDE):\n\n**Basic Configuration:**\n```json\n{\n  \"mysql\": {\n    \"name\": \"MySQL Query MCP\",\n    \"description\": \"MySQL read-only query access through MCP\",\n    \"type\": \"bin\", \n    \"enabled\": true,\n    \"bin\": \"mysql-query-mcp\"\n  }\n}\n```\n\n**Comprehensive Configuration with Database Credentials:**\n```json\n{\n  \"mysql\": {\n    \"command\": \"npx\",\n    \"args\": [\"mysql-query-mcp-server@latest\"],\n    \"env\": {\n      \"LOCAL_DB_HOST\": \"localhost\",\n      \"LOCAL_DB_USER\": \"root\",\n      \"LOCAL_DB_PASS\": \"\u003cYOUR_LOCAL_DB_PASSWORD\u003e\",\n      \"LOCAL_DB_NAME\": \"your_database\",\n      \"LOCAL_DB_PORT\": \"3306\",\n      \n      \"DEVELOPMENT_DB_HOST\": \"dev.example.com\",\n      \"DEVELOPMENT_DB_USER\": \"\u003cDEV_USER\u003e\",\n      \"DEVELOPMENT_DB_PASS\": \"\u003cDEV_PASSWORD\u003e\",\n      \"DEVELOPMENT_DB_NAME\": \"your_database\",\n      \"DEVELOPMENT_DB_PORT\": \"3306\",\n      \n      \"STAGING_DB_HOST\": \"staging.example.com\",\n      \"STAGING_DB_USER\": \"\u003cSTAGING_USER\u003e\",\n      \"STAGING_DB_PASS\": \"\u003cSTAGING_PASSWORD\u003e\",\n      \"STAGING_DB_NAME\": \"your_database\",\n      \"STAGING_DB_PORT\": \"3306\",\n      \n      \"PRODUCTION_DB_HOST\": \"prod.example.com\",\n      \"PRODUCTION_DB_USER\": \"\u003cPRODUCTION_USER\u003e\",\n      \"PRODUCTION_DB_PASS\": \"\u003cPRODUCTION_PASSWORD\u003e\",\n      \"PRODUCTION_DB_NAME\": \"your_database\",\n      \"PRODUCTION_DB_PORT\": \"3306\",\n      \n      \"DEBUG\": \"false\",\n      \"MCP_MYSQL_SSL\": \"true\",\n      \"MCP_MYSQL_REJECT_UNAUTHORIZED\": \"false\"\n    }\n  }\n}\n```\n\n### Choosing the Right Configuration Approach\n\nThere are two ways to configure the MySQL MCP server:\n\n1. **Binary Configuration** (`type: \"bin\"`, `bin: \"mysql-query-mcp\"`)\n   - **When to use**: When you've installed the package globally (`npm install -g mysql-query-mcp-server`)\n   - **Pros**: Simpler configuration\n   - **Cons**: Requires global installation\n\n2. **Command Configuration** (`command: \"npx\"`, `args: [\"mysql-query-mcp-server@latest\"]`)\n   - **When to use**: When you want to use the latest version without installing it globally\n   - **Pros**: No global installation required, all configuration in one file\n   - **Cons**: More complex configuration\n\nChoose the approach that best fits your workflow. Both methods will work correctly with any AI assistant that supports MCP.\n\n### Important Configuration Notes\n\n- You must use the full environment names: LOCAL_, DEVELOPMENT_, STAGING_, PRODUCTION_\n- Abbreviations like DEV_ or PROD_ will not work\n- Global settings like DEBUG, MCP_MYSQL_SSL apply to all environments\n- At least one environment (typically \"local\") must be configured\n- You only need to configure the environments you plan to use\n- For security reasons, consider using environment variables or secure credential storage for production credentials\n\n## Configuration Options\n\n| Environment Variable | Description | Default |\n|---------------------|-------------|---------|\n| DEBUG | Enable debug logging | false |\n| [ENV]_DB_HOST | Database host for environment | - |\n| [ENV]_DB_USER | Database username | - |\n| [ENV]_DB_PASS | Database password | - |\n| [ENV]_DB_NAME | Database name | - |\n| [ENV]_DB_PORT | Database port | 3306 |\n| [ENV]_DB_SSL | Enable SSL connection | false |\n| MCP_MYSQL_SSL | Enable SSL for all connections | false |\n| MCP_MYSQL_REJECT_UNAUTHORIZED | Verify SSL certificates | true |\n\n## Integration with AI Assistants\n\nYour AI assistant can interact with MySQL databases through the MCP server. Here are some examples:\n\nExample queries:\n\n```\nCan you use the query tool to show me the first 10 users from the database? Use the local environment.\n```\n\n```\nI need to analyze our sales data. Can you run a SQL query to get the total sales per region for last month from the development database?\n```\n\n```\nCan you use the info tool to check what tables are available in the staging database?\n```\n\n```\nCan you list all the available database environments we have configured?\n```\n\n### Using MySQL MCP Tools\n\nThe MySQL Query MCP server provides three main tools that your AI assistant can use:\n\n#### 1. query\n\nExecute read-only SQL queries against a specific environment:\n\n```\nUse the query tool to run:\nSELECT * FROM customers WHERE signup_date \u003e '2023-01-01' LIMIT 10;\non the development environment\n```\n\n#### 2. info\n\nGet detailed information about your database:\n\n```\nUse the info tool to check the status of our production database.\n```\n\n#### 3. environments\n\nList all configured environments from your configuration:\n\n```\nUse the environments tool to show me which database environments are available.\n```\n\n## Available Tools\n\nThe MySQL Query MCP server provides three main tools:\n\n### 1. query\n\nExecute read-only SQL queries:\n\n```sql\n-- Example query to run with the query tool\nSELECT * FROM users LIMIT 10;\n```\n\n**Supported query types (strictly limited to)**:\n- SELECT statements \n- SHOW commands\n- DESCRIBE/DESC tables\n\n### 2. info\n\nGet detailed information about your database:\n\n- Server version\n- Connection status\n- Database variables\n- Process list\n- Available databases\n\n### 3. environments\n\nList all configured environments from your configuration:\n\n```\nUse the environments tool to show me which database environments are available.\n```\n\n## Security Considerations\n\n- ✅ Only read-only queries are allowed (SELECT, SHOW, DESCRIBE)\n- ✅ Each environment has its own isolated connection pool\n- ✅ SSL connections are supported for production environments\n- ✅ Query timeouts prevent runaway operations\n- ⚠️ Consider using secure credential management for database credentials\n\n## Troubleshooting\n\n### Connection Issues\n\nIf you're having trouble connecting:\n\n1. Verify your database credentials in your MCP configuration\n2. Ensure the MySQL server is running and accessible\n3. Check for firewall rules blocking connections\n4. Enable debug mode by setting DEBUG=true in your configuration\n\n### Common Errors\n\n**Error: No connection pool available for environment**\n- Make sure you've defined all required environment variables for that environment\n- Check that you're using one of the supported environment names (local, development, staging, production)\n\n**Error: Query execution failed**\n- Verify your SQL syntax\n- Check that you're only using supported query types (SELECT, SHOW, DESCRIBE)\n- Ensure your query is truly read-only\n\nFor more comprehensive troubleshooting, see the [Troubleshooting Guide](docs/TROUBLESHOOTING.md).\n\nFor examples of how to integrate with AI assistants, see the [Integration Examples](docs/INTEGRATION_EXAMPLE.md).\n\nFor implementation details about the MCP protocol, see the [MCP README](docs/MCP_README.md).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## CI/CD and Release Process\n\nThis project uses GitHub Actions for continuous integration and automated releases.\n\n### CI/CD Workflow\n\nThe CI/CD pipeline consists of:\n\n1. **Build and Test**: Runs on every push to `main` and `develop` branches, and on pull requests to these branches\n   - Tests the codebase with Node.js 16.x and 18.x\n   - Ensures the package builds correctly\n   - Validates all tests pass\n\n2. **Release**: Runs when changes are pushed to the `main` branch and the build/test job succeeds\n   - Uses `release-please` to manage version bumps and changelog updates\n   - Creates a release PR with version changes based on conventional commits\n   - Automatically publishes to npm when a release PR is merged\n\n### Release Process\n\nThe project follows [Semantic Versioning](https://semver.org/):\n- **Major version**: Breaking changes (non-backward compatible)\n- **Minor version**: New features (backward compatible)\n- **Patch version**: Bug fixes and minor improvements\n\nCommits should follow the [Conventional Commits](https://www.conventionalcommits.org/) format:\n- `feat: add new feature` - Minor version bump\n- `fix: resolve bug` - Patch version bump\n- `docs: update documentation` - No version bump\n- `chore: update dependencies` - No version bump\n- `BREAKING CHANGE: change API` - Major version bump\n\nWhen you push to `main`, `release-please` will analyze commits and automatically create or update a release PR with appropriate version bumps and changelog entries.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\n[Abou Koné](https://github.com/devakone) - Engineering Leader and CTO\n\n---\n\nFor more information or support, please [open an issue](https://github.com/devakone/mysql-query-mcp-server/issues) on the GitHub repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevakone%2Fmysql-query-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevakone%2Fmysql-query-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevakone%2Fmysql-query-mcp-server/lists"}