MySQL (read Only, switchable) logo

MySQL (read Only, switchable)

Read-only MySQL access with runtime switching between databases, profiles, servers, and credentials.

Install MySQL (read Only, switchable)

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mysql-read-only-switchable": {
      "command": "npx",
      "args": [
        "-y",
        "@shibbirweb/mcp-mysql-read-only"
      ],
      "env": {
        "MYSQL_HOST": "YOUR_VALUE_HERE",
        "MYSQL_USER": "YOUR_VALUE_HERE",
        "MYSQL_PASSWORD": "YOUR_VALUE_HERE",
        "MYSQL_DATABASE": "YOUR_VALUE_HERE",
        "MYSQL_PROFILES": "YOUR_VALUE_HERE",
        "MYSQL_DEFAULT_PROFILE": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 12 tools correctly ().

Overview

MySQL (read-only, switchable) MCP server gives AI assistants read-only access to MySQL through MCP tools. It keeps the active connection in session state, allowing database, profile, server, and credential changes without restarting the client. Tools cover connection inspection, schema discovery, table metadata, sample rows, and one-statement read-only queries. Use it when an assistant needs to inspect multiple MySQL targets while preserving the conversation.

Use cases

  • Inspect schemas across local, staging, and analytics databases
  • Compare read-only query results across multiple databases
  • Explore table columns, indexes, and foreign-key relationships
  • Sample rows before writing an analysis query
  • Switch MySQL servers without restarting the assistant

Key features

  • Read-only MySQL queries
  • Runtime database and server switching
  • Named connection profiles
  • Schema and table metadata inspection
  • Up to 50 sample rows per table
  • npm and Docker deployment

Tools12

What MySQL (read Only, switchable) lets your agent do. Expand a tool for its parameters.

Verified live~1.2k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 62d

What it can do

From the 12 tools this server returned when we ran it; 12 declare their own safety hints.

Runs commands · 1Handles credentials · 1Makes network requests · 12Read-only tools · 11
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age61 days
Maintainers1

Observed 2026-11-22 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · @shibbirweb/mcp-mysql-read-only (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads282Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed12Callable tools this server registers over MCP.
Directory activity12 viewsConfig copies, upvotes, and views on AllMCPs.

How MySQL (read Only, switchable) works

What the MySQL (read-only, switchable) MCP server does

The MySQL (read-only, switchable) MCP server exposes MySQL inspection and query operations to an MCP-compatible AI assistant. It can report the active server and database, show configured connection profiles, enumerate databases and tables, inspect columns, indexes, and foreign keys, return up to 50 sample rows, and execute one read-only statement.

The server is designed for sessions that move between targets. An assistant can change schemas on the current server, select a named profile, or open another server with explicit credentials. These operations do not require restarting the MCP client. The read-only behavior applies to the available database-reading tools and query execution.

How it works

The process maintains the active connection as runtime state for the duration of the session. Configured targets are represented as named profiles, while the connect tool can open an additional target under an optional alias. Connection switches are checked with SELECT 1 before becoming active; if verification fails, the previous connection remains selected.

Connections are pooled per target, so returning to a previously used target can reuse its existing pool. Reading tools can also receive an optional database for a single call without changing the active connection. This supports comparisons between databases without repeated permanent switches.

Setup and configuration

The server runs through npm with npx or as a Docker container. The npm option requires Node 22 or newer. A basic setup supplies MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE. Docker users can use host.docker.internal to reach a MySQL service running on the host; localhost inside the container refers to the container itself.

Named profiles are supplied in MYSQL_PROFILES as a JSON object. Each profile requires a user and database; host defaults to host.docker.internal, port defaults to 3306, and password defaults to an empty value. MYSQL_DEFAULT_PROFILE can select the initial profile. Invalid profiles missing required fields are skipped with a warning.

Claude Desktop uses an mcpServers entry in claude_desktop_config.json, and Claude Code uses the same structure in a project-level .mcp.json. Credentials in these files are stored as plain text, so the README recommends using a MySQL account limited to SELECT grants and keeping configuration files out of version control.

Tools and capabilities

Connection tools include current_connection, list_connections, list_databases, use_database, use_connection, and connect. They show or change the active target without requiring a client restart.

Database-reading tools include list_tables, describe_table, get_table_indexes, get_foreign_keys, get_table_sample, and run_query. The last tool accepts one read-only statement. The MySQL (read-only, switchable) MCP server therefore fits schema exploration, data inspection, and read-only analysis rather than write workflows.

Limitations and notes

This server does not provide write operations. Runtime connections opened with connect remain available for the current session but are not added permanently to MYSQL_PROFILES; adding a permanent profile requires configuration and a restart. Docker networking also changes how local addresses resolve, so a host MySQL instance should not be addressed as localhost from inside the container.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MySQL (read Only, switchable)

MySQL (read-only, switchable) is an MCP server that connects AI assistants to MySQL databases with read-only access. Its main tools inspect connections, databases, tables, columns, indexes, foreign keys, and sample rows, and run one read-only statement. It can switch databases, profiles, servers, and credentials during a session.

Install it with `npx -y @shibbirweb/mcp-mysql-read-only` or run the Docker image `shibbirweb/mcp-mysql-read-only`. The npm method requires Node 22 or newer. Configure the MySQL environment variables, then add the command to an MCP client configuration.

Yes, it works with Claude Desktop through an `mcpServers` entry in `claude_desktop_config.json`. The configuration can launch the npm package with `npx` or run the Docker image, and it supplies the MySQL connection values through environment variables.

Yes, database and server switches happen through MCP tool calls without restarting the client. Use `use_database` for another schema on the current server, `use_connection` for a named profile, or `connect` for a server and credentials supplied at runtime.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMySQL (read Only, switchable) AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mysql-read-only-switchable?style=directory)](https://allmcps.com/mcp/mysql-read-only-switchable)
HTML Embed
<a href="https://allmcps.com/mcp/mysql-read-only-switchable"><img src="https://allmcps.com/api/badge/mysql-read-only-switchable?style=directory" alt="MySQL (read Only, switchable) on AllMCPs" /></a>