Add `--scope project` after `mcp add` to keep the registration in the current workspace. See [Autohand Code](https://github.com/autohandai/code-cli/)
If you want an AI assistant working directly with Mysql, the mysql mcp server is the bridge. Add --scope project after mcp add to keep the registration in the current workspace. See Autohand Code for current CLI details.
Add --scope project after mcp add to keep the registration in the current workspace. See Autohand Code for current CLI details.
Once connected, the assistant can call these 3 tools directly:
execute_sql — Executes any standard SQL query. - Arguments: query (string) - Features: Supports SELECT, SHOW, DESCRIBE, and DML (INSERT, UPDATE, DELETE). DMLget_schema_info — Provides detailed metadata about database structures. - Arguments: table_name (optional string) - Output: Column names, types, nullability, defaultget_table_sample — Fetches a representative sample of data. - Arguments: table_name (string), limit (optional integer, max 20) - Use Case: Quickly understand data formatsThe server is distributed via npm as @smithery/cli, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.
Before the server will start you need to supply 8 environment variables: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MCP_SSE_HOST, MYSQL_SSH_HOST, MYSQL_SSH_KEY_PATH. Keep credentials in your client's env block or a secrets manager rather than committing them.
Database servers turn schema archaeology and ad-hoc reporting into conversation, which is why they tend to be the second or third server people install. Mysql sits in that group, and the shape of its toolset — execute_sql, get_schema_info, get_table_sample — tells you what it is really for. Worth comparing against the other databases servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| execute_sql | Executes any standard SQL query. - **Arguments:** query (string) - **Features:** Supports SELECT, SHOW, DESCRIBE, and DML (INSERT, UPDATE, DELETE). DML operations are marked with a destructive hint. - **Limitation:** Sin |
| get_schema_info | Provides detailed metadata about database structures. - **Arguments:** table_name (optional string) - **Output:** Column names, types, nullability, default values, and comments. - **Cross-database:** Pass database.table |
| get_table_sample | Fetches a representative sample of data. - **Arguments:** table_name (string), limit (optional integer, max 20) - **Use Case:** Quickly understand data formats and content without fetching large result sets. - **Cross-da |
{
"mcpServers": {
"mysql": {
"command": "uv",
"args": [
"--directory",
"path/to/mysql_mcp_server",
"run",
"mysql_mcp_server"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| MYSQL_HOST | Endpoint or connection string the server talks to. | Optional |
| MYSQL_PORT | Configuration value read at startup. | Optional |
| MYSQL_USER | Configuration value read at startup. | Optional |
| MYSQL_PASSWORD | Configuration value read at startup. | Optional |
| MYSQL_DATABASE | Configuration value read at startup. | Optional |
| MCP_SSE_HOST | Endpoint or connection string the server talks to. | Optional |
| MYSQL_SSH_HOST | Endpoint or connection string the server talks to. | Optional |
| MYSQL_SSH_KEY_PATH | Credential the server authenticates with. | Yes |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.