# MySQL MCP Server — Secure MySQL Tools via MCP > mysql_mcp_server is an MCP server for MySQL with pip install and Smithery client setup; expose DB actions to Claude Code safely (1,251★). ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash pip install mysql-mcp-server npx -y @smithery/cli install mysql-mcp-server --client claude # or run from source: git clone https://github.com/designcomputer/mysql_mcp_server.git ``` ## Intro mysql_mcp_server is an MCP server for MySQL with pip install and Smithery client setup; expose DB actions to Claude Code safely (1,251★). **Best for:** Teams that want agents to query MySQL with a controlled MCP tool surface instead of pasting SQL into chats **Works with:** Python, pip, Smithery installer, and MCP clients (Claude Code) that can launch stdio servers **Setup time:** 10-20 minutes ## Main - **DB access via tools**: moves database operations into an explicit MCP tool interface. - **Two install paths**: pip package install and a Smithery one-liner to wire it into clients. - **Client-first setup**: designed to be launched by an MCP client, keeping credentials/config out of ad-hoc prompts. - **Good for audits**: tool-calling makes DB reads/writes more inspectable than free-form SQL in chats. ### FAQ - **Is Smithery required?**: No. It is one setup option; you can also clone and run from source. - **What is the safest first step?**: Start read-only queries and confirm credentials/config are loaded correctly. - **Why MCP instead of direct SQL prompts?**: Tool interfaces make capabilities explicit and easier to constrain. ## Source & Thanks > Source: https://github.com/designcomputer/mysql_mcp_server > License: MIT > GitHub stars: 1251 · forks: 236 --- ## Quick Use ```bash pip install mysql-mcp-server npx -y @smithery/cli install mysql-mcp-server --client claude # or run from source: git clone https://github.com/designcomputer/mysql_mcp_server.git ``` ## Intro mysql_mcp_server 是面向 MySQL 的 MCP server:支持 pip 安装与 Smithery 一键接入,把数据库操作暴露给 Claude Code 并可控使用(1,251★)。 **Best for:** 希望让 agent 通过 MCP “受控地”查询 MySQL,而不是在对话里随手粘 SQL 的团队 **Works with:** Python、pip、Smithery 安装器,以及可启动 stdio server 的 MCP 客户端(如 Claude Code) **Setup time:** 10-20 minutes ## Main - **用工具访问数据库**:把 DB 操作封装成 MCP 工具面,减少随意 SQL。 - **两条安装路线**:既支持 pip 安装,也支持 Smithery 一键把 server 接入客户端。 - **以客户端配置为中心**:让 MCP 客户端负责启动与配置,降低凭据散落在 prompt 里的风险。 - **更易审计**:相比自由文本 SQL,对工具调用的边界与行为更可检查。 ### FAQ - **必须用 Smithery 吗?**:不是。它只是便捷安装方式之一,也可以从源码运行。 - **最安全的第一步?**:先做只读查询,确认凭据与配置加载正确,再逐步扩展能力。 - **为什么用 MCP 而不是直接发 SQL?**:工具接口更显式,更便于限制能力与审计行为。 ## Source & Thanks > Source: https://github.com/designcomputer/mysql_mcp_server > License: MIT > GitHub stars: 1251 · forks: 236 --- Source: https://tokrepo.com/en/workflows/mysql-mcp-server-secure-mysql-tools-via-mcp Author: MCP Hub