just-a-mysql-mcp

just-a-mysql-mcp

Read-only MySQL MCP server that lets AI agents list tables, describe schemas, and run SELECT/SHOW/EXPLAIN queries with a row cap, bound to a single database for safety.

Category
Visit Server

README

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.

Requirements

  • uv — brew 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured