MySQL

MySQL

MySQL database integration in NodeJS with configurable access controls and schema inspection

934
Stars
266
Forks
14
Releases

Overview

This MCP server provides access to MySQL databases through SSH tunnels, enabling Claude and other LLMs to inspect database schemas and execute SQL queries securely. It is a Node.js-based MCP server with support for multiple databases and per-project configurations, including a Claude Code-optimized fork with SSH tunnel integration and auto-start/stop hooks for seamless tunnel management. The server implements DDL support by enabling the MYSQL_DISABLE_READ_ONLY_TRANSACTIONS flag, enabling CREATE TABLE and related statements when allowed. It supports multi-database mode by omitting MYSQL_DB so the LLM can query any accessible database, with queries requiring fully-qualified table names. It introduces schema-specific permissions to control INSERT, UPDATE, DELETE, and DDL operations on a per-database basis. The configuration is driven by environment variables, with options for connection pooling, timeouts, caching, rate limits, SSL, logging, and remote operation. The README also covers running from a local clone, installing via Smithery, and remote mode operation, including guidance for Claude Desktop integration and CLI usage. Overall, the MCP server emphasizes secure, auditable access to MySQL for LLM-assisted schema inspection and data manipulation within defined boundaries.

Details

Owner
benborla
Language
JavaScript
License
MIT License
Updated
2025-12-07

Features

Claude Code Integration

Optimized for use with Anthropic's Claude Code CLI, enabling seamless MCP server management from Claude Code.

SSH Tunnel Support

Built-in SSH tunnel support to connect to remote MySQL databases securely.

Auto-start / stop Hooks

Automatic tunnel management coordinated with Claude's start/stop workflows.

DDL Operations

Supports DDL by enabling MYSQL_DISABLE_READ_ONLY_TRANSACTIONS to allow CREATE TABLE and related statements.

Multi-Project Setup

Easy configuration for multiple projects with different databases.

Multi-DB Mode

In multi-database mode, omit MYSQL_DB to allow queries against any accessible database (with schema-qualified queries).

Schema-Specific Permissions

Fine-grained permissions for INSERT/UPDATE/DELETE/DDL on a per-schema basis.

Remote MCP Configuration

Supports remote MCP operation with environment-driven config and dedicated port/secret key.

Audience

DevelopersUse the MCP server to expose MySQL databases to Claude Code/LLMs for schema inspection and query execution via SSH tunnels.
Data Engineers/DBAsConfigure per-project databases, multi-DB access, and schema-specific permissions to securely test and manage access.

Tags

MySQLMCP-ServerNode.jsClaude CodeSSH TunnelingSchema InspectionMulti-DBDDLPer-Schema PermissionsRemote Mode