Back to Browse

Mysql MCP Server

Data & AnalyticsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Enterprise-grade MySQL MCP Server with OAuth 2.0, 106 tools, and Docker deployment

About

Enterprise-grade MySQL MCP Server with OAuth 2.0, 106 tools, and Docker deployment

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Imported from the Official MCP Registry. Trust signals: trusted author (7/7 approved).

3 files analyzed ยท No issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

database

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "mcp-server": {
      "args": [
        "-y",
        "@neverinfamous/mysql-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

MySQL MCP Server (mysql-mcp)

GitHub Release npm Docker Pulls MCP License: MIT Coverage E2E

๐Ÿ“š Full Documentation (Wiki) โ€ข Changelog โ€ข Security โ€ข Release Article

๐Ÿ’Ž Value Proposition

Integrate your AI agents with a production-ready MySQL environment. Deploy MCP v2 stateless architecture via HTTP transport. Optimize token efficiency via Code Mode. Secure your database with OAuth 2.1.

๐ŸŽฏ Leverage Core Benefits

FeatureDescription
Specialized ToolsAccess specialized tools for core CRUD, JSON, spatial data, document stores, and clusters.
ResourcesMonitor schema, performance metrics, process lists, replication status, and InnoDB diagnostics in real-time.
AI-Powered PromptsExecute guided workflows for query building, schema design, performance tuning, and infrastructure setup.
Code ModeReduce LLM token consumption by consolidating operations inside a secure, sandboxed V8 isolate.
Token-Optimized PayloadsMaximize token efficiency. Use optional flags to reduce response size for large payloads.
OAuth 2.1 SecurityEnforce granular access control with RFC compliance, strict scopes, and Keycloak integration.
Smart Tool FilteringUse tool groups and shortcuts to stay within IDE tool limits.
Streamable & Stateless HTTPSupport MCP v2 streamable HTTP and stateless HTTP deployments.
Connection PoolingLeverage built-in connection pooling for efficient, highly concurrent database access.
Ecosystem IntegrationsManage MySQL Router, ProxySQL, and MySQL Shell utilities directly from your agent.
Advanced EncryptionEnforce TLS/SSL connections. Manage data masking, encryption monitoring, and compliance effortlessly.
Production-Ready SecurityPrevent SQL injection with parameterized queries. Rely on strict input validation and audit logging.
Deterministic ErrorsReceive structured responses with actionable suggestions. Eliminate silent failures and raw exceptions.
ObservabilityExport Prometheus metrics. Track container logs with Dozzle and audit trails with Grafana Alloy/Loki.
Strict TypeScriptRely on strict TypeScript backed by robust test suites.
MCP v2 CompliantFully support the MCP v2 specification. This includes stateless routing, caching, safety hints, and notifications.

๐Ÿค– Automate Tasks with Guided Workflows

This server includes intelligent prompts for guided workflows:

PromptDescription
mysql_tool_indexComplete tool index with categories
mysql_quick_queryQuick query execution shortcut
mysql_quick_schemaQuick schema exploration
mysql_setup_observabilityComplete observability stack setup guide (Datadog, etc.)

Note: This is a subset of available prompts. Use mysql_tool_index to discover the full list of guided workflows.


๐Ÿ“Š Improve Observability with Resources

This server exposes a comprehensive set of resources for database observability and telemetry:

ResourceCategoryDescription
mysql://schemaCoreFull database schema
mysql://tablesCoreTable listing with metadata
mysql://variablesCoreServer configuration variables
mysql://statusCoreServer status metrics
mysql://processlistCoreActive connections and queries
mysql://poolCoreConnection pool statistics
mysql://capabilitiesExtendedServer version, features, and tool categories
mysql://healthExtendedComprehensive database health status
mysql://performanceExtendedQuery performance metrics
mysql://indexesExtendedIndex usage and statistics
mysql://replicationExtendedReplication status and lag
mysql://innodbExtendedInnoDB buffer pool and engine metrics
mysql://eventsDomainEvent Scheduler status and scheduled events
mysql://sysschemaDomainsys schema diagnostics summary
mysql://locksDomainInnoDB lock contention detection
mysql://clusterDomainGroup Replication / InnoDB Cluster status
mysql://spatialDomainSpatial columns and indexes
mysql://docstoreDomainDocument Store collections
mysql://insightsAnalyticsBusiness insights memo from mysql_append_insight
mysql://metricsObservabilityIn-memory token usage, latency, and request metrics
mysql://auditObservabilityForensic trail and snapshot of system errors
mysql://helpDocumentationCritical gotchas and high-level API reference
mysql://help/{group}DocumentationDynamic group-specific tool reference (e.g., core, codemode)

๐Ÿš€ Deploy Your AI Database

Meet Prerequisites

  • Node.js >= 24.0.0 (See .node-version for the pinned local development version)
  • Bun (for executing repository automation scripts)
  • MySQL server
  • pnpm

Install the Server

Install via NPM / PNPM
pnpm add -g @neverinfamous/mysql-mcp

Run the server:

mysql-mcp --transport stdio --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb"

Or use npx without installing:

npx @neverinfamous/mysql-mcp --transport stdio --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb"
Run with Docker

Note on Namespaces: The Docker image uses the writenotenow namespace. The GitHub repo uses neverinfamous.

Linux Users: For host.docker.internal on Linux, run the container with --add-host host.docker.internal:host-gateway.

docker run -i --rm -v ./data:/app/data -v ./logs:/var/log/mysql-mcp writenotenow/mysql-mcp:latest \
  --transport stdio \
  --allowed-io-roots /app/data \
  --mysql "mysql://mcp_user:secure_password@host.docker.internal:3306/testdb"
Enable Observability via Docker Compose

Launch the full observability stack using the included template. This includes Datadog, OpenTelemetry, Prometheus, and Grafana. This spins up the MCP server, MySQL database, Redis, and observability sidecars:

cd examples/basic-mysql-datadog
cp .env.example .env
docker compose up -d
  • Grafana: Available at http://localhost:3001 (Dashboard pre-loaded).
  • Prometheus: Available at http://localhost:9090.
  • MCP Server: Available at http://localhost:3000.
Follow Datadog & OpenTelemetry Observability Rules

Datadog Constraints:

  • Authentication: Use pup CLI for authentication.
  • Autodiscovery: Avoid duplicate autodiscovery configurations. Add standard tracking labels (tags.datadoghq.com/env, tags.datadoghq.com/service, tags.datadoghq.com/version) to your containers.
  • WSL2 Hardening Limits: Enforce stop_grace_period: 30s, mem_limit: 1536m, and OpenMetrics timeouts of 10s.
  • Host Configuration: Use DD_HOSTNAME and native /etc/docker/daemon.json cgroup configurations ("default-cgroupns-mode": "host"). Disable DD_EXTRA_PERFORMANCE_METRICS.
  • Windows File Tailing: Be warned that Windows inotify tailing issues may occur with Docker/WSL2 log mapping.

OpenTelemetry Rules:

  • Semantic Conventions: Enforce gen_ai.* semantics.
  • Instrumentation: Use auto-instrumentation when possible.
  • Context Propagation: Ensure traceparent and tracestate propagation.
  • Processing & Logging: Utilize batch processors and ensure logs are formatted as JSON logs.

Audit Architecture & Exporter Healthcheck:

  • The primary MCP server writes execution traces to mcp-audit.jsonl via the --audit-log flag.
  • The metrics exporter runs as an independent sidecar process. It reads from mcp-audit.jsonl using the AUDIT_LOG_PATH environment variable to compute metrics.
  • The exporter isolates its own internal logs by setting its --audit-log flag to exporter-audit.jsonl.
  • The metrics server and exporter share a single process. Both operate on port 3000. This prevents port contention.
  • Exporter Healthcheck: wget --spider -q http://127.0.0.1:3000/metrics
Build From Source
git clone https://github.com/neverinfamous/mysql-mcp.git
cd mysql-mcp
pnpm install
pnpm run build
node dist/cli.js --transport stdio --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb"

๐Ÿ—๏ธ Use Infrastructure Templates

We provide production-ready Docker Compose templates in the examples/ directory. Use these to spin up test environments quickly. These templates include full Datadog observability out-of-the-box (Metrics, APM, and Logs).

See the README in each directory for quick start instructions.


โšก Optimize Token Usage with Code Mode

Code Mode (mysql_execute_code) reduces token usage by consolidating operations in a secure sandbox.

Code executes securely in a C++ V8 isolate sandbox. It enforces strict heap limits and synchronous termination. Native wrappers map all API calls across the boundary. This guarantees defense-in-depth and fleet-standard restrictions:

Enforce Engine-Level Restrictions

  • โœ… Strict V8 Isolate Boundary โ€” Code executes within a physically separate V8 isolate. It ensures native objects and prototypes cannot cross the boundary.
  • โœ… Memory & CPU Constraints โ€” enforced at the C++ level. This includes synchronous timeouts and strict heap limits.
  • โœ… API Bindings via Reference โ€” Injects MySQL methods securely using ivm.Reference wrappers.

Validate Code Statically

  • โœ… Comprehensive blocked patterns โ€” regex rules block require(), import(), eval(), Function, process, and __proto__. They also block filesystem/network access and system commands.
  • โœ… Unicode & Comment Sanitization โ€” Strips comments and performs NFKC normalization to prevent regex evasion.
  • โœ… Configurable code input limit โ€” prevents payload-based resource exhaustion.

Protect the Runtime

  • โœ… RPC Quotas โ€” Caps RPC API calls per execution. This prevents unbounded loops.
  • โœ… Execution timeout โ€” enforces timeouts to prevent resource exhaustion. Configurable via schema timeout.
  • โœ… Egress boundary enforcement โ€” streaming JSON.stringify serialization aborts mid-flight when exceeding size caps.
  • โœ… Rate limiting โ€” Enforces per-client limits (CODEMODE_RATE_LIMIT_MAX). Uses Redis with in-memory fallbacks.
  • โœ… Readonly enforcement โ€” Returns structured errors instead of executing write methods when readonly: true.
  • โœ… Audit logging โ€” Logs every execution with UUID, client ID, metrics, and redacted code preview.
  • โœ… Admin scope โ€” Code Mode requires admin scope when OAuth is enabled.
  • โœ… Full API access โ€” Exposes all tool groups via the mysql.* namespace.

โšก Run Only Code Mode

Run with only Code Mode enabled. A single tool provides full capability access. See Option 1: Code Mode below for the recommended IDE configuration.

This exposes just mysql_execute_code. Agents write JavaScript against the typed SDK. They compose queries and chain operations across tool groups. They return exactly the needed data in one execution. This mirrors standard serverless edge execution patterns. It ensures fixed token costs.

[!TIP] Maximize Token Savings: Instruct your AI agent to prefer Code Mode.

"When using mysql-mcp, prefer mysql_execute_code (Code Mode) for multi-step operations. This minimizes token usage."

For maximum savings, run Code Mode as your only tool using --tool-filter codemode. See the Code Mode wiki for full API documentation.


๐ŸŒ Enable Remote Access via Streamable & Stateless HTTP

When to use HTTP mode: Deploy mysql-mcp as a standalone server. Multiple clients can connect remotely. Use stdio mode for local development.

Use cases for HTTP mode:

  • Run the server in a network-accessible Docker container
  • Deploy to cloud platforms (AWS, GCP, Azure)
  • Enable OAuth 2.1 authentication for enterprise security
  • Share one database connection across multiple AI clients

Use the HTTP transport for remote access:

npx -y @neverinfamous/mysql-mcp \
  --transport http \
  --server-host 0.0.0.0 \
  --port 3000 \
  --allowed-io-roots /path/to/data \
  --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb"

Docker:

docker run --rm -p 3000:3000 \
  -v ./data:/app/data \
  -v ./logs:/var/log/mysql-mcp \
  -e MCP_AUTH_TOKEN=my-secret-token \
  writenotenow/mysql-mcp:latest \
  --transport http --server-host 0.0.0.0 --port 3000 --allowed-io-roots /app/data --mysql "mysql://mcp_user:secure_password@host.docker.internal:3306/testdb"

The server supports Streamable HTTP and Stateless HTTP deployments. Both stateful and stateless clients can connect:

Use Streamable HTTP (Recommended)

Modern MCP protocol โ€” single endpoint, session-based:

MethodEndpointPurpose
POST/mcpJSON-RPC requests (initialize, tools/list, etc.)
GET/mcpSSE stream for server notifications
DELETE/mcpSession termination

Rate Limit: HTTP transport is rate limited per IP (default 100/min, configurable via MCP_RATE_LIMIT_MAX). Distribute limits across deployments via Redis using graceful in-memory fallbacks.

The server manages sessions via the Mcp-Session-Id header.

Run Statelessly

Use stateless deployments where sessions are not needed:

node dist/cli.js --transport http --server-host 0.0.0.0 --port 3000 --allowed-io-roots /path/to/data --stateless --mysql "mysql://mcp_user:secure_password@..."

In stateless mode: GET /mcp returns 405. DELETE /mcp returns 204. Each POST /mcp instantiates a stateless HTTP transport.

Access Utility Endpoints

MethodEndpointPurpose
GET/healthHealth check (bypasses rate limiting, always available for monitoring)
GET/metricsExports Prometheus metrics (available when --metrics-export is enabled)

๐Ÿ” Protect Your Data with Authentication

mysql-mcp supports two authentication mechanisms for HTTP transport:

Authenticate with Bearer Token (--auth-token)

Use lightweight authentication for development:

node dist/cli.js --transport http --server-host 0.0.0.0 --port 3000 --allowed-io-roots /path/to/data --auth-token my-secret --mysql "mysql://mcp_user:secure_password@..."

# Or via environment variable
export MCP_AUTH_TOKEN=my-secret
node dist/cli.js --transport http --server-host 0.0.0.0 --port 3000 --allowed-io-roots /path/to/data --mysql "mysql://mcp_user:secure_password@..."

Clients must include Authorization: Bearer my-secret on all requests. /health and / are exempt. Unauthenticated requests receive 401. Responses include WWW-Authenticate: Bearer headers per RFC 6750.

Authenticate with OAuth 2.1

Use full OAuth 2.1 for production deployments:

node dist/cli.js \
  --transport http \
  --server-host 0.0.0.0 \
  --port 3000 \
  --allowed-io-roots /path/to/data \
  --mysql "mysql://mcp_user:secure_password@localhost:3306/testdb" \
  --oauth-enabled \
  --oauth-issuer https://localhost:8080/realms/mysql-mcp \
  --oauth-audience mysql-mcp-client

Additional flags: --oauth-jwks-uri <url> (auto-discovered if omitted), --oauth-clock-tolerance <seconds> (default: 60).

Enforce OAuth Scopes

Enforce access control using OAuth scopes:

ScopeAccess Level
readRead-only queries (SELECT, EXPLAIN)
writeRead + write operations
adminFull administrative access
fullGrants all access
db:{name}Access to specific database
table:{db}:{table}Access to specific table

Ensure RFC Compliance

This implementation follows full OAuth 2.1 for production multi-tenant deployments:

  • โœ… RFC 9728 Protected Resource Metadata (/.well-known/oauth-protected-resource)
  • โœ… RFC 8414 Authorization Server Discovery with caching
  • โœ… RFC 7591 OAuth 2.1 Dynamic Client Registration
  • โœ… JWT validation with JWKS support (TTL: 1 hour)
  • โœ… MySQL-specific scopes: read, write, admin, full, db:{name}, table:{db}:{table}
  • โœ… Per-tool scope enforcement via AsyncLocalStorage context threading

Note for Keycloak users: Add an Audience mapper to your client. This includes the correct aud claim. (Client โ†’ Client scopes โ†’ dedicated scope โ†’ Add mapper โ†’ Audience)

[!NOTE] Per-tool scope enforcement: The server enforces scopes at the tool level. Each tool group requires a specific scope. When OAuth is enabled, every tool invocation checks the calling token's scopes before execution. The server skips scope checks entirely when OAuth is not configured.

[!WARNING] HTTP without authentication: Exposing --transport http without authentication grants unrestricted access. Always enable authentication for production HTTP deployments. See SECURITY.md for details.

โšก Simplify AI Integration with Client Configs

Install Agent Skills

For optimal AI performance, mysql-mcp includes specialized agent instructions in the skills/ directory. These skills teach AI coding assistants (like Cline, Antigravity, or Copilot) how to effectively use the server's capabilities, tool filters, and Code Mode.

To install: Copy the .md files from the skills/ directory into your AI assistant's designated skills or custom instructions folder (e.g., .cursor/rules/, .agents/skills/, etc.). This enables your agent to autonomously navigate the mysql-mcp ecosystem without hallucinating usage patterns.

Configure IDE Settings

Add a configuration to your IDE's MCP settings file:

Option 1: Code Mode (Maximum Token Savings, ๐ŸŒŸ Recommended)

Best for: General MySQL AI agent tasks. Exposes mysql_execute_code for full sandboxed toolset access.

{
  "mcpServers": {
    "mysql-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@neverinfamous/mysql-mcp",
        "--transport",
        "stdio",
        "--tool-filter",
        "codemode"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "mcp_user",
        "MYSQL_PASSWORD": "secure_password",
        "MYSQL_DATABASE": "testdb"
      },
      "timeout": 600
    }
  }
}
Option 2: Cluster (Tools for InnoDB Cluster Monitoring)

