Go Mysql MCP Server

A Model Context Protocol (MCP) server that provides AI agents with direct access to MySQL databases. This server enables AI models to query, search

Local serverstdioGo

What is the Go Mysql MCP server?

If you want an AI assistant working directly with Go Mysql, the go mysql mcp server is the bridge. A Model Context Protocol (MCP) server that provides AI agents with direct access to MySQL databases. This server enables AI models to query, search, and analyze MySQL database content through a set of well-defined tools.

What Go Mysql does

A Model Context Protocol (MCP) server that provides AI agents with direct access to MySQL databases. This server enables AI models to query, search, and analyze MySQL database content through a set of well-defined tools.

Key capabilities

  • Schema exploration — - List all schemas/databases with pagination
  • Table discovery — - Browse tables in any schema with detailed metadata
  • Structure inspection — - Get column definitions, types, and indexes
  • Safe querying — - Execute SELECT queries with automatic result limiting
  • Full-text search — - Search for values across all text columns in a table
  • DDL retrieval — - Get CREATE TABLE statements for any table

Tools it exposes

Once connected, the assistant can call these 7 tools directly:

  • Prerequisites — The Prerequisites tool exposed by this server
  • list_schemas — Parameters: - page (optional): Page number for pagination (default: 1) - page_size (optional): Number of items per page (default: 20, max: 100)
  • list_tables — Parameters: - schema (required): The schema/database name - page (optional): Page number for pagination - page_size (optional): Number of items per page
  • get_table_structure — Parameters: - schema (required): The schema/database name - table (required): The table name
  • get_table_create — Parameters: - schema (required): The schema/database name - table (required): The table name
  • execute_query — Parameters: - query (required): The SQL query to execute - limit (optional): Maximum rows to return (default: 100)
  • search_table — Parameters: - schema (required): The schema/database name - table (required): The table name - search_term (required): The term to search for - limit

Installing the go mysql mcp server

Setup follows the standard MCP pattern: clone or install the server, then register it in your client's configuration file and restart the client. The configuration snippets on this page cover Claude Desktop, Claude Code and Cursor.

Configuration

The server reads 5 environment variables: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE. Keep credentials in your client's env block or a secrets manager rather than committing them.

Requirements

  • Go 1.23 or later - Docker (optional, for building Docker images)

Where it fits

Database servers turn schema archaeology and ad-hoc reporting into conversation, which is why they tend to be the second or third server people install. Go Mysql sits in that group, and the shape of its toolset — Prerequisites, list_schemas, list_tables among others — tells you what it is really for. Worth comparing against the other databases servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • With 7 tools exposed, expect a noticeable bump in prompt size — disable it in projects that never use Go Mysql.
  • Maintained by SagenKoder, written in Go.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the go mysql mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
PrerequisitesThe Prerequisites tool exposed by this server.
list_schemasParameters: - page (optional): Page number for pagination (default: 1) - page_size (optional): Number of items per page (default: 20, max: 100)
list_tablesParameters: - schema (required): The schema/database name - page (optional): Page number for pagination - page_size (optional): Number of items per page
get_table_structureParameters: - schema (required): The schema/database name - table (required): The table name
get_table_createParameters: - schema (required): The schema/database name - table (required): The table name
execute_queryParameters: - query (required): The SQL query to execute - limit (optional): Maximum rows to return (default: 100)
search_tableParameters: - schema (required): The schema/database name - table (required): The table name - search_term (required): The term to search for - limit (optional): Maximum rows to return (default: 100)

Configuration

  • Go 1.23 or later - Docker (optional, for building Docker images)
VariableDescriptionRequired
MYSQL_HOSTEndpoint or connection string the server talks to.Optional
MYSQL_PORTConfiguration value read at startup.Optional
MYSQL_USERConfiguration value read at startup.Optional
MYSQL_PASSWORDConfiguration value read at startup.Optional
MYSQL_DATABASEConfiguration value read at startup.Optional

Example prompts to try

  • Use Go Mysql to Prerequisites.
  • Use Go Mysql to list schemas.
  • Use Go Mysql to list tables.

Frequently asked questions

It connects Go Mysql to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (Prerequisites, list_schemas, list_tables, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Go Mysql directly.