MySQL MCP

MySQL MCP is an MCP server that provides Model Context Protocol clients with direct access to MySQL databases for schema exploration, documentation export, and query execution. Designed primarily for Cursor and adaptable to other MCP-compatible environments, the server allows developers and data analysts to inspect relational tables, examine column constraints, and test SQL statements directly through natural language prompts. It includes three distinct security modes: read-only mode to prevent unintended database mutations, limited write mode for insert and update tasks without destructive schema changes, and full access mode for comprehensive administrative workflows. In addition to data queries, MySQL MCP offers built-in documentation tools that extract table definitions and database-level summaries into Markdown, JSON, or SQL format saved directly into local project directories. The server also integrates query caching to accelerate repeated read operations and reduce unnecessary database load. Configurable environment variables control connection timeouts, row limits, allowed database schemas, and query logging.

Category: Databases & Data Stores

Tags: database, mysql, relational, SQL

Visit MySQL MCP

How to install and configure MySQL MCP

  1. Navigate to the project directory and install the dependencies: bash cd mysql-mcp pip install -r requirements.txt 2. Open your Cursor MCP settings configuration file and register mysql-mcp under mcpServers: json { "mcpServers": { "mysql-mcp": { "command": "python", "args": ["/path/to/mysql-mcp/main.py"], "env": { "MYSQL_HOST": "localhost", "MYSQL_PORT": "3306", "MYSQL_USERNAME": "your_username", "MYSQL_PASSWORD": "your_password", "MYSQL_DATABASE": "your_database", "MYSQL_SECURITY_MODE": "readonly", "MYSQL_ALLOWED_SCHEMAS": "*", "MYSQL_ENABLE_QUERY_LOG": "false" } } } } 3. Replace /path/to/mysql-mcp/main.py with your absolute local path and set your database connection credentials. 4. Restart Cursor to load the server and its database tools.

What you can do with MySQL MCP

  • Export comprehensive schema documentation for individual MySQL tables into local Markdown, JSON, or SQL files for technical documentation. - Inspect table columns, primary keys, and index constraints directly within Cursor using conversational schema discovery tools. - Execute read-only SQL queries to analyze data rows safely without risking accidental schema drops or table modifications. - Create full database overview reports summarizing all accessible schemas and tables across connected MySQL instances. - Perform controlled data updates and inserts using the limited write security mode during development testing workflows.

Key facts

  • https://github.com/Gcluowenqiang/Mysql-mcp
  • Databases & Data Stores
  • database, mysql, relational, SQL

Part of MCP Servers

Related MCP servers

  • MCP Memory Keeper — MCP Memory Keeper is an MCP server that provides persistent context management and memory storage for Claude AI coding assistants.…
  • MCP Notes — MCP Notes is an MCP server that provides note-taking and note-management capabilities to AI models using Amazon Web Services DynamoDB…
  • MCP Neo4j Server — MCP Neo4j Server is an MCP server that provides an integration between the Neo4j graph database and Model Context Protocol…
  • MCP Memory Toolkit — MCP Memory Toolkit is an MCP server that provides persistent memory capabilities for Claude and other compatible assistants using ChromaDB.…
  • MCP Memory Server — MCP Memory Server is an MCP server that integrates Claude Desktop with Azure Cosmos DB and OpenAI embeddings to provide…
  • MCP MS SQL Server — MCP MS SQL Server is an MCP server that provides a standardized Model Context Protocol interface for AI models to…

What is MySQL MCP?

MySQL MCP is a Model Context Protocol server that connects AI assistants like Cursor to MySQL databases. It enables assistants to discover schemas, inspect table structures, execute SQL statements within defined safety boundaries, and export documentation in formats such as Markdown, JSON, and raw SQL.

How do I install MySQL MCP?

To install MySQL MCP, clone the repository locally and run pip install -r requirements.txt. Then, configure your MCP client, such as Cursor, by adding the server configuration with python pointing to main.py and defining database environment variables like MYSQL_HOST, MYSQL_PORT, MYSQL_USERNAME, and MYSQL_PASSWORD.

Which security modes does MySQL MCP support?

MySQL MCP supports three security modes configured via the MYSQL_SECURITY_MODE environment variable. Readonly mode restricts execution to queries like SELECT and DESCRIBE. Limited write mode permits INSERT and UPDATE operations while blocking DELETE and DROP commands. Full access mode allows arbitrary SQL operations for administrative tasks.

Which MCP clients work with MySQL MCP?

MySQL MCP is tailored for integration with Cursor, but it operates over the standard Model Context Protocol. Any MCP client supporting standard local process execution with custom environment variables can launch the server using Python and communicate via MCP tools.

Is MySQL MCP open source?

Yes, MySQL MCP is open source and licensed under the permissive MIT License. Users are free to use, modify, distribute, and integrate the code into commercial or personal development workflows as long as the original copyright notice is retained.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories