How shivangbhatt10/mysql-automation-mcp-server works
This repository is a FastMCP server that exposes MySQL administration, schema exploration, guarded SQL execution, exports, and query-history tools to agent clients. The main workflow is an MCP request handled by the server, which applies safety checks where relevant and uses the connection pool to operate on MySQL; schema inspection and query auditing add supporting paths. README documents additional tools, resources, prompts, caching, and runtime reconfiguration. Some server sections were omitted, so edges for documented capabilities rely on the README rather than unsampled implementation details.
Main entry points: server.py MCP tools and resources · db.py Connection pool and transactions · config.py Runtime configuration · audit.py Query history
Components 10
MCP interface
- MCP tools and resources
src/mysql_mcp/server.py - SQL prompts
src/mysql_mcp/server.py
Query controls
- SQL safety rules
src/mysql_mcp/safety.py - Error diagnostics
src/mysql_mcp/errors.py
Configuration and history
- Runtime configuration
src/mysql_mcp/config.py - Query history
src/mysql_mcp/audit.py
MySQL access
- Schema introspection and cache
src/mysql_mcp/schema.py - Connection pool and transactions
src/mysql_mcp/db.py
Other components
- Agent client
- MySQL instance
Connections 13
- Agent client → MCP tools and resources: invokes tools
README.md - Agent client → SQL prompts: requests prompts
README.md - MCP tools and resources → SQL safety rules: validates queries
src/mysql_mcp/server.py - MCP tools and resources → Connection pool and transactions: executes queries
src/mysql_mcp/server.py - MCP tools and resources → Schema introspection and cache: requests schema
README.md - MCP tools and resources → Query history: records queries
src/mysql_mcp/server.py - MCP tools and resources → Runtime configuration: reconfigures settings
README.md - Connection pool and transactions → MySQL instance: queries and mutates
src/mysql_mcp/db.py - Schema introspection and cache → Connection pool and transactions: introspects database
src/mysql_mcp/schema.py - Query history → Runtime configuration: reads log settings
src/mysql_mcp/audit.py - Connection pool and transactions → Runtime configuration: loads connection settings
src/mysql_mcp/db.py - Connection pool and transactions → Error diagnostics: translates errors
src/mysql_mcp/db.py - MCP tools and resources → Error diagnostics: reports database errors
src/mysql_mcp/server.py