Functions§
- inject_
www_ 🔒authenticate - Tower middleware: 如果下游(MCP service)返回 401/403 又没
WWW-Authenticate头,补一个Bearer resource_metadata="...",指向/.well-known/oauth-protected-resource。 - oauth_
protected_ 🔒resource_ metadata - RFC 9728 — OAuth 2.0 Protected Resource Metadata
- render_
mcp_ 🔒metrics_ body - HTTP 模式:axum + rmcp StreamableHttpService,
/mcp路径跑 MCP,/metrics暴露 Prometheus counters(无需 token),/.well-known/oauth-protected-resource暴露 OAuth2 Protected Resource Metadata(RFC 9728,给 MCP 客户端发现鉴权要求用)。 - render_
mcp_ 🔒metrics_ body_ for - serve_
http 🔒 - shutdown_
signal 🔒 - 监听 SIGTERM / SIGINT,任一到达即返回。 同时兼容 Windows(只有 ctrl_c)和 Unix(SIGTERM + SIGINT)。
- wait_
for_ 🔒ctrl_ c_ or_ pending