Best for: Monitoring InnoDB Cluster, Group Replication status, and cluster topology.

โš ๏ธ Prerequisites:

  • InnoDB Cluster must be configured and running with Group Replication enabled
  • Connect to a cluster node directly (e.g., localhost:3307) โ€” NOT a standalone MySQL instance
  • Use cluster_admin or root user with appropriate privileges
  • See MySQL Ecosystem Setup Guide for cluster setup instructions
{
  "mcpServers": {
    "mysql-mcp-cluster": {
      "command": "npx",
      "args": [
        "-y",
        "@neverinfamous/mysql-mcp",
        "--transport",
        "stdio",
        "--tool-filter",
        "cluster"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3307",
        "MYSQL_USER": "cluster_admin",
        "MYSQL_PASSWORD": "cluster_password",
        "MYSQL_DATABASE": "mysql"
      },
      "timeout": 600
    }
  }
}
Option 3: Ecosystem (Tools for InnoDB Cluster Deployments)

Best for: MySQL Router, ProxySQL, MySQL Shell, and InnoDB Cluster deployments.

โš ๏ธ Prerequisites:

  • InnoDB Cluster requires a running cluster. This enables Router REST API authentication.
  • Router REST API uses self-signed HTTPS certificates. Set MYSQL_ROUTER_INSECURE=true to bypass verification.
  • X Protocol: InnoDB Cluster includes the MySQL X Plugin by default. Set MYSQL_XPORT to the Router's X Protocol port (e.g., 6448). This enables mysqlsh_import_json and docstore tools
  • See MySQL Ecosystem Setup Guide for detailed instructions
{
  "mcpServers": {
    "mysql-mcp-ecosystem": {
      "command": "npx",
      "args": [
        "-y",
        "@neverinfamous/mysql-mcp",
        "--transport",
        "stdio",
        "--tool-filter",
        "ecosystem"
      ],
      "env": {
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3307",
        "MYSQL_XPORT": "6448",
        "MYSQL_USER": "cluster_admin",
        "MYSQL_PASSWORD": "cluster_password",
        "MYSQL_DATABASE": "testdb",
        "MYSQL_ROUTER_URL": "https://localhost:8443",
        "MYSQL_ROUTER_USER": "rest_api",
        "MYSQL_ROUTER_PASSWORD": "router_password",
        "MYSQL_ROUTER_INSECURE": "true",
        "PROXYSQL_HOST": "localhost",
        "PROXYSQL_PORT": "6032",
        "PROXYSQL_USER": "radmin",
        "PROXYSQL_PASSWORD": "radmin",
        "MYSQLSH_PATH": "mysqlsh"
      },
      "timeout": 600
    }
  }
}

