Getting ready for secure MCP with Quarkus MCP Server #47572
Replies: 3 comments 19 replies
-
|
This is almost the topic that I needed at the moment and definitely one that I need a little later. :) |
Beta Was this translation helpful? Give feedback.
-
|
From here: Is it correct that this .well-known/oauth-protected-resource endpoint is not implemented automatically by the quarkus-oidc SDK? Is there a recommended way to accomplish this? Or should I just manually create a .well-known/oauth-protected-resource endpoint in my MCP server? |
Beta Was this translation helpful? Give feedback.
-
|
Quarkus version: 3.25.3 When I make a request to my mcp server without a token, quarkus correctly returns 401 with resource metadata url based on but the response doesnt contain auth-server, the way documentation mentions at https://quarkus.io/guides/security-oidc-expanded-configuration#resource-metadata-properties
quarkus:
oidc:
auth-server-url: "https://autorization-server"
resource-metadata:
enabled: true
resource: "https://${server.host}/.well-known/oauth-protected-resource"
# sample response
❯ curl -i https://my-mcp-server/mcp
HTTP/2 401
www-authenticate: Bearer resource_metadata="https://my-mcp-server/.well-known/oauth-protected-resource"
content-length: 0
# cursor output
2025-10-29 20:37:06.478 [info] Handling CreateClient action
2025-10-29 20:37:06.478 [info] Creating streamableHttp transport
2025-10-29 20:37:06.478 [info] Connecting to streamableHttp server
2025-10-29 20:37:06.478 [info] No stored tokens found
2025-10-29 20:37:09.082 [info] No stored client information found
2025-10-29 20:37:09.084 [info] Using redirect URL {"url":"cursor://anysphere.cursor-mcp/oauth/user-my-mcp-server/callback"}
2025-10-29 20:37:09.562 [error] Client error for command HTTP 401: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
2025-10-29 20:37:09.563 [info] Client closed for command
2025-10-29 20:37:09.563 [error] Error connecting to streamableHttp server, falling back to SSE: HTTP 401: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
2025-10-29 20:37:09.563 [error] Error connecting to streamableHttp server, falling back to SSE: HTTP 401: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
2025-10-29 20:37:09.563 [info] Connecting to SSE server
2025-10-29 20:37:09.564 [info] No stored tokens found
2025-10-29 20:37:11.082 [info] No stored client information found
2025-10-29 20:37:11.083 [info] Using redirect URL {"url":"cursor://anysphere.cursor-mcp/oauth/user-my-mcp-server/callback"}
2025-10-29 20:37:11.705 [error] Client error for command HTTP 401: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
2025-10-29 20:37:11.705 [error] Error connecting to SSE server after fallback: HTTP 401: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Getting ready for secure MCP with Quarkus MCP Server
Quarkus: Supersonic Subatomic Java
https://quarkus.io/blog/secure-mcp-sse-server/
Beta Was this translation helpful? Give feedback.
All reactions