go-mcp-mysql logo

go-mcp-mysql

Community
Zhwt

Zero burden, ready-to-use Model Context Protocol (MCP) server for interacting with MySQL and automation. No Node.js or Python environment needed.

PublisherZhwt
Repositorygo-mcp-mysql
LanguageGo
Forks
17
Stars
65
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    go-mcp-mysql exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    65 stars and 17 forks from the linked repository.

go-mcp-mysql

Trust Score

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.

  2. Or if you have Go installed, you can build it from source:

sh
go install -v github.com/Zhwt/go-mcp-mysql@latest

Usage

Method A: Using Command Line Arguments

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

Method B: Using DSN With Custom Options

json
{
  "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:

json
{
  "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.
  2. 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.
  3. create_table

    • Create a new table in the MySQL server.
    • Parameters:
      • query: The SQL query to create the table.
    • Returns: x rows affected.
  4. 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.
  5. 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.
  2. write_query

    • Execute a write SQL query.
    • Parameters:
      • query: The SQL query to execute.
    • Returns: x rows affected, last insert id: <last_insert_id>.
  3. update_query

    • Execute an update SQL query.
    • Parameters:
      • query: The SQL query to execute.
    • Returns: x rows affected.
  4. delete_query

    • Execute a delete SQL query.
    • Parameters:
      • query: The SQL query to execute.
    • Returns: x rows affected.

License

MIT

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "zhwt-go-mcp-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "go-mcp-mysql"
      ]
    }
  }
}

Use go-mcp-mysql MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once go-mcp-mysql is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add go-mcp-mysql as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the go-mcp-mysql MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "zhwt-go-mcp-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "go-mcp-mysql"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the go-mcp-mysql MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the go-mcp-mysql MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use go-mcp-mysql to help me with this task?
go-mcp-mysql
Sure. I read it.
Here is what I found using go-mcp-mysql.

Frequently asked questions

What is the go-mcp-mysql MCP server used for?

go-mcp-mysql is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use go-mcp-mysql MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use go-mcp-mysql with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use go-mcp-mysql MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With go-mcp-mysql connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect go-mcp-mysql MCP to TypingMind?

go-mcp-mysql runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does go-mcp-mysql MCP provide in TypingMind?

go-mcp-mysql exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use go-mcp-mysql MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If go-mcp-mysql requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