/mokata:mcp-repair runs instead · from mokata
Repairs an already-installed mokata MCP server when its tools aren't connecting — diagnoses registration, rewrites it, and tells the user to restart Claude Code.
This skill never runs in Claude Code
It ships in mokata at src/, but /mokata:mcp-repair (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
mokata Agent Skill. This is mokata's
mcp-repaircapability, surfaced so Claude can engage it automatically when the moment fits. It runs the SAME protocol as the/mokata:mcp-repaircommand, from one shared source — follow that protocol directly here; do not hand off to a parallel flow. mokata's non-negotiables still hold: MCP write proposals are staged for your approval (record tools and CLI writes are not); follow this capability's own gate.
⛭ mokata mcp-repair active — gate: re-check and rewrite the MCP registration, then you restart Claude Code
The user thinks mokata's MCP tools aren't connecting. Your job: diagnose → repair → re-verify →
report, using ONLY the existing mokata mcp CLI (it already does the real handshake and the
merge-safe, idempotent registration). Then be honest about the one thing you cannot do from inside
the session — restart Claude Code — because a newly-registered MCP server only loads on the
next Claude Code launch.
${CLAUDE_PLUGIN_ROOT} is NOT expanded inside command bodies, so discover the bundled engine:
Read the cached plugin root: cat ~/.mokata/plugin-root → ROOT.
If that file is missing/empty, search the Claude Code plugins directory for a mokata plugin
containing src/mokata/__init__.py and set ROOT to it. (If a mokata CLI is on PATH, use
it directly.)
Define the engine as a shell FUNCTION on the absolute interpreter — arguments then reach
it as separate words, never re-parsed by eval (pass user or repo text single-quoted):
PY="$(command -v python3 || command -v python)"
mokata() { PYTHONPATH="$ROOT/src" "$PY" -m mokata "$@"; } # skip when a `mokata` CLI is on PATH
Run the real initialize handshake against whatever is currently registered:
mokata mcp status
mokata-mcp: CONNECTED ✓ → nothing is broken. Tell the user the server is already
connected and stop (no write). If they still don't see the tools, the fix is almost always a
restart of Claude Code — say so.NOT CONNECTED ✗ (…) / NOT REGISTERED ✗ → note the specific cause the command
printed (e.g. not_registered, command_not_found, sdk_absent, timeout) and go to step 3.
sdk_absent, the repair is NOT a re-registration — the MCP SDK needs
Python ≥ 3.12. Relay the command's own one-line fix (pip install -U mokata on ≥ 3.12) and
stop; do not pretend install will fix it.mokata mcp install writes/repairs the Claude Code registration (.mcp.json, or
~/.claude.json for user scope), resolving mokata-mcp to an absolute path. It writes directly:
it neither asks nor takes --yes. It is merge-safe
(it leaves your other MCP servers and keys alone) and idempotent (safe to run again). Tell the
user you're about to repair the registration, then run it:
mokata mcp install
# user-scope registration instead of this project only:
# mokata mcp install --scope user
Confirm the repair actually took, using the same handshake:
mokata mcp status
In one short block, tell the user plainly:
/mcp should list
mokata as connected.If the re-check still fails after a good install, do NOT loop — report the exact failure code and
the one-line fix the command gave, and let the user act on it.
If a step appears stuck, or the harness stops it mid-run: run mokata resume (where the run stands and the gate that still applies) and mokata approve --list (anything waiting on a human). Run state, approvals and the audit ledger are kept on disk, so re-invoke /mokata:mcp-repair to continue. Where the harness limits foreground time, start a long test run in the background; mokata doctor names a hung MCP server or a hook that is not firing.
| Excuse | Reality |
|---|---|
| "I'll set it up fresh from scratch." | This is REPAIR, not first-time setup — use /mokata:setup to install. |
| "I'll rewrite the config file directly." | Use mokata mcp install, which writes the registration directly with no approval prompt — tell the user what you are about to write first. |
| "It's fixed — no need to restart." | Name the one step left: the user restarts Claude Code so it re-reads the registration. |
Evidence, not "seems right" — check every box or say which is unmet and why:
mokata mcp installCAN
MUST NOT
mokata mcp install, which writes directly: it neither asks nor takes --yes, so say what you are about to write first (advisory)DEPENDS ON
Grounding:
(gate: …)boundaries name the gate that backs them;(advisory)ones are protocol discipline this skill follows, not a hard block. What mokata enforces, and what it doesn't: mokata.ai/security
What SKILL.md sets; muted values are Claude Code's defaults
Engage when the user reports mokata's MCP server or tools aren't working — e.g. "mokata mcp isn't working / isn't connected / failed to start", "the mokata MCP server won't start", "mokata's tools are missing / don't show up / aren't available", or "/mcp doesn't list mokata". This REPAIRS an already-installed mokata by re-checking and re-writing its Claude Code registration, then tells the user to restart Claude Code. Do NOT engage for first-time setup or initial wiring — use /mokata:setup for that; this is repair of an existing install, not initial installation.
Three short reads, in order
npx claudepluginhub jasgujral/mokata-oss --plugin mokata30 skills in this plugin
/apimokata · API & interface design — contract-first, blast-radius on every change./backend-nestjsmokata · NestJS rule pack — impact-ordered rules for modules, guards, DTOs and providers, loaded by the spec's routing./brainstormmokata · Socratic pre-spec exploration — explore approaches WITH the user, one question at a time, and stop for explicit approval before the spec. Runs standalone or as the front of mokata's pipeline./browser-testingmokata · Browser testing (DevTools) — live runtime captured via the existing MCP surface, fed to the test gate./bugmokata · Start from a reproducer and a failing test, then fix./ci-cdmokata · CI/CD & automation — the quality-gate pipeline + Scorecard posture, not a suggestion.Other plugins' skills for the same job