{"id":50836404,"url":"https://github.com/achmadya-dev/mcp-mysql-query","last_synced_at":"2026-06-14T04:00:16.936Z","repository":{"id":359257071,"uuid":"1245218593","full_name":"achmadya-dev/mcp-mysql-query","owner":"achmadya-dev","description":"Model Context Protocol (MCP) server for MySQL to run SQL queries via stdio","archived":false,"fork":false,"pushed_at":"2026-06-14T02:45:51.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T03:07:27.785Z","etag":null,"topics":["cursor","database","mcp","model-context-protocol","mysql","typescript"],"latest_commit_sha":null,"homepage":"","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/achmadya-dev.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-21T02:52:35.000Z","updated_at":"2026-06-14T02:45:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/achmadya-dev/mcp-mysql-query","commit_stats":null,"previous_names":["achmadya-dev/mcp-mysql-typescript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/achmadya-dev/mcp-mysql-query","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mysql-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mysql-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mysql-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mysql-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/achmadya-dev","download_url":"https://codeload.github.com/achmadya-dev/mcp-mysql-query/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achmadya-dev%2Fmcp-mysql-query/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34308622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cursor","database","mcp","model-context-protocol","mysql","typescript"],"created_at":"2026-06-14T04:00:15.250Z","updated_at":"2026-06-14T04:00:16.903Z","avatar_url":"https://github.com/achmadya-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @achmadya-dev/mcp-mysql-query\n\nMCP server for MySQL. Runs a single SQL statement per tool call over **stdio**. **Read-only by default** — writes and DDL require explicit env flags.\n\n## Requirements\n\n- Node.js **≥ 20**\n- A reachable MySQL server (local, Docker, or remote)\n\n## Install from npm\n\nAdd to Cursor **Settings → MCP** or `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@achmadya-dev/mcp-mysql-query\"],\n      \"env\": {\n        \"MYSQL_HOST\": \"localhost\",\n        \"MYSQL_PORT\": \"3306\",\n        \"MYSQL_USER\": \"your_user\",\n        \"MYSQL_PASSWORD\": \"your_password\",\n        \"MYSQL_DATABASE\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\nOr load credentials from a file (Cursor `envFile`):\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@achmadya-dev/mcp-mysql-query\"],\n      \"envFile\": \"/absolute/path/to/.env\"\n    }\n  }\n}\n```\n\n## Develop from source\n\n```bash\ngit clone https://github.com/achmadya-dev/mcp-mysql-query.git\ncd mcp-mysql-query\npnpm install\npnpm run build\npnpm test\n```\n\nOpen the repo root in Cursor. You need a reachable MySQL instance — set connection env in `.cursor/mcp.json` or via `envFile`:\n\n```json\n{\n  \"mcpServers\": {\n    \"mysql\": {\n      \"command\": \"node\",\n      \"args\": [\"${workspaceFolder}/dist/index.js\"],\n      \"env\": {\n        \"MYSQL_HOST\": \"localhost\",\n        \"MYSQL_PORT\": \"3306\",\n        \"MYSQL_USER\": \"your_user\",\n        \"MYSQL_PASSWORD\": \"your_password\",\n        \"MYSQL_DATABASE\": \"your_database\"\n      }\n    }\n  }\n}\n```\n\n## Environment variables\n\n### Connection\n\n| Variable         | Default      | Description                     |\n| ---------------- | ------------ | ------------------------------- |\n| `MYSQL_HOST`     | `localhost`  | MySQL host                      |\n| `MYSQL_PORT`     | `3306`       | Port                            |\n| `MYSQL_USER`     | _(empty)_    | Username                        |\n| `MYSQL_PASSWORD` | _(empty)_    | Password                        |\n| `MYSQL_DATABASE` | _(optional)_ | Database selected after connect |\n| `MYSQL_MAX_ROWS` | `500`        | Max rows returned for `SELECT`  |\n\n### Write access\n\nEnabled when the value is `true`, `1`, `yes`, or `on` (case-insensitive). If unset, that operation type is **rejected**.\n\n| Variable                 | Allows                             |\n| ------------------------ | ---------------------------------- |\n| `ALLOW_INSERT_OPERATION` | `INSERT`, `REPLACE`                |\n| `ALLOW_UPDATE_OPERATION` | `UPDATE`                           |\n| `ALLOW_DELETE_OPERATION` | `DELETE`                           |\n| `ALLOW_DDL_OPERATION`    | DDL (`CREATE`, `ALTER`, `DROP`, …) |\n\n## Tools\n\n| Tool           | Statements                                      | Env flag                 |\n| -------------- | ----------------------------------------------- | ------------------------ |\n| `mysql_select` | `SELECT`, `SHOW`, `DESCRIBE`, `EXPLAIN`, `DESC` | always on                |\n| `mysql_insert` | `INSERT`, `REPLACE`                             | `ALLOW_INSERT_OPERATION` |\n| `mysql_update` | `UPDATE`                                        | `ALLOW_UPDATE_OPERATION` |\n| `mysql_delete` | `DELETE`                                        | `ALLOW_DELETE_OPERATION` |\n| `mysql_ddl`    | DDL                                             | `ALLOW_DDL_OPERATION`    |\n\nEach tool accepts one `sql` string. Results are JSON text; `SELECT` output is capped by `MYSQL_MAX_ROWS`.\n\n## Behavior and security\n\n- One SQL statement per request (no `;`-separated batches).\n- Dangerous patterns are blocked regardless of flags.\n- Read operations are always permitted.\n\n## Package scripts\n\n```bash\npnpm run build\npnpm test\npnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachmadya-dev%2Fmcp-mysql-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fachmadya-dev%2Fmcp-mysql-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachmadya-dev%2Fmcp-mysql-query/lists"}