Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

database-mcp-mysql

MCP server by arifulislamat Community

Database-mcp-mysql is an MCP server that gives AI clients structured, guarded access to MySQL databases. It is published for npm, PyPI and Rust, and suits developers who want read-only SQL access by default.

  • Score 75
  • 5 stars
  • 121 a week
  • MIT
  • Updated

Install database-mcp-mysql

Built from the published package, never by AI.

claude mcp add database-mcp-mysql -e MYSQL_HOST=YOUR_MYSQL_HOST -e MYSQL_USER=YOUR_MYSQL_USER -e MYSQL_DATABASE=YOUR_MYSQL_DATABASE -- npx -y @database-mcp/mysql

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install database-mcp-mysql in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the database-mcp-mysql block.

About

database-mcp-mysql is the MySQL package in the database-mcp project by arifulislamat. It is an MCP server with two tools, execute_sql and search_objects. Called with no arguments, search_objects lists tables. Called with a table name, it returns columns, indexes and foreign keys. Connection details come from flags, a YAML config file or environment variables such as MYSQL_*.

Guardrails are on by default. Read-only mode is enforced by a conservative SQL guard and a session-level read-only setting. Rows are capped at 1000 and statements time out after 30 seconds. Passwords are kept in non-printable secret types, and DSNs are sanitized before logging. Credentials are never accepted through a tool call. The package is aimed at developers who want safe, structured SQL access for AI assistants.

Written from the project's README and checked against it.

Tools it gives your assistant

  • execute_sqlRuns SQL against the MySQL database with read-only mode, row caps and statement timeouts on by default.
  • search_objectsLists tables when called with no arguments, or returns columns, indexes and foreign keys for a named table.

What you need

  • Node.js for the npm package
  • Python with uvx for the PyPI package
  • Rust and cargo for the native binary
  • A MySQL database with connection details in MYSQL_* environment variables
SettingNeededWhat it is
MYSQL_HOSTEnvironment variableRequiredDatabase host
MYSQL_USEREnvironment variableRequiredDatabase user (a read-only user is recommended)
MYSQL_DATABASEEnvironment variableRequiredDatabase name
MYSQL_PASSWORDEnvironment variable, secretOptionalDatabase password (or use MYSQL_PASSWORD_FILE)

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • List the tables in my MySQL database
  • Show the columns and foreign keys for the orders table
  • Run a read-only query that counts rows in the users table

Good to know

  • Read-only mode is on by default.
  • Results are capped at 1000 rows and statements time out after 30 seconds by default.
  • Go support is planned but not yet available.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to database-mcp-mysql

All alternatives →
Supabase supabase
97

Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.

AAA Local and remote 172k/wk
ArcadeDB MCP Server ArcadeData
94

ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.

AAA Local 1.3k
DBHubbytebase
94

Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.

AAA Local 343k/wk
MCP Toolbox for Databasesgoogleapis
94

MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.

AAA Local 17k
MCP Toolbox for Databasesgoogleapis
94

Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.

AAA Local 17k
mongodb-mcp-servermongodb-js
94

MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.

AAA Local 203k/wk

Compare with Supabase, ArcadeDB MCP Server or DBHub

database-mcp-mysql: common questions

Is it safe to let an AI run queries on MySQL?

Read-only mode is on by default, enforced by a SQL guard and a session-level read-only setting. Rows are capped at 1000 and statements time out after 30 seconds by default.

How are MySQL credentials handled?

Credentials come from flags, a YAML file, environment variables or mounted secret files, never from a chat prompt. Passwords use non-printable secret types and DSNs are sanitized before logging.

Is it available outside npm?

Yes. The same server is published on PyPI as database-mcp-mysql and on crates.io as database-mcp-rs-mysql.

How do I install database-mcp-mysql?

In Claude Code run claude mcp add database-mcp-mysql -e MYSQL_HOST=YOUR_MYSQL_HOST -e MYSQL_USER=YOUR_MYSQL_USER -e MYSQL_DATABASE=YOUR_MYSQL_DATABASE -- npx -y @database-mcp/mysql. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is database-mcp-mysql the official server?

database-mcp-mysql is a community project by arifulislamat, not verified by a company domain.

Is database-mcp-mysql free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is database-mcp-mysql safe to use?

It scores 75 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to database-mcp-mysql?

Similar MCP servers: Supabase, ArcadeDB MCP Server, DBHub, MCP Toolbox for Databases.

Does database-mcp-mysql work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

database-mcp-mysql Install

Add to stack

Loading.