Note: Port 6448 is the standard MySQL Router X Protocol port.

Customization Notes:

  • Replace /path/to/mysql-mcp/ with your actual installation path. This is only needed when building from source. It is also required when running local files directly.
  • Update credentials with your actual values
  • For Windows: Use forward slashes (e.g., C:/mysql-mcp/dist/cli.js) or escape backslashes
  • For Windows MySQL Shell: "MYSQLSH_PATH": "C:\\Program Files\\MySQL\\MySQL Shell\\bin\\mysqlsh.exe"
  • Router Authentication: Router REST API authenticates against the InnoDB Cluster metadata. The cluster must be running for authentication to work.
  • Cluster Resource: Connect to an InnoDB Cluster node. This unlocks the mysql://cluster resource

๐Ÿ“– See the Configuration Wiki for more configuration options.


๐Ÿ”— Integrate Any MySQL Environment

ScenarioHost to UseExample Connection String
MySQL on host machinelocalhost / host.docker.internalmysql://mcp_user:secure_password@localhost:3306/testdb
MySQL in DockerContainer name or networkmysql://mcp_user:secure_password@mysql-container:3306/testdb
Remote/Cloud MySQLHostname or IPmysql://mcp_user:secure_password@db.example.com:3306/testdb

Connect to MySQL on Host Machine

