mysql-mcp
Provides tools to interact with MySQL databases: list databases, list tables, describe table schema, execute SELECT queries, insert and update rows with safety guardrails.
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., "@mysql-mcpshow me the users table schema"
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.
mysql-mcp
MySQL MCP Server for OpenAI Codex — Create, Read, Update only. No destructive operations.
Directory Tree
mysql-mcp/
├── .codex/
│ └── config.toml ← Codex MCP registration
├── src/
│ ├── server/
│ │ ├── index.ts ← MCP server entry (stdio transport)
│ │ ├── db.ts ← mysql2 connection pool + query helpers
│ │ └── tools/
│ │ ├── schema.ts ← mysql_list_databases, mysql_list_tables, mysql_describe_table
│ │ ├── read.ts ← mysql_query (SELECT only)
│ │ └── write.ts ← mysql_insert, mysql_update (no DELETE/DROP)
│ └── client/
│ └── index.ts ← Test client — launches server + runs all tools
├── .env.example ← Copy to .env with your credentials
├── .gitignore
├── package.json
└── tsconfig.jsonRelated MCP server: yooztech_mcp_mysql
Tools
Tool | Operation | readOnly | destructive |
| SHOW DATABASES | ✅ | ❌ |
| information_schema | ✅ | ❌ |
| SHOW COLUMNS + SHOW INDEX | ✅ | ❌ |
| SELECT (guarded) | ✅ | ❌ |
| INSERT / INSERT IGNORE | ❌ | ❌ |
| UPDATE (WHERE required) | ❌ | ❌ |
Setup
# 1. Install dependencies
npm install
# 2. Configure credentials
cp .env.example .env
# edit .env with your MySQL details
# 3. Run the test client (launches server automatically)
npm run client
# 4. Or run server standalone
npm run serverRegistering with Codex
Edit .codex/config.toml with your credentials — Codex will auto-launch the server.
Or register via CLI:
codex mcp add mysql \
--env MYSQL_HOST=localhost \
--env MYSQL_USER=mcp_user \
--env MYSQL_PASSWORD=secret \
--env MYSQL_DATABASE=mydb \
-- npx tsx /path/to/mysql-mcp/src/server/index.tsVerify in Codex TUI: /mcp
Safety Guardrails
mysql_queryblocks INSERT/UPDATE/DELETE/DROP/TRUNCATE even if embedded in a SELECTmysql_updaterequires a WHERE clause — updates without a condition are rejectedmysql_updatesupportsdry_run: trueto preview affected rows before committingAll identifiers (table/column names) are sanitized against injection
All values use
?prepared statement placeholders — never string interpolationNo DELETE, TRUNCATE, DROP, or ALTER tools exist
This server cannot be installed
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
- Alicense-qualityDmaintenanceProvides secure access to MySQL databases for AI assistants, enabling safe SQL queries, table information retrieval, and data insertion with built-in security protections.Last updated6522MIT

yooztech_mcp_mysqlofficial
Alicense-qualityCmaintenanceEnables secure read-only access to MySQL databases with automatic database inference from project context. Provides safe querying capabilities with built-in security features like parameterized queries, whitelisting, and rate limiting.Last updated1MIT- Alicense-qualityBmaintenanceEnables safe querying and optional writing to MySQL databases via MCP tools, with support for schema inspection, connection management, and read-only mode.Last updated173MIT
- Alicense-qualityCmaintenanceProvides read-only MySQL query execution, database/table browsing, and table structure inspection with SQL safety validation.Last updated23MIT
Related MCP Connectors
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Runtime permission, approval, and audit layer for AI agent tool execution.
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/stellarcompiler/mysql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server