Skip to main content
Glama
xingyuli

just-a-mysql-mcp

by xingyuli

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

  • List tables — names in the bound database

  • Describe a table — columns and types

  • Run a query — one read-only statement (SELECT / WITH…SELECT, SHOW, DESCRIBE/DESC, EXPLAIN), with a hard row cap

One MCP process is bound to one database for its lifetime. Need another database? Add another MCP entry.

Related MCP server: mcp-multi-db

Requirements

  • uvbrew install uv

  • MySQL 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 sync

2. Add to your AI agent

{
  "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"
      }
    }
  }
}

Shell exports work too:

"MYSQL_HOST": "${MYSQL_QIMIOLAB_DEV_HOST}",
"MYSQL_USER": "${MYSQL_QIMIOLAB_DEV_USER}",
"MYSQL_PASSWORD": "${MYSQL_QIMIOLAB_DEV_PASSWORD}",
"MYSQL_DATABASE": "qimiolab_uc_dev"

3. Restart the agent and ask things like:

  • "What tables are in this database?"

  • "Describe the user table"

  • "Select the 10 most recent rows from …"

Configuration

Variable

Required

Default

Notes

MYSQL_HOST

No

127.0.0.1

MYSQL_PORT

No

3306

MYSQL_USER

Yes

MYSQL_PASSWORD

Yes

Alias: MYSQL_PASS

MYSQL_DATABASE

Yes

Alias: MYSQL_DB

Safety summary

Rule

Behavior

Writes

Rejected by the MCP; use a read-only DB user too

Statements

Exactly one per mysql_query call

Allowlist

SELECT, WITH, SHOW, DESCRIBE/DESC, EXPLAIN

Row cap

Default 100, max 1000; truncation is explicit

Design notes: CONTEXT.md, docs/adr/0001-v1-design.md.


For local development and tests, see DEVELOPMENT.md.

Install Server
A
license - permissive license
A
quality
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
    A
    quality
    A
    maintenance
    Read-only MCP server for querying PostgreSQL, MySQL, and SQLite from AI agents — multi-database, safe by default.
    Last updated
    4
    30
    1
    ISC
  • A
    license
    -
    quality
    D
    maintenance
    A read-only MCP server that enables Claude Code to access MySQL databases, allowing safe querying with SELECT, SHOW, DESCRIBE, and EXPLAIN.
    Last updated
    52
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A 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.
    Last updated
    61
    MIT

View all related MCP servers

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).

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/xingyuli/just-a-mysql-mcp'

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