# go-mcp-mysql — MySQL MCP Server (Go Binary) > go-mcp-mysql is a Go-based MySQL MCP server you can install as one binary; supports DSN or flags and offers `--read-only` mode to reduce accidental writes. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash go install -v github.com/Zhwt/go-mcp-mysql@latest go-mcp-mysql --help # safer default for trials: go-mcp-mysql --read-only --dsn 'user:pass@tcp(localhost:3306)/mydb?parseTime=true&loc=Local' ``` ## Intro go-mcp-mysql is a Go-based MySQL MCP server you can install as one binary; supports DSN or flags and offers `--read-only` mode to reduce accidental writes. **Best for:** agents that need database introspection + safe querying in MySQL **Works with:** MySQL, MCP clients (Cursor/Claude Desktop), Go toolchain optional **Setup time:** 3-10 minutes ### Key facts (verified) - GitHub: 53 stars · 14 forks · pushed 2026-01-21. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-verified entrypoint: `go install -v github.com/Zhwt/go-mcp-mysql@latest`. ## Main - Prefer `--read-only` when you first wire this into an agent, then explicitly enable writes only after you trust the prompt and tool boundaries. - Use the DSN method when you already have standardized MySQL DSNs across environments; use flag mode for quick local testing. - Treat explain checks as a safety net: the README documents an `EXPLAIN`-based plan check and a flag to disable it when needed. ### Source-backed notes - README provides install options: download a release binary or run `go install -v github.com/Zhwt/go-mcp-mysql@latest`. - README shows MCP client config examples for both flag-based connection and DSN-based connection. - README documents optional flags including `--read-only` and `--with-explain-check` behavior notes. ### FAQ - **Do I need Node.js or Python?**: No — README explicitly says no Node.js/Python environment is required. - **Can I force read-only behavior?**: Yes — `--read-only` limits tools to safer operations per README. - **How do I configure credentials?**: Use either flags (`--host`, `--user`, `--pass`, etc.) or a MySQL DSN string as shown in README. ## Source & Thanks > Source: https://github.com/Zhwt/go-mcp-mysql > License: MIT > GitHub stars: 53 · forks: 14 --- ## Quick Use ```bash go install -v github.com/Zhwt/go-mcp-mysql@latest go-mcp-mysql --help # safer default for trials: go-mcp-mysql --read-only --dsn 'user:pass@tcp(localhost:3306)/mydb?parseTime=true&loc=Local' ``` ## Intro go-mcp-mysql 是 Go 写的 MySQL MCP server,可作为单一二进制安装;支持 DSN/参数两种配置,并提供 `--read-only` 与 explain 检查等选项降低误写风险。 **Best for:** 让 agent 安全读写/自检 MySQL 的场景(可控权限) **Works with:** MySQL;Cursor/Claude Desktop 等 MCP 客户端;可选 Go 环境 **Setup time:** 3-10 minutes ### Key facts (verified) - GitHub:53 stars · 14 forks;最近更新 2026-01-21。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中核对过的入口命令:`go install -v github.com/Zhwt/go-mcp-mysql@latest`。 ## Main - 第一次接入 agent 建议先开 `--read-only`,确认 prompt 与工具边界稳定后再考虑开启写操作。 - 已有统一 DSN 的环境优先用 DSN 配置;临时本地联调则用命令行参数更直观。 - 把 explain 检查当安全兜底:README 说明可在执行前用 `EXPLAIN` 做计划检查,并提供开关参数。 ### Source-backed notes - README 提供两种安装方式:下载 release 二进制或 `go install -v github.com/Zhwt/go-mcp-mysql@latest`。 - README 给出两套 MCP 客户端配置示例:参数模式与 DSN 模式。 - README 说明可选参数,包括 `--read-only` 与 explain 检查相关行为。 ### FAQ - **需要 Node.js 或 Python 吗?**:不需要。README 明确写了无需 Node.js/Python 环境。 - **能强制只读吗?**:可以。README 说明 `--read-only` 会限制可用工具,降低写入风险。 - **怎么配置连接信息?**:按 README 选择参数方式(`--host`/`--user`/`--pass` 等)或 DSN 字符串。 ## Source & Thanks > Source: https://github.com/Zhwt/go-mcp-mysql > License: MIT > GitHub stars: 53 · forks: 14 --- Source: https://tokrepo.com/en/workflows/go-mcp-mysql-mysql-mcp-server-go-binary Author: MCP Hub