360 Secure SkillHub
360 安全技能中心

mcp-http-auth-fallback-diagnosis

核心功能为分步诊断MCP HTTP认证回退类错误,通过对比配置凭证与运行时凭证的测试结果,区分凭证漂移、传输或协议问题,同时核查运行时插值支持情况。典型场景是HTTP MCP客户端报401/405等错误且端点曾正常、凭证可能轮换。需输入客户端配置信息,输出问题定位结论及修复建议,全程避免暴露敏感凭证,最终需验证客户端操作恢复正常。

nextaltair
nextaltair
热度 7.65
最近更新 2026-09-02 16:43:29
分类:开发依赖:MCP 服务 / 代码执行应用场景:调试排错 / API 集成 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add mcp-http-auth-fallback-diagnosis
Metadata
name
mcp-http-auth-fallback-diagnosis
description
Diagnose MCP HTTP 401/405 fallback errors by isolating credentials, transport, and runtime interpolation.

MCP HTTP authentication fallback diagnosis

When to use

Use when an HTTP MCP client reports 401, 405, or a fallback/SSE error and the endpoint previously worked or credentials may rotate.

Procedure

  1. Record the configured endpoint, transport, auth mode, and header shape. Never print credential values.
  2. Test the primary MCP endpoint directly with the configured credential and an MCP initialize request. Capture only HTTP status and protocol response.
  3. Repeat with the current trusted runtime credential, keeping endpoint and request identical.
  4. Interpret the split:
    • configured credential fails, runtime credential succeeds: credential drift; do not blame transport.
    • both fail identically: continue endpoint, protocol, and transport diagnosis.
    • primary request returns 401 before a later 405: treat the 405 as possible fallback noise until authentication is resolved.
  5. Inspect the installed client's documentation or source to confirm whether HTTP headers support environment interpolation. Do not assume config interpolation matches command-argument interpolation.
  6. If supported, replace the static secret with the documented runtime environment placeholder. Keep the secret out of persisted config and logs.
  7. Ensure the launching process actually receives the environment variable; a correct placeholder with a missing variable is not a fix.
  8. Re-run the client's schema/list operation against the named server. For mcporter, the evidenced check is mcporter list <server> --schema --output json.

Pitfalls

  • Diagnosing the final fallback status instead of the first primary-endpoint failure.
  • Rotating the external token while leaving a copied Bearer token in client config.
  • Claiming interpolation support from general docs without checking header materialization.
  • Comparing or logging full tokens; compare presence or equality without exposing values.
  • Declaring recovery from a raw HTTP 200 alone; verify through the actual MCP client.

Verification

Require both:

  1. Primary MCP initialize succeeds with the runtime-backed header and returns a protocol response.
  2. The actual client lists the server schema successfully without exposing the credential.