Skip to main content

An MCP server for MySQL databases using stdio

Project description

stdio-mysql-mcp

A Model Context Protocol (MCP) server that allows AI assistants like Claude Desktop and GitHub Copilot to connect to and query MySQL databases locally using standard input/output (stdio).

Usage with Claude Desktop / GitHub Copilot

Add this to your MCP configuration file (claude_desktop_config.json or your custom settings):

{
  "mcpServers": {
    "mysql-server": {
      "command": "uvx",
      "args": ["stdio-mysql-mcp"],
      "env": {
        "MYSQL_URL": "mysql://user:password@localhost:3306"
      }
    }
  }
}

Usage with GitHub Copilot

If you're using the GitHub Copilot local/desktop integration (or another Copilot-compatible MCP host) the config format may differ. Here's the example you supplied — it works and shows how to point Copilot to a local Python interpreter and run the MCP server module:

{
  "servers": {
    "my-mysql-server": {
      "command": "check/Scripts/python.exe",
      "args": [
        "-m",
        "stdio_mysql_mcp.server"
      ],
      "env": {
        "MYSQL_URL": "mysql://username:password@localhost:3306"
      }
    }
  }
}

Notes:

  • command should be the full path to the Python executable you want Copilot to use. In virtualenvs on Windows this often looks like path\to\venv\Scripts\python.exe; on macOS/Linux it might be path/to/venv/bin/python.
  • The -m stdio_mysql_mcp.server form runs the package's server module directly from the chosen Python interpreter.
  • Ensure the Python environment has the package (or the source) installed so the module resolves.

Available Tools

  • get_databases: List all databases
  • get_tables_in_db: List tables in a specific database
  • get_records: Get all rows from a table
  • get_specific_column_records: Get specific columns from a table
  • custom_sql_query: Run custom SQL queries

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stdio_mysql_mcp-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stdio_mysql_mcp-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file stdio_mysql_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: stdio_mysql_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for stdio_mysql_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c4669ed08d384785c5ce0db3b0f8e0952b0caedf01b41ad13160b13b9ac296f
MD5 a0115d8013766412a2bb055503fc0149
BLAKE2b-256 2e05a42a83eb0e4c8a99c957aa4c4cf4696a22f571c55ad7425d6f6ec4788156

See more details on using hashes here.

File details

Details for the file stdio_mysql_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stdio_mysql_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e9aa8c45c4c371ad7c34d3563869884ac0cb7e969b5c734a9cf382477733fe5
MD5 1a3ec71a809531ac64a7e9bad1e579bc
BLAKE2b-256 b860a12e1b5f9d4137bd540944f1f3f8734998684f1cd2ab0955e7fc0fee47e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page