For native local installations, use localhost. If running the server in Docker, use host.docker.internal:

[
  "--mysql",
  "mysql://mcp_user:secure_password@host.docker.internal:3306/testdb"
]

Connect to MySQL in Another Docker Container

For Docker setups, use host.docker.internal. For Docker Compose, use the mysql service name.

Create a network and run MySQL:

docker network create mynet
docker run -d --name mysql-db --network mynet -e MYSQL_ROOT_PASSWORD=pass mysql:latest

Run MCP server on the same network:

docker run -i --rm --network mynet writenotenow/mysql-mcp:latest \
  --transport stdio --mysql "mysql://mcp_user:secure_password@mysql-db:3306/testdb"

Connect to Remote/Cloud MySQL (RDS, Cloud SQL, etc.)

Use the remote hostname directly:

[
  "--mysql",
  "mysql://mcp_user:secure_password@your-instance.region.rds.amazonaws.com:3306/testdb"
]
ProviderExample Hostname
AWS RDSyour-instance.xxxx.us-east-1.rds.amazonaws.com
Google Cloud SQLproject:region:instance (via Cloud SQL Proxy)
Azure MySQLyour-server.mysql.database.azure.com
PlanetScaleaws.connect.psdb.cloud (SSL required)
DigitalOceanyour-cluster-do-user-xxx.db.ondigitalocean.com

