dynamic-mysql-mcp
Provides runtime-authenticated access to MySQL databases, enabling listing databases and tables, describing schemas, performing CRUD row operations, and executing custom SQL queries with optional parameters.
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., "@dynamic-mysql-mcpLog in to MySQL as root and list databases"
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.
Dynamic MySQL MCP Server
Model Context Protocol (MCP) server for MySQL, enabling AI assistants to query and mutate MySQL data safely through tools.
Features
๐ง Tool-based MySQL access (no required env vars)
๐ Runtime authentication via
auth_mysql๐๏ธ List databases and tables
๐งฑ Describe table schemas
๐ CRUD-like row operations (
select_rows,insert_row,update_rows,delete_rows)๐งพ Custom SQL execution (
execute_sql) with optional parameters๐ MCP resources for table schema discovery
Related MCP server: MySQL MCP
Why Dynamic (vs static MySQL MCP servers)
Many MySQL MCP servers are configured statically (fixed host/user/password via env or config file). This project is intentionally dynamic.
Runtime auth via tool calls (
auth_mysql) instead of requiring credentials at server bootSwitch database context during a session using
use_database(or per-call database override)Work across multiple databases/environments from one running MCP server session
Better fit for agent workflows where connection details change per task
No required auth environment variables for normal use
Capability | Dynamic MySQL MCP Server | Typical static MySQL MCP |
Credentials | Provided at runtime with | Fixed in env/config at startup |
Environment switching | Re-auth per task/session | Usually restart/reconfigure |
Database switching |
| Often single default DB |
Agent workflow fit | High (task-driven connections) | Medium (preconfigured only) |
Secrets handling model | No required auth env vars | Often relies on persistent env secrets |
Installation
npm install dynamic-mysql-mcp
# or
bun install dynamic-mysql-mcpUsage
With Claude Desktop
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["dynamic-mysql-mcp"]
}
}
}Direct Usage
npx dynamic-mysql-mcpAuthentication Flow (via tools)
auth_mysql(host default127.0.0.1, pass user/password and optional host/port/database/ssl)Optional:
use_databaseto switch default DB like SQLUSE <db>get_auth_statusUse schema/data tools
logout
No environment variable is required for auth.
Quick Tutorial
Use prompt-style language like this when chatting with an AI connected to this MCP:
"Log in to local MySQL using root with an empty password."
"Set the active database to my_app."
"Show all tables in the active database."
"Describe the users table, including column names and data types."
"Fetch the 10 most recent rows from users, ordered by id descending."
"Insert one new user into users with email test@example.com."
"Update the user with id 1 and set the name to Budi."
"Delete the user row with id 1."
"Switch the active database to analytics."
"Run custom SQL: SELECT id, email FROM users WHERE created_at >= ? with params ["2026-01-01"]."
Tip: if you want to run an operation on a specific database without switching the active database, mention the database directly in your prompt, for example: "Fetch 5 rows from analytics.events".
More Prompt Examples
Date filters:
"Fetch orders from the last 30 days based on created_at."
"Show payments between 2026-02-01 and 2026-02-10."
Pagination:
"Fetch 20 users starting from row 21."
"Show page 3 of products with 10 rows per page."
Keyword search:
"Find users whose email contains admin."
"Fetch posts whose title contains promo."
Combined filter + sort:
"Fetch 10 paid invoices, ordered by id descending."
"Show error-level logs, newest first, limited to 50 rows."
Available Tools
healthauth_mysqlget_auth_statuslogoutlist_databasesuse_databaselist_tablesdescribe_tableselect_rowsinsert_rowupdate_rowsdelete_rowsexecute_sql
Development
bun install
bun run dev
bun run typecheck
bun run test
bun run buildLicense
MIT
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.
Latest Blog Posts
- 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/fadlee/dynamic-mysql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server