io.github.arifulislamat/database-mcp-mysql
MCP server for MySQL. Read-only by default, row caps, statement timeouts, secrets never logged.
Install
Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).
@database-mcp/mysqlclaude mcp add database-mcp-mysql -e 'MYSQL_HOST=<MYSQL_HOST>' -e 'MYSQL_USER=<MYSQL_USER>' -e 'MYSQL_PASSWORD=<your mysql_password>' -e 'MYSQL_DATABASE=<MYSQL_DATABASE>' -- npx -y @database-mcp/mysql@0.5.0
{
"mcpServers": {
"database-mcp-mysql": {
"command": "npx",
"args": [
"-y",
"@database-mcp/mysql@0.5.0"
],
"env": {
"MYSQL_HOST": "<MYSQL_HOST>",
"MYSQL_USER": "<MYSQL_USER>",
"MYSQL_PASSWORD": "<your mysql_password>",
"MYSQL_DATABASE": "<MYSQL_DATABASE>"
}
}
}
}
Environment variables
MYSQL_HOSTrequired Database hostMYSQL_USERrequired Database user (a read-only user is recommended)MYSQL_PASSWORDsecret Database password (or use MYSQL_PASSWORD_FILE)MYSQL_DATABASErequired Database name
database-mcp-mysqlclaude mcp add database-mcp-mysql -e 'MYSQL_HOST=<MYSQL_HOST>' -e 'MYSQL_USER=<MYSQL_USER>' -e 'MYSQL_PASSWORD=<your mysql_password>' -e 'MYSQL_DATABASE=<MYSQL_DATABASE>' -- uvx database-mcp-mysql==0.2.0
{
"mcpServers": {
"database-mcp-mysql": {
"command": "uvx",
"args": [
"database-mcp-mysql==0.2.0"
],
"env": {
"MYSQL_HOST": "<MYSQL_HOST>",
"MYSQL_USER": "<MYSQL_USER>",
"MYSQL_PASSWORD": "<your mysql_password>",
"MYSQL_DATABASE": "<MYSQL_DATABASE>"
}
}
}
}
Environment variables
MYSQL_HOSTrequired Database hostMYSQL_USERrequired Database user (a read-only user is recommended)MYSQL_PASSWORDsecret Database password (or use MYSQL_PASSWORD_FILE)MYSQL_DATABASErequired Database name
database-mcp-rs-mysqlEnvironment variables
MYSQL_HOSTrequired Database hostMYSQL_USERrequired Database user (a read-only user is recommended)MYSQL_PASSWORDsecret Database password (or use MYSQL_PASSWORD_FILE)MYSQL_DATABASErequired Database name
Documentation
From the project's README on GitHub, refreshed weekly. Links open on GitHub.
database-mcp
MCP servers that give AI clients safe, structured access to SQL databases.
One installable package per database engine, in TypeScript (npm), Python
(PyPI), and Rust (crates.io). Every package exposes the same minimal
two-tool surface, execute_sql and search_objects, with guardrails on by
default: read-only mode, row caps, and statement timeouts.
Packages
| Engine | TypeScript (npm) | Python (PyPI) | Rust (crates.io) |
|---|---|---|---|
| SQLite | @database-mcp/sqlite | database-mcp-sqlite | database-mcp-rs-sqlite |
| libSQL | @database-mcp/libsql | database-mcp-libsql | database-mcp-rs-libsql |
| MySQL | @database-mcp/mysql | database-mcp-mysql | database-mcp-rs-mysql |
| MariaDB | @database-mcp/mariadb | database-mcp-mariadb | database-mcp-rs-mariadb |
| Postgres | @database-mcp/postgres | database-mcp-postgres | database-mcp-rs-postgres |
All three lines are published and pass the same language-agnostic conformance suite against real databases in CI, so behavior is identical regardless of language. Every engine is also listed on the MCP Registry with all three install options: npm, PyPI, and cargo.
Rust crates are named database-mcp-rs-<engine> because the plain names are
taken on crates.io; the command each one installs is still
database-mcp-<engine>. Go is planned.
Design principles
- Two tools, no more. A tiny tool surface keeps the model's context window
clean.
search_objectsprogressively discloses schema: call it with no arguments to list tables, with a table name to get columns, indexes, and foreign keys. - Safe by default. Read-only mode is enforced in two layers: a conservative SQL guard, plus a session-level read-only setting in the database itself. Rows are capped (default 1000) and statements time out (default 30s).
- Configured at launch, never via chat. Connection details come from flags, a YAML config file, or environment variables. Credentials are never accepted through a tool call.
- Secrets never appear in logs. Passwords live in non-printable secret types, DSNs are sanitized before logging, and a redaction filter guards the log boundary.
Quick start
Pick your engine's package; each README has the full config surface. SQLite via npm:
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["-y", "@database-mcp/sqlite", "--dsn", "/absolute/path/to/database.db"]
}
}
}
Or via PyPI: use "command": "uvx" and
"args": ["database-mcp-sqlite", "--dsn", "/absolute/path/to/database.db"].
Or as a native binary, with no Node or Python runtime: run
cargo install database-mcp-rs-sqlite, then use
"command": "database-mcp-sqlite" with the same args minus the package
name.
Flags, environment variables, and YAML config are identical across all three lines.
Networked engines take credentials from the environment (MYSQL_*,
MARIADB_*, POSTGRES_*/DATABASE_URL, LIBSQL_URL/LIBSQL_AUTH_TOKEN),
*_FILE mounted secrets, or a YAML file via --config. Never from a chat
prompt.
Contributing
See CONTRIBUTING.md. The short version: the conformance
suite is the definition of done. A change is mergeable only when
conformance/run.mjs passes against every affected server.
License
Frequently asked questions
What is io.github.arifulislamat/database-mcp-mysql?
MCP server for MySQL. Read-only by default, row caps, statement timeouts, secrets never logged.
How do I install io.github.arifulislamat/database-mcp-mysql?
It runs on your machine. In Claude Code: claude mcp add database-mcp-mysql -e 'MYSQL_HOST=<MYSQL_HOST>' -e 'MYSQL_USER=<MYSQL_USER>' -e 'MYSQL_PASSWORD=<your mysql_password>' -e 'MYSQL_DATABASE=<MYSQL_DATABASE>' -- npx -y @database-mcp/mysql@0.5.0. For other clients, paste the JSON configuration from this page into their MCP settings.
Does io.github.arifulislamat/database-mcp-mysql need an API key?
Yes. It expects MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, which you set in its configuration.
Is io.github.arifulislamat/database-mcp-mysql open source?
Yes. Its code is on GitHub under the MIT license.
Who maintains io.github.arifulislamat/database-mcp-mysql?
It is published by arifulislamat. AI.tn lists it but does not maintain or endorse it.
From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.