Tip: Ensure remote MySQL servers allow connections from Docker's IP range. Verify firewalls/security groups permit port 3306.


๐Ÿ› ๏ธ Optimize Limits with Tool Filtering

[!IMPORTANT] AI IDEs like Cursor have tool limits. Filter tools to ensure compatibility with IDE limits. We offer many specialized tools. All shortcuts and tool groups include Code Mode by default. To exclude it, add -codemode to your filter: --tool-filter core,json,-codemode

Discover Filtering Options

The --tool-filter argument accepts shortcuts, groups, or tool names โ€” mix and match freely:

Filter PatternExampleDescription
Shortcut onlystarterUse a predefined bundle
Groups onlycore,json,transactionsCombine individual groups
Shortcut + Groupstarter,spatialExtend a shortcut
Shortcut - Toolstarter,-mysql_drop_tableRemove specific tools

Use Predefined Shortcuts

ShortcutUse CaseWhat's Included
starterStandard Packagecore, json, transactions, text, codemode
essentialMinimal footprintcore, transactions, codemode
dev-powerPower Developercore, schema, performance, fulltext, transactions, codemode
dev-analyticsDeveloper Analyticscore, stats, performance, codemode
ai-data-nosqlAI Data NoSQLcore, json, docstore, codemode
ai-searchAI Searchcore, text, fulltext, vector, codemode
ai-spatialAI Spatial Analystcore, spatial, transactions, codemode
ai-vectorAI Vector Analystcore, vector, fulltext, codemode
dba-monitorDBA Monitoringcore, monitoring, performance, sysschema, optimization, codemode
dba-manageDBA Managementcore, admin, backup, replication, partitioning, events, codemode
dba-secureDBA Securitycore, security, roles, transactions, codemode
dba-schemaDBA Schemacore, schema, introspection, migration, codemode
base-relationalBase Relationalcore, transactions, text, schema, codemode
base-analyticsBase Analyticsstats, events, codemode
base-nosqlBase NoSQLdocstore, spatial, vector, codemode
ecosystemExternal Toolscluster, proxysql, router, shell, codemode

