feat: add MCP OAuth auth module with RestApi integration - #380
Merged
Conversation
- Add service-agnostic mcp-auth module (handlers, MCP server, JSON-RPC) - Add McpAuth CDK construct creating 5 Lambda functions for OAuth endpoints - Add McpCognitoAuth convenience construct for Cognito-backed auth - Integrate into RestApi via mcpAuth prop (cognito or generic config) - Auto-inject OAuth discovery, authorize, token, register paths into OpenAPI spec - All MCP auth endpoints are anonymous (no authorizer) - apiDomain and stageName derived from RestApi props (no duplication)
hoegertn
force-pushed
the
feat/mcp-auth
branch
from
August 24, 2026 11:41
8010814 to
2dbd7c1
Compare
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Add 62 unit tests across 3 suites (construct, handlers, MCP server) - Update llm.md with MCP auth usage, interfaces, and examples
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Critical: - Replace regex param stripping with URLSearchParams in token handler - Add grant_type validation (authorization_code, refresh_token only) - Increase Lambda timeout to 15s (exceeds 10s fetch abort) Warnings: - Refactor createMcpAuth cognito path to use McpCognitoAuth (no duplication) - Add env var validation in getConfigFromEnv - Add ordering/rationale comments for MCP auth injection and permissions Tests: - Add RestApi+mcpAuth integration test (5 paths with security:[]) - Add grant_type validation tests to token handler suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their setup due to this PR?)
Other information: