EXPECT="05c8f7892be09cefb23bafb3680e30c1ecbe83e71ab1a653e398a783a2d4774f"
echo "=== server EXPECTED token sha256: $EXPECT ==="
echo ""
echo "=== AMD MCP entry in ~/.claude.json (url + auth header, token hashed) ==="
python3 - <<'PY'
import json,hashlib,re
for path in ["/home/claude/.claude.json","/home/claude/.claude/mcp_settings.json"]:
    try:
        d=json.load(open(path))
    except Exception as e:
        print(f"{path}: ERR {e}"); continue
    found=False
    def walk(o,p=""):
        global found
        if isinstance(o,dict):
            for k,v in o.items():
                kl=str(k).lower()
                if isinstance(v,(dict,list)):
                    # detect amd server block
                    blob=json.dumps(v).lower()
                    if ("18812" in blob or "advancedmd" in kl) and isinstance(v,dict):
                        url=v.get("url") or v.get("serverUrl") or ""
                        hdrs=v.get("headers") or {}
                        auth=""
                        for hk,hv in (hdrs.items() if isinstance(hdrs,dict) else []):
                            if hk.lower()=="authorization": auth=hv
                        tok=re.sub(r'^Bearer\s+','',auth).strip() if auth else ""
                        h=hashlib.sha256(tok.encode()).hexdigest() if tok else "(no token)"
                        print(f"{path} :: key='{k}' url={url}")
                        print(f"    auth-header-present={bool(auth)} token_sha256={h}")
                        found=True
                    walk(v,p+"/"+str(k))
        elif isinstance(o,list):
            for i,v in enumerate(o): walk(v,p+f"[{i}]")
    walk(d)
    if not found: print(f"{path}: no advancedmd/18812 server entry found")
PY
echo ""
echo "=== raw grep of advancedmd context in .claude.json (token NOT shown) ==="
grep -o '"advancedmd[^"]*"' ~/.claude.json 2>/dev/null | sort -u | head
grep -o 'tail[0-9a-z]*\.ts\.net[^"]*18812[^"]*' ~/.claude.json 2>/dev/null | head
