mysql-server MCP Server logo

mysql-server MCP Server

by xianzong85

This is a TypeScript-based MCP server that provides tools for querying MySQL databases. It demonstrates core MCP concepts by providing tools for executing SQL queries and connecting to MySQL databases via environment variables.

View on GitHub

Last updated: N/A

What is mysql-server MCP Server?

A Model Context Protocol (MCP) server for accessing MySQL databases. It allows executing SQL queries against a MySQL database using the MCP protocol.

How to use mysql-server MCP Server?

  1. Install dependencies using npm install. 2. Build the server using npm run build. 3. Configure the server by setting the environment variables (MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE). 4. Add the server configuration to Claude Desktop's config file (claude_desktop_config.json). 5. Use the query tool to execute SQL queries.

Key features of mysql-server MCP Server

  • Execute SQL queries

  • Connect to MySQL databases via environment variables

  • TypeScript-based implementation

  • MCP protocol support

Use cases of mysql-server MCP Server

  • Querying data from MySQL databases

  • Integrating MySQL databases with applications that support MCP

  • Building custom database access tools

  • Automating database tasks

FAQ from mysql-server MCP Server

What is MCP?

Model Context Protocol is a protocol for communication between applications.

What environment variables are required?

MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE are required.

How do I debug the server?

Use the MCP Inspector by running npm run inspector.

Where is the Claude Desktop config file located?

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows: %APPDATA%/Claude/claude_desktop_config.json

What tool is available?

The query tool is available to execute SQL queries.