Filter by Tool Groups

Note: Code Mode (mysql_execute_code) is automatically added to all groups.

GroupDescription
codemodeCode Mode (sandboxed code execution) ๐ŸŒŸ Recommended
coreRead/write queries, tables, indexes
transactionsBEGIN, COMMIT, ROLLBACK, savepoints
jsonJSON functions, merge, diff, stats
textREGEXP, LIKE, SOUNDEX
fulltextNatural language & boolean search
performanceEXPLAIN, query analysis, anomaly detection
optimizationIndex hints, database-wide audits, EXPLAIN recommendations
adminOPTIMIZE, ANALYZE, CHECK, insights
monitoringPROCESSLIST, status variables
backupExport, import, mysqldump, audit backups
replicationMaster/slave, binlog
partitioningPartition management
schemaViews, procedures, triggers, constraints
introspectionDependency graphs, cascade simulation, snapshots
migrationSchema versioning, apply, rollback, history
shellMySQL Shell utilities
eventsEvent Scheduler management
sysschemasys schema diagnostics
statsStatistical analysis, window functions, sampling
spatialSpatial/GIS operations
securityAudit, SSL, encryption, masking
rolesMySQL role management
docstoreDocument Store collections
clusterGroup Replication, InnoDB Cluster
proxysqlProxySQL management
routerMySQL Router REST API
vectorVector embeddings, KNN search, hybrid search

