-
Notifications
You must be signed in to change notification settings - Fork 0
MySQL Router
Temp edited this page Dec 13, 2025
·
1 revision
MySQL Router tools allow monitoring and management of MySQL Router instances via the REST API.
- MySQL Router 8.0.17+ with REST API enabled
- Router REST API credentials (username/password)
- Network access to Router REST API endpoint (default: HTTPS on port 8443)
| Tool | Description |
|---|---|
mysql_router_status |
Get Router process status and version |
mysql_router_routes |
List all configured routes |
mysql_router_route_status |
Get status of a specific route |
mysql_router_route_health |
Check health/liveness of a route |
mysql_router_route_connections |
List active connections on route |
mysql_router_route_destinations |
List backend MySQL server destinations |
mysql_router_route_blocked_hosts |
List blocked IP addresses for a route |
mysql_router_metadata_status |
InnoDB Cluster metadata cache status |
mysql_router_pool_status |
Connection pool statistics |
Ensure your mysqlrouter.conf includes the REST API plugins:
[http_server]
port=8443
ssl=1
ssl_cert=/path/to/router-cert.pem
ssl_key=/path/to/router-key.pem
[http_auth_realm:default_auth_realm]
backend=default_auth_backend
method=basic
name=default_realm
[http_auth_backend:default_auth_backend]
backend=file
filename=/path/to/mysqlrouter.pwd
[rest_router]
require_realm=default_auth_realm
[rest_routing]
require_realm=default_auth_realm
[rest_metadata_cache]
require_realm=default_auth_realm
[rest_connection_pool]
require_realm=default_auth_realm# Generate password hash (prompts for password)
mysqlrouter_passwd set /path/to/mysqlrouter.pwd router_admin| Variable | Default | Description |
|---|---|---|
MYSQL_ROUTER_URL |
https://localhost:8443 |
Router REST API base URL |
MYSQL_ROUTER_USER |
- | Router API username |
MYSQL_ROUTER_PASSWORD |
- | Router API password |
MYSQL_ROUTER_API_VERSION |
/api/20190715 |
API version path |
MYSQL_ROUTER_INSECURE |
false |
Skip TLS verification (for self-signed certs) |
⚠️ Never commit Router credentials to version control. Use environment variables or secure secrets management.
{
"mcpServers": {
"mysql-mcp": {
"command": "node",
"args": [
"C:/path/to/mysql-mcp/dist/cli.js",
"--transport", "stdio",
"--mysql", "mysql://user:password@localhost:3306/database"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "app_user",
"MYSQL_PASSWORD": "secure_password",
"MYSQL_DATABASE": "production",
"MYSQL_ROUTER_URL": "https://router.example.com:8443",
"MYSQL_ROUTER_USER": "router_admin",
"MYSQL_ROUTER_PASSWORD": "router_password",
"MYSQL_ROUTER_INSECURE": "true"
}
}
}
}If you only want Router tools (e.g., for a dedicated monitoring agent):
{
"args": [
"--transport", "stdio",
"--mysql", "mysql://user:password@localhost:3306/database",
"--tool-filter", "-core,-json,-text,-fulltext,-performance,-optimization,-admin,-monitoring,-backup,-replication,-partitioning,-transactions,-proxysql,-shell"
]
}This exposes only the 9 Router management tools.
- Tool-Reference - Complete tool list
- Tool-Filtering - Custom tool filtering
- Configuration - General configuration
mysql-mcp • v1.0.0 • MIT License
mysql-mcp Wiki
Getting Started
Tools
Advanced Topics
Links