mysql-router

mysql-router is a skill for Claude Code, Codex from neverinfamous/mysql-mcp. It costs 84 tokens per session (1,451 once invoked), scanned A, original, MIT.

A production guide for MySQL Router, software that directs application connections to the right server in a MySQL InnoDB Cluster. An InnoDB Cluster is a group of MySQL servers designed to keep applications available if one server fails.

In plain words
What is it for?
Use it to configure or troubleshoot MySQL Router, choose routing strategies, set up high-availability connections, and integrate it with an InnoDB Cluster.
Why use it?
It sets rules for discovering the cluster, routing reads and writes, and handling failover. This avoids fragile manual server lists and supports changes in the cluster topology.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to configure or troubleshoot MySQL Router, choose routing strategies, set up high-availability connections, and integrate it with an InnoDB Cluster.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/neverinfamous/mysql-mcp/mysql-router
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add neverinfamous/mysql-mcp --skill mysql-router
Clone the repo
git clone --depth 1 https://github.com/neverinfamous/mysql-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mysql-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/neverinfamous/mysql-mcp/mysql-router/github.svg)](https://agentmods.dev/skills/neverinfamous/mysql-mcp/mysql-router)
Your own site
<a href="https://agentmods.dev/skills/neverinfamous/mysql-mcp/mysql-router"><img src="https://agentmods.dev/badge/skills/neverinfamous/mysql-mcp/mysql-router/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mysql-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/neverinfamous/mysql-mcp/mysql-router"><img src="https://agentmods.dev/badge/skills/neverinfamous/mysql-mcp/mysql-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00084 $0.01451
Opus 5 $0.00042 $0.00726
Sonnet 5 $0.00017 $0.00290
Haiku 4.5 $0.00008 $0.00145

Measured 9d ago against content hash e3776f1d578c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

mysql-router scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mysql-router/SKILL.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MySQL Router Production Standards

MySQL Router is lightweight middleware providing transparent routing between applications and MySQL servers, purpose-built for InnoDB Cluster high availability.

1.1 Architecture & Bootstrap

  • Bootstrap-First: [ALWAYS] use mysqlrouter --bootstrap user@primary:3306 --directory /etc/mysqlrouter --user mysqlrouter for InnoDB Cluster deployments. Bootstrap auto-discovers topology, creates internal router accounts, generates mysqlrouter.conf, and registers the router in mysql_innodb_cluster_metadata.
  • Never Manual for Clusters: [NEVER] manually configure cluster node addresses in mysqlrouter.conf. Always rely on bootstrap + metadata cache for automatic failover discovery.
  • Metadata Cache: Router maintains a persistent connection to the cluster, polling performance_schema for topology changes. Tune the TTL (e.g., ttl=0.5) for faster failover detection when needed.

1.2 Routing Strategies

Strategy Use Case Default Port
first-available Primary writes (fails over to next available) 6446 (R/W)
round-robin Read distribution across replicas 6447 (R/O)
round-robin-with-fallback HA reads with fallback to primary
next-available Sticky connections
  • Read/Write Splitting: Router natively separates write traffic (port 6446 → primary) and read traffic (port 6447 → secondaries). Applications MUST use distinct connection strings for reads vs writes.
  • Sidecar Deployment: [ALWAYS] deploy Router as close to the application layer as possible (e.g., as a sidecar container) to eliminate single points of failure and minimize network latency.

1.3 Connection Sharing (8.0.33+ / 8.4 LTS)

  • Mechanism: Instead of terminating server connections on client disconnect, idle connections are pooled and reused. Governed by connection_sharing_delay.
  • Limitations: Unsupported in PASSTHROUGH mode. Sessions using GET_LOCK() or LAST_INSERT_ID() may prevent safe pooling.
  • MCP Tool: mysql_router_pool_status requires connection_sharing=1 on at least one route to return data.

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 139 lines · 84 tokens per session scan A e3776f1d578c

Subscribe to this mod's changes

mysql-router is a skill published in the GitHub repository neverinfamous/mysql-mcp (10 stars, last pushed 2d ago), licensed MIT. It adds 84 tokens to every session and 1,451 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.