Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Easy to use, zero dependency MySQL MCP server built with Golang with configurable readonly mode and schema inspection.

README.md

go-mcp-mysql

![Trust Score](https://archestra.ai/mcp-catalog/zhwt__go-mcp-mysql)

Overview

Zero burden, ready-to-use Model Context Protocol (MCP) server for interacting with MySQL and automation. No Node.js or Python environment needed. This server provides tools to do CRUD operations on MySQL databases and tables, and a read-only mode to prevent surprise write operations. You can also make the MCP server check the query plan by using a EXPLAIN statement before executing the query by adding a --with-explain-check flag.

Please note that this is a work in progress and may not yet be ready for production use.

Installation

  1. Get the latest release and put it in your $PATH or somewhere you can easily access.
  1. Or if you have Go installed, you can build it from source:
go install -v github.com/Zhwt/go-mcp-mysql@latest

Usage

Method A: Using Command Line Arguments

{
  "mcpServers": {
    "mysql": {
      "command": "go-mcp-mysql",
      "args": [
        "--host", "localhost",
        "--user", "root",
        "--pass", "password",
        "--port", "3306",
        "--db", "mydb"
      ]
    }
  }
}

Method B: Using DSN With Custom Options

{
  "mcpServers": {
    "mysql": {
      "command": "go-mcp-mysql",
      "args": [
        "--dsn", "username:password@tcp(localhost:3306)/mydb?parseTime=true&loc=Local"
      ]
    }
  }
}

Please refer to MySQL DSN for more details.

Note: For those who put the binary outside of your $PATH, you need to replace go-mcp-mysql with the full path to the binary: e.g.: if you put the binary in the Downloads folder, you may use the following path:

{
  "mcpServers": {
    "mysql": {
      "command": "C:\\Users\\<username>\\Downloads\\go-mcp-mysql.exe",
      "args": [
        ...
      ]
    }
  }
}

Optional Flags

  • Add a --read-only flag to enable read-only mode. In this mode, only tools beginning with list, read_ and desc_ are available. Make sure to refresh/restart the MCP server after adding this flag.
  • By default, CRUD queries will be first executed with a EXPLAIN ? statement to check whether the generated query plan matches the expected pattern. Add a --with-explain-check flag to disable this behavior.

Tools

Schema Tools

  1. list_database
  • List all databases in the MySQL server.
  • Parameters: None
  • Returns: A list of matching database names.
  1. list_table
  • List all tables in the MySQL server.
  • Parameters:
  • name: If provided, list tables with the specified name, same as SQL SHOW TABLES LIKE '%name%'. Otherwise, list all tables.
  • Returns: A list of matching table names.
  1. create_table
  • Create a new table in the MySQL server.
  • Parameters:
  • query: The SQL query to create the table.
  • Returns: x rows affected.
  1. alter_table
  • Alter an existing table in the MySQL server. The LLM is informed not to drop an existing table or column.
  • Parameters:
  • query: The SQL query to alter the table.
  • Returns: x rows affected.
  1. desc_table
  • Describe the structure of a table.
  • Parameters:
  • name: The name of the table to describe.
  • Returns: The structure of the table.

Data Tools

  1. read_query
  • Execute a read-only SQL query.
  • Parameters:
  • query: The SQL query to execute.
  • Returns: The result of the query.
  1. write_query
  • Execute a write SQL query.
  • Parameters:
  • query: The SQL query to execute.
  • Returns: x rows affected, last insert id: <last_insert_id>.
  1. update_query
  • Execute an update SQL query.
  • Parameters:
  • query: The SQL query to execute.
  • Returns: x rows affected.
  1. delete_query
  • Execute a delete SQL query.
  • Parameters:
  • query: The SQL query to execute.
  • Returns: x rows affected.

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Databases servers.