Skip to main content
Glama
YaangHailong

Local MySQL Read-only MCP Server

by YaangHailong

Local MySQL Read-only MCP Server

This project provides a small stdio MCP server for reading local MySQL data. It is designed to run with:

D:\anaconda\envs\torch\python.exe

The server implements a minimal MCP JSON-RPC stdio layer directly because the official Python MCP SDK requires a newer Python than the current torch environment.

Install Dependency

Recommended:

conda install -n torch -c conda-forge pymysql

Fallback:

D:\anaconda\envs\torch\python.exe -m pip install PyMySQL -i https://pypi.tuna.tsinghua.edu.cn/simple

If both commands fail because of local SSL or proxy settings, install PyMySQL manually into the torch conda environment and then run the tests below.

Related MCP server: MySQL MCP Server

Configure MySQL

Copy the example file and fill in local credentials:

Copy-Item mysql_mcp_config.example.json mysql_mcp_config.json

mysql_mcp_config.json is ignored by git. You can also point to another config file with:

$env:MYSQL_MCP_CONFIG = "D:\path\to\mysql_mcp_config.json"

Use a MySQL user with read-only permissions whenever possible. The MCP server only exposes read tools, but database permissions should still enforce the same rule.

MCP Client Configuration

Example stdio configuration:

{
  "mcpServers": {
    "local-mysql-readonly": {
      "command": "D:\\anaconda\\envs\\torch\\python.exe",
      "args": ["D:\\桌面\\aienglish\\server.py"],
      "env": {
        "MYSQL_MCP_CONFIG": "D:\\桌面\\aienglish\\mysql_mcp_config.json"
      }
    }
  }
}

Tools

  • list_databases: list visible databases, excluding system schemas by default.

  • list_tables: list tables and views in one database.

  • describe_table: return column and index metadata.

  • read_rows: read rows using structured filters, ordering, limit, and offset.

read_rows does not accept raw SQL. Database, table, and column names are validated against MySQL metadata, and values are sent as query parameters.

Allowed filter operators:

=, !=, <, <=, >, >=, LIKE, IN, IS NULL, IS NOT NULL

Test

D:\anaconda\envs\torch\python.exe -m unittest

After mysql_mcp_config.json is configured and PyMySQL is installed, validate manually with your MCP client by calling:

  1. list_databases

  2. list_tables

  3. describe_table

  4. read_rows with limit set to 5

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables MySQL database operations through MCP, including executing SQL queries, listing databases and tables, and describing table structures.
    519
    5
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables safe querying and optional writing to MySQL databases via MCP tools, with support for schema inspection, connection management, and read-only mode.
    37
    3
    MIT
  • F
    license
    A
    quality
    C
    maintenance
    Provides read-only access to a local MySQL database, enabling SQL queries, database and table listings, and table schema descriptions.
    4
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides read-only access to MySQL databases, enabling schema exploration, table inspection, and safe SELECT query execution via MCP.
    1

View all related MCP servers

Related MCP Connectors

  • Read-only MCP server for ClassQuill, a tutoring-business-management platform.

  • UN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.

  • Read-only MCP server for Muovi, Argentina's trust-first local services marketplace (6 tools).

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/YaangHailong/MCP-stdio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server