Local MySQL Read-only MCP Server
Provides read-only tools for interacting with a MySQL database: listing databases, listing tables, describing table columns and indexes, and reading rows with structured filters, ordering, limit, and offset.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Local MySQL Read-only MCP Serverlist tables in the 'employees' database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.exeThe 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 pymysqlFallback:
D:\anaconda\envs\torch\python.exe -m pip install PyMySQL -i https://pypi.tuna.tsinghua.edu.cn/simpleIf 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.jsonmysql_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 NULLTest
D:\anaconda\envs\torch\python.exe -m unittestAfter mysql_mcp_config.json is configured and PyMySQL is installed, validate
manually with your MCP client by calling:
list_databaseslist_tablesdescribe_tableread_rowswithlimitset to5
This server cannot be deployed
Maintenance
Related MCP Connectors
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MySQL database operations through MCP, including executing SQL queries, listing databases and tables, and describing table structures.317 npm5MIT
- AlicenseNot gradedqualityCmaintenanceEnables safe querying and optional writing to MySQL databases via MCP tools, with support for schema inspection, connection management, and read-only mode.16 npm3MIT
- FlicenseAqualityDmaintenanceProvides read-only access to a local MySQL database, enabling SQL queries, database and table listings, and table schema descriptions.4-
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to MySQL databases, enabling schema exploration, table inspection, and safe SELECT query execution via MCP.1-