Review Syntax Reference

Legacy Syntax (still supported): If you start with a negative filter (e.g., -ecosystem), it enables all tools first. It then subtracts the specified tools.

PrefixTargetExampleEffect
(none)ShortcutstarterWhitelist Mode: Enable ONLY this shortcut
(none)GroupcoreWhitelist Mode: Enable ONLY this group
(none)Toolmysql_read_queryWhitelist Mode: Enable ONLY this tool
+Group+spatialAdd tools from this group to current set
-Group-adminRemove tools in this group from current set
+Tool+mysql_explainAdd one specific tool
-Tool-mysql_drop_tableRemove one specific tool

Customize Tool Selection

List tool names without + prefix to create a custom whitelist.

The easiest way to filter is using whitelist mode. Simply specify the shortcut you want. Everything else is automatically disabled.

# Enable specific tools (whitelist mode)
--tool-filter "mysql_read_query,mysql_write_query,mysql_list_tables"

# Mix tools from different groups
--tool-filter "mysql_read_query,mysql_explain,mysql_json_extract"

# Combine with a shortcut or group
--tool-filter "starter,+mysql_spatial_distance,+mysql_json_diff"

Use this for automated clients requiring a minimal capability set.

๐Ÿ“– See the Tool Filtering Wiki for advanced examples.


๐Ÿ”ง Customize with Advanced Configuration

See the configuration templates in the project root for setup details.

For specialized setups, see these Wiki pages:

TopicDescription
MySQL RouterConfigure Router REST API access for InnoDB Cluster
ProxySQLConfigure ProxySQL admin interface access
MySQL ShellConfigure MySQL Shell for dump/load operations

โšก Maximize Server Performance

The server caches schema metadata to reduce repeated queries during tool/resource invocations.

Review Performance Benchmarks

The server handles millions of ops/sec across core execution paths. This ensures minimal latency and maximum throughput. Every component is tuned for enterprise-scale workloads. Enjoy sub-millisecond sandbox cold starts and optimized reverse lookups.

Benchmark Baselines:

  • parseToolFilter: ~32,000-62,000 ops/sec
  • CodeModeSandbox.create cold start: ~2.78M ops/sec
  • Sandbox dispose: ~2.37M ops/sec
  • SandboxPool init: ~109k ops/sec
  • Set.has tool check: ~4.4M ops/sec
  • Map.get reverse lookup: ~4.5M ops/sec
  • Map.get URI match: ~5.1M ops/sec
  • validateCode safe short: ~173k ops/sec
  • validateCode blocked: ~298k ops/sec
  • checkRateLimit: ~205k ops/sec
  • sanitizeResult small payload: ~1.49M ops/sec
  • prompt schema parse: ~1.3M ops/sec

Tip: Lower METADATA_CACHE_TTL_MS for development (e.g., 5000). Increase it for production with stable schemas (e.g., 300000 = 5 min).

Payload optimization: Tools support summary: true and limit parameters. These condense large payloads.


๐ŸŽ›๏ธ Master Server Configuration

Configure CLI Options

Note: Items marked with โ€” in the CLI flag column are configured exclusively via environment variables.

Documentation truncated โ€” see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!

Mysql MCP Server - Enterprise-grade MySQL MCP Server with OAuth 2.0, 106 | MCP Marketplace