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.
In this repository9 other files it gives its agents.
- case-design-strategy-skillSkill
- case-liteSkill
- case-reorganizeSkill
- context-resilient-taskSkill
- cross-agent-reviewSkill
- dify-dsl-generatorSkill
- internal-api-cookie-authSkill
- repository-code-styleSkill
- whitebox-op-comboSkill
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
- Distinctive: line 15
Run from the current project:
- Distinctive: line 39
Verify connectivity without business identifiers:
- Very specific: line 47
Put Tool arguments in a Git-ignored .local JSON file, then call through an ephemeral read-only App Server thread:
- Very specific: line 67
No matching logs does not prove an Agent or downstream call did not occur.
- Very specific: line 68
Keep arguments, raw logs, trace IDs, question IDs, uid and sid under .local/.
≈ “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.
Files
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" statusInterpret state:
| State | Action |
HEALTHY | Use native Tool if present; otherwise use bridge call. Do not restart. |
AUTH_REQUIRED | Run login, complete browser authorization, then rerun status. |
CONFIG_MISSING | Add the server using the returned recommended_command, then rerun status. |
CONFIG_INVALID | Review and run the returned remove/add commands, then rerun status. |
TOOLS_MISSING / STARTUP_FAILED | Report 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" loginTell 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" smokeCall 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.jsonThe 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
enabledorOAuthfromcodex mcp list/getis configuration evidence, not health evidence.serverInfoplus 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_MISSINGorINSUFFICIENT_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.
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
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.

