Get the FREE Ultimate OpenClaw Setup Guide →

database-tools

MCP tool that allows you to interact with MySQL databases

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio elber-code-database-tools node C:\path\to\index.js

How to use

Database Tools for Claude is an MCP server that enables Claude to interact directly with MySQL databases. It exposes a set of capabilities that let Claude query databases, inspect schemas, and retrieve formatted results suitable for reading within Claude’s interface. Key features include listing databases, listing tables within a database, retrieving size or structure information for tables, and executing arbitrary SQL queries. To use it, Claude issues structured requests that are translated by this MCP server into MySQL queries, and the results are returned in a readable format for Claude to present.

With this tool, you can: (1) list all databases, (2) view tables in a chosen database, (3) query the size of a specific table, and (4) run custom SQL queries. For example, you can ask Claude to show databases, describe a table’s structure, or execute a SELECT query and receive the results formatted for easy consumption. Security and access controls depend on the credentials configured in your mysql.js file and the permissions granted there.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Git (for cloning the repository, if desired)
  • Access to the MCP server environment where Claude is configured

Option A: Install via Smithery (recommended for Claude integration)

  1. Ensure you have npx available (comes with npm).
  2. Run: npx -y @smithery/cli install @elber-code/database-tools --client claude

Option B: Local development setup

  1. Clone the repository or download the package: git clone [repository-url]
  2. Navigate to the project directory: cd database-tools
  3. Install dependencies: npm install
  4. Start the server locally (adjust as needed for your environment): node index.js

Configuration notes:

  • After installation, configure Claude to reference this MCP server in claude_desktop_config.json with the provided mcpServers.nametag entry and the path to the server script (index.js).
  • Ensure your mysql.js (or equivalent credential file) is properly configured with credentials that grant only the necessary permissions.

Additional notes

Tips and considerations:

  • Use the provided configuration example as a starting point and replace the path to index.js with the actual path in your environment.
  • Ensure MySQL is reachable from the machine running the MCP server and that network/firewall rules allow the connections.
  • Keep credentials in mysql.js minimal and scoped to required databases/tables.
  • If you update the server code, restart the MCP service to pick up changes.
  • On Windows, ensure proper escaping for file paths (use double backslashes in JSON strings).

Related MCP Servers

Sponsor this space

Reach thousands of developers