hermes-backup/daily/2026-04-28_203212/skills/devops/arifos-mcp-sse-debug/SKILL.md
Diagnose arifOS MCP SSE 404 errors — from transport mismatch to import failure root causes
npx skillsauth add ariffazil/openclaw-workspace arifos-mcp-sse-debugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
docker logs arifosmcp shows GET /sse HTTP/1.1 404/health returns degraded or unhealthybundle-mcp reports failed to start server "arifos" with SSE 404The SSE 404 is a symptom, not the cause. The real failure chain:
arifosmcp/runtime/prompts.py → V2_PROMPT_SPECS import fails →
→ FastAPI starts (health endpoint works) →
→ MCP component fails to initialize →
→ /sse route never registered →
→ OpenClaw bundle-mcp gets 404
Exact error signal:
{"status":"degraded","error":"Import failed: cannot import name 'V2_PROMPT_SPECS'
from 'arifosmcp.runtime/prompts.py' (/usr/src/app/arifosmcp/runtime/prompts.py)"}
When you see this — the MCP routes are NOT registered. Fix the import, rebuild the container.
curl -s http://localhost:8080/health
Expected: 200 OK with full JSON status
Degraded signal: {"status":"degraded","error":"Import failed..."}
curl -s -H "Accept: text/event-stream" http://localhost:8080/sse
Expected: SSE stream or redirect
Actual (broken): {"detail":"Not Found"}
curl -s -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
If returns 406 Not Acceptable with message about Accept header requiring both application/json AND text/event-stream — the MCP is running but correctly configured. If 404 → MCP routes not registered.
docker logs arifosmcp --tail 50 2>&1
Look for: Import failed, ModuleNotFoundError, AttributeError, Application shutdown complete
docker exec arifosmcp env | grep -E "ARIFOS|MCP|TRANSPORT|PORT"
Key: AAA_MCP_TRANSPORT=http means streamable-http (not SSE as a separate server)
AAA_MCP_TRANSPORT=http + GET /sse 404 + POST /mcp 406 → MCP component failed to initialize (import error), NOT a transport mismatchAAA_MCP_TRANSPORT=http + POST /mcp works + SSE 200 → MCP healthy, SSE works via upgradeAAA_MCP_TRANSPORT=sse + SSE not working → transport misconfiguration, different fix pathcurl -s -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
| Response | Meaning |
|----------|---------|
| {"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Not Acceptable..."}} | MCP running but client Accept header incomplete |
| 406 Not Acceptable (raw) | MCP working, need both application/json AND text/event-stream in Accept |
| 404 Not Found | MCP routes not registered — MCP component failed to initialize |
| Missing Content-Type header | Client sending wrong Content-Type |
| "detail":"Method Not Allowed" on GET /mcp | ✅ HEALTHY — POST-only endpoint, MCP routes registered correctly |
CRITICAL: Accept header must include both MIME types simultaneously. Sending just application/json returns 406 even when MCP is healthy.
INFO: Shutting down
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
INFO: Finished server process [1]
This sequence → the process exited cleanly but was then restarted by the container orchestrator. The MCP server started, crashed, and was restarted. The import failure causes this cycle.
curl -s -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
| Response | Meaning |
|----------|---------|
| {"jsonrpc":"2.0","id":"server-error","error":{"code:-32600,"message":"Not Acceptable..."}} | MCP running but client Accept header incomplete |
| 406 Not Acceptable (raw) | MCP working, need both application/json AND text/event-stream in Accept |
| 404 Not Found | MCP routes not registered — MCP component failed to initialize |
| Missing Content-Type header | Client sending wrong Content-Type |
| Method Not Allowed on GET /mcp | Normal — POST-only endpoint when MCP healthy |
docker ps --format "table {{.Names}}\t{{.Status}}" | grep arifosmcp
If uptime is 1 second → health check restarted the container after it crashed
| Signal | Meaning |
|--------|---------|
| GET /sse HTTP/1.1 404 in logs | MCP routes not registered |
| /health returns degraded + import error | Code-level init failure — MCP component failed |
| Container restarting repeatedly | Health check triggering restart loop |
| 406 Not Acceptable on POST /mcp | MCP running but client missing Accept: text/event-stream |
| docker ps shows uptime 1 second | Health check triggered a restart after degraded state |
| Missing Content-Type header in logs | Client sending wrong Content-Type to POST /mcp |
| "Method Not Allowed" on GET /mcp | Normal — POST-only endpoint when MCP is healthy |
arifosmcp/runtime/prompts.pycurl -s http://localhost:8080/health returns healthyAAA_MCP_TRANSPORT=http → SSE not a separate server, it's an MCP protocol featurehttp://localhost:8080 as the MCP server/mcp with correct headers works; SSE upgrade succeedscurl without -H "Accept: text/event-stream" — you'll get a 406 even when MCP is healthy"status":"degraded" not just HTTP status/sse returns 404 even though the HTTP server is running1 second means health check caught a degraded/crashed state — always check logs for the Shutting down signalPOST /mcp with only application/json Accept header returns 406 even when healthy — must include text/event-streamdevelopment
Federation-wide gold (XAUUSD) trading capability. Python stack, OANDA broker, backtesting, macro signals, RSI strategy. Every organ has a role.
development
Capital claim state management — tracks claim lifecycle across WEALTH organ.
development
Archived constitutional warga placeholder retained only for audit provenance. Do not use for active work; use the live arifOS governance and constitutional skills instead.
testing
Warga (citizen) agent skills for AAA federation members. See subdirectories for specialized warga skills.