HTTP MCP Server OAuth authentication (Visual Studio Code MCP Support) - #154
Conversation
Consolidates this branch's work to tighten token/session security, add OAuth provider and integration test coverage, and improve HTTP diagnostics and deployment workflows for local and remote MCP usage. Also updates docs, tooling, and dependency versions needed to support the new auth and release behavior.
|
Hey @andreasmcdermott Thanks for getting in there and checking stuff, I have a bad habit of creating PRs without Draft mode.. I've finished merging the old/new docs and tablifying (I think?) I also pulled out the developer stuff into its own doc. I think it makes more sense. |
andreasmcdermott
left a comment
There was a problem hiding this comment.
One section was not copied from the README to the new markdown file. Other than that looks good!
|
@CodeRabbit Please review this PR. |
|
✅ Actions performedReview triggered.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThis PR adds a full OAuth 2.0 (PKCE) proxy/provider flow and bearer-auth to the MCP server, refactors server session/client handling, introduces OAuth tests, updates CI/CD workflows, overhauls documentation and README, adjusts deployment script mounting, and updates package.json dependencies and scripts. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as AI Client (Cursor/Windsurf)
participant MCP as MCP Server
participant AuthSvr as Shortcut OAuth Server
participant API as Shortcut API
Client->>MCP: GET /.well-known/mcp-configuration (discovery)
MCP->>Client: returns OAuth metadata
Client->>MCP: GET /authorize (code_challenge)
MCP->>AuthSvr: Redirect to upstream /authorize
AuthSvr->>Client: Authorization page / consent
Client->>AuthSvr: User approves -> redirect with code
Client->>MCP: /oauth/callback (auth code)
MCP->>AuthSvr: POST /token (exchange code for tokens)
AuthSvr->>MCP: access_token + refresh_token
MCP->>MCP: cache tokens, create session (accessToken + clientWrapper)
Client->>MCP: POST /mcp/initialize (Bearer access_token)
MCP->>API: validate token via Shortcut API (if needed)
API->>MCP: token verification result
MCP->>Client: session initialized / transport ready
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
|
✅ Actions performedReview triggered.
|
OAuth proxy foundation (HTTP server)
src/auth/provider.ts.src/server-http.ts./oauth/callback) and upstream token exchange/refresh handling.Security hardening
src/server-http.ts(including helper methods and enforcement on session reuse paths).Auth testing coverage
src/auth/oauth.test.ts.src/auth/oauth-integration.test.ts.Operational config behavior
OAUTH_ALLOWED_REDIRECT_URIS(comma-delimited env var) in provider startup path.MCP_SERVER_URLis used to derive OAuth issuer/base/resource metadata identity (important for env isolation and VS Code cache behavior).CI/CD and deploy pipeline changes
.github/workflows/pipeline.ymlto split/build dependencies (build-docker+build-scripts) and update deploy job wiring.build_ecr_image.yml) and CodeDeploy startup behavior (including env file mount in start script).Supporting app/library updates
src/client/shortcut.tsupdates (token/client handling support for refreshed sessions).README.mdanddocs/oauth-proxy-implementation.mdupdates.package.json/package-lock.jsonchurn from dependency/script updates.Summary by CodeRabbit
New Features
Documentation
Chores
Tests