agentleFS
Ex-imanityEx-imanity/SkillCollections/skills/gapm-mcp-recovery/SKILL.md

gapm-mcp-recovery

Skill1 starsChanged 2 months agoMITView on GitHub

Use when GAPM MCP tools are missing from Codex, gapm_agent_tools is unavailable, OAuth reports invalid_client or authentication_required, App Server shows serverInfo null or empty tools, or a GAPM log investigation appears to require restarting Codex or opening a new conversation.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run from the current project:

    line 15
  2. Distinctive:

    Verify connectivity without business identifiers:

    line 39
  3. Very specific:

    Put Tool arguments in a Git-ignored .local JSON file, then call through an ephemeral read-only App Server thread:

    line 47
  4. Very specific:

    No matching logs does not prove an Agent or downstream call did not occur.

    line 67
  5. Very specific:

    Keep arguments, raw logs, trace IDs, question IDs, uid and sid under .local/.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Recovering GAPM MCP

Overview

Separate MCP service health from the current conversation's Tool snapshot. A healthy App Server can call GAPM through the bundled bridge even when native gapm_* tools are absent, so restarting Codex is a last resort.

Quick Workflow

Run from the current project:

python3 "$HOME/.codex/skills/gapm-mcp-recovery/scripts/gapm_mcp.py" status

Interpret state:

StateAction
HEALTHYUse native Tool if present; otherwise use bridge call. Do not restart.
AUTH_REQUIREDRun login, complete browser authorization, then rerun status.
CONFIG_MISSINGAdd the server using the returned recommended_command, then rerun status.
CONFIG_INVALIDReview and run the returned remove/add commands, then rerun status.
TOOLS_MISSING / STARTUP_FAILEDReport the returned error. Retry once before asking the MCP owner to investigate.

OAuth recovery:

python3 "$HOME/.codex/skills/gapm-mcp-recovery/scripts/gapm_mcp.py" login

Tell the user when browser authorization is required. Do not logout first; only clear credentials if direct login repeatedly fails.

Verify connectivity without business identifiers:

python3 "$HOME/.codex/skills/gapm-mcp-recovery/scripts/gapm_mcp.py" smoke

Call Without Restarting

Put Tool arguments in a Git-ignored .local JSON file, then call through an ephemeral read-only App Server thread:

python3 "$HOME/.codex/skills/gapm-mcp-recovery/scripts/gapm_mcp.py" call \
  --tool gapm_log_query_v2 \
  --arguments-file .local/gapm/query.json \
  --output .local/gapm/result.json

The bridge supports only the three known GAPM read tools. It never calls mainSearch, modifies production data, or prints raw GAPM results to the conversation.

Restart Boundary

Restart only when native Tool injection itself is required and the bridge cannot satisfy the task. Before restarting, update the project's MRS. After restart, reopen the same task first; create a new task only if the old task still has a stale Tool snapshot.

Evidence Rules

  • enabled or OAuth from codex mcp list/get is configuration evidence, not health evidence.
  • serverInfo plus all three enumerated tools proves App Server health.
  • A successful empty smoke result proves connectivity.
  • No matching logs does not prove an Agent or downstream call did not occur; record TELEMETRY_MISSING or INSUFFICIENT_DATA.
  • Keep arguments, raw logs, trace IDs, question IDs, uid and sid under .local/.

Report

Respond in Chinese with: detected state, evidence checked, action taken, whether restart was avoided, and any remaining user action. Never paste raw logs or credentials.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.