MCP.so
ログイン

mysqldb-mcp-server MCP server

@burakdirin

基本情報

カテゴリ

その他

ライセンス

MIT license

トランスポート

stdio

作者

burakdirin

mysqldb-mcp-server MCP server について

An MCP server implementation that enables Claude AI to interact with MySQL databases.

mysqldb-mcp-server MCP server の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "mysqldb-mcp-server": {
      "command": "uv",
      "args": [
        "pip",
        "install",
        "mysqldb-mcp-server"
      ]
    }
  }
}

mysqldb-mcp-server MCP server のツール

2

Connects to a specific MySQL database

Executes MySQL queries

概要

What is mysqldb-mcp-server?

mysqldb-mcp-server is a Model Context Protocol (MCP) server that provides tools to connect to and query MySQL databases. It is designed for AI assistants, like Claude, that need to interact directly with MySQL databases through natural language or structured commands.

How to use mysqldb-mcp-server?

Install the package using pip install mysqldb-mcp-server or uv pip install mysqldb-mcp-server. Configure it with environment variables for MySQL connection (host, user, password, optional database, read-only mode). Then add it to your MCP client (e.g., Claude Desktop) by editing the client’s configuration file and specifying the command and environment variables. You can also install it automatically via Smithery.

Key features of mysqldb-mcp-server

  • Connects to a MySQL database using the connect_database tool.
  • Executes SQL queries with the execute_query tool.
  • Supports multiple semicolon-separated queries in one call.
  • Offers an optional read-only mode to prevent data modification.
  • Configurable via environment variables for host, user, and password.

Use cases of mysqldb-mcp-server

  • Let an AI assistant query a MySQL database to answer user questions.
  • Execute administrative SQL statements (e.g., SELECT, INSERT) from a chat interface.
  • Interact with a development or testing database in read-only mode to avoid accidental writes.

よくある質問

1

What environment variables are required?

`MYSQL_HOST` (default “localhost”), `MYSQL_USER` (default “root”), and `MYSQL_PASSWORD` (default empty). `MYSQL_DATABASE` is optional, and `MYSQL_READONLY` disables write queries when set to “1” or “true”.

2

What tools does mysqldb-mcp-server provide?

It provides two tools: `connect_database` (takes a `database` string) and `execute_query` (takes a `query` string). Both return results in JSON format.

3

How do I install mysqldb-mcp-server?

You can install it via pip (`pip install mysqldb-mcp-server`) or uv (`uv pip install mysqldb-mcp-server`). For use with Claude Desktop, add a configuration entry pointing to the installed package via `uvx`.

4

Can I execute multiple queries in one call?

Yes. The `execute_query` tool accepts multiple SQL statements separated by semicolons and returns results for all queries.

5

How do I enable read-only mode?

Set the environment variable `MYSQL_READONLY` to “1” or “true”. When enabled, the server will refuse any queries that attempt to modify data.

コメント

「その他」の他のコンテンツ