Skip to content

Commit a2e2a49

Browse files
sharpninjaclaude
andcommitted
Expand federation local-only bypass list to prevent proxy loops
Add /api-key, /server-startup-utc, /marker-file-timestamp, /mcp-transport, and /mcpserver/workspace to the FederationMiddleware local-only path list. These infrastructure and workspace-management endpoints must never be proxied through federation — they either issue local tokens, serve local metadata, or handle workspace listing that is inherently per-server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0dbfd0c commit a2e2a49

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/McpServer.Support.Mcp/Middleware/FederationMiddleware.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,17 @@ public sealed class FederationMiddleware
2525
/// </summary>
2626
private static readonly string[] LocalOnlyPrefixes =
2727
[
28-
"/auth", // OIDC proxy (/auth/config, /auth/device, /auth/token, /auth/ui/*)
29-
"/connect", // Embedded IdentityServer endpoints
30-
"/.well-known", // OIDC discovery documents
31-
"/health", // Health checks
32-
"/ready", // Readiness probe
33-
"/swagger", // Swagger UI
28+
"/auth", // OIDC proxy (/auth/config, /auth/device, /auth/token, /auth/ui/*)
29+
"/connect", // Embedded IdentityServer endpoints
30+
"/.well-known", // OIDC discovery documents
31+
"/health", // Health checks
32+
"/ready", // Readiness probe
33+
"/swagger", // Swagger UI
34+
"/api-key", // Local workspace token issuance
35+
"/server-startup-utc", // Local server metadata
36+
"/marker-file-timestamp", // Local marker file state
37+
"/mcp-transport", // MCP JSON-RPC — clients target servers directly
38+
"/mcpserver/workspace", // Workspace list/info is always local
3439
];
3540

3641
private readonly RequestDelegate _next;

0 commit comments

Comments
 (0)