Commit Graph

4 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 6d30396776 Add session info to auth_login tool response
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
License Check / license-check (push) Has been cancelled
- Add GetSessionInfo callback to AuthToolDependencies
- Fetch user info and configuration after successful authentication
- Display comprehensive session context in auth_login success message
- Remove unused middleware functions that were adding to _meta
- Revert instructions.go to original (no longer modifying instructions)

The auth_login tool now provides the model with:
- User account details (username, name, email, company, location, profile URL)
- Enabled toolsets and tools
- Configuration flags (read-only, lockdown, dynamic toolsets)

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2025-12-21 08:42:49 +00:00
copilot-swe-agent[bot] b7243b8251 Add session info metadata to initialize response
- Add middleware to enrich InitializeResult with session information
- Include user details (get_me response) in authenticated mode
- Include enabled toolsets, tools, read-only mode, and lockdown mode
- Handle both authenticated and unauthenticated modes appropriately
- Add comprehensive unit tests for the new functionality
- Remove suggestion to call get_me from auth_login success message

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2025-12-19 09:37:32 +00:00
copilot-swe-agent[bot] 4e68d8f0c6 Address PR review feedback and add OAuth authentication documentation
- Fix OAuth client ID comment to clarify it's production-ready
- Replace custom joinScopes function with strings.Join
- Fix URL parsing fallback to avoid double-https:// prefix
- Fix typo in auth success message
- Update server instructions to remove auth_verify references
- Add comprehensive OAuth authentication documentation
- Update README with authentication method comparison and links to OAuth docs

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2025-12-19 09:01:52 +01:00
Sam Morrow d322e26d91 feat: implement OAuth device flow authentication
When the server starts without a GITHUB_PERSONAL_ACCESS_TOKEN, it now
starts in 'unauthenticated mode' with only an auth_login tool available.

The auth_login tool:
- Initiates the OAuth device flow with GitHub
- Uses MCP URL elicitation to show the verification URL and user code
- Polls for completion while showing progress notifications
- Upon success, dynamically registers all configured GitHub tools

This enables a much simpler setup experience - users no longer need to
pre-configure a PAT. They can simply start the server and authenticate
interactively when prompted.

Key changes:
- New AuthManager in pkg/github/auth.go handles device flow state
- New auth_login tool in pkg/github/auth_tools.go
- NewUnauthenticatedMCPServer in internal/ghmcp/server.go for token-less startup
- CLI flags --oauth-client-id and --oauth-client-secret for enterprise scenarios
- Support for github.com, GHES, and GHEC hosts

The token is held in memory for the session duration - no persistent
storage, which is ideal for Docker --rm workflows.

Closes #132
2025-12-19 01:08:52 +01:00