just-a-mysql-mcp
This server provides a read-only interface for browsing MySQL database schemas and executing SQL queries, restricted to an allowlisted set of databases. It exposes three main functions:
list_tables: Returns the names of all tables in the bound database (no row data).describe_table: Returns column names and types for a specified table.mysql_query: Executes a single read-only SQL statement (SELECT,WITH…SELECT,SHOW,DESCRIBE/DESC, orEXPLAIN). Results are capped at 100 rows by default (configurable, maximum 1000), with truncation explicitly indicated.
Safety enforcement: all write operations (INSERT, UPDATE, DELETE, DDL) are rejected; only one statement per call is allowed; database access is limited to an allowlist, and a default database can be configured for unqualified requests. The server is designed to work with read-only MySQL user accounts.
Provides read-only access to a MySQL database, allowing to list tables, describe table schemas, and run read-only SQL queries (SELECT, SHOW, DESCRIBE, EXPLAIN) with a configurable row limit.
Click on "Install 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., "@just-a-mysql-mcpDescribe the users table"
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.
just-a-mysql-mcp
Browse MySQL schema and run read-only SQL from your AI agent.
Read-only by design. Tools never INSERT / UPDATE / DELETE / DDL. An agent writing to the wrong table or environment can cause production-level incidents. Just because we can doesn't mean we should. Prefer a MySQL account that is itself read-only.
What it does
Database scope — Allowlist + Default Database for this process
List tables — names in one Allowlisted Database
Describe a table — columns and types (explicit Database + table)
Run a query — one read-only statement (
SELECT/WITH…SELECT,SHOW,DESCRIBE/DESC,EXPLAIN), with a hard row cap; visited Databases must be on the Allowlist
One MCP process is bound to an Allowlist of Databases (MYSQL_DATABASE: one name or a comma-separated list). Size one is strict single-Database; size many permits exactly those names.
Related MCP server: mcp-multi-db
Requirements
uv —
brew install uvMySQL 5.7+ / 8.x reachable over TCP
Setup
1. Clone and install
git clone https://github.com/xingyuli/just-a-mysql-mcp
cd just-a-mysql-mcp
uv sync2. Add to your AI agent
Single Database:
{
"mcpServers": {
"mysql": {
"command": "uv",
"args": [
"--directory", "/path/to/just-a-mysql-mcp",
"run", "mysql_mcp_server.py"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "readonly_user",
"MYSQL_PASSWORD": "secret",
"MYSQL_DATABASE": "your_database"
}
}
}
}Multiple Databases (stable Allowlist order; optional default override):
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "readonly_user",
"MYSQL_PASSWORD": "secret",
"MYSQL_DATABASE": "app_dev,billing_dev",
"MYSQL_DEFAULT_DATABASE": "billing_dev"
}Shell exports work too:
"MYSQL_HOST": "${MYSQL_DEV_HOST}",
"MYSQL_USER": "${MYSQL_DEV_USER}",
"MYSQL_PASSWORD": "${MYSQL_DEV_PASSWORD}",
"MYSQL_DATABASE": "app_dev"3. Restart the agent and ask things like:
"What databases are in scope?"
"List tables in app_dev"
"Describe users in app_dev"
"Select the 10 most recent rows from …"
Configuration
Variable | Required | Default | Notes |
| No |
| |
| No |
| |
| Yes | ||
| Yes | No short alias | |
| Yes | One name or comma-separated Allowlist | |
| No | First name in | Must be on the Allowlist |
Safety summary
Rule | Behavior |
Writes | Rejected by the MCP; use a read-only DB user too |
Statements | Exactly one per |
Statement types |
|
Database scope | sqlglot visit check ⊆ Allowlist; unqualified → Default Database; |
Row cap | Default 100, max 1000; truncation is explicit |
Design notes: CONTEXT.md, docs/adr/0001-v1-design.md, docs/adr/0002-database-allowlist.md.
For local development and tests, see DEVELOPMENT.md.
Maintenance
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
- AlicenseAqualityCmaintenanceRead-only MySQL/MariaDB MCP server for running SELECT queries safely, with automatic read-only enforcement and query limits.34MIT
- AlicenseAqualityAmaintenanceRead-only MCP server for querying PostgreSQL, MySQL, and SQLite from AI agents — multi-database, safe by default.4181ISC
- Alicense-qualityDmaintenanceA read-only MCP server that enables Claude Code to access MySQL databases, allowing safe querying with SELECT, SHOW, DESCRIBE, and EXPLAIN.29MIT
- Alicense-qualityDmaintenanceA robust MCP server for interacting with MySQL databases through AI agents, providing tools for schema analysis, query execution, and dynamic connection management with read-only security.56MIT
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Read-only MCP server for Muovi, Argentina's trust-first local services marketplace (6 tools).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/xingyuli/just-a-mysql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server