[PR #4876] [CLOSED] feat: OAuth/OIDC impersonation support with MCP server integration #4801

Closed
opened 2026-02-22 18:36:33 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4876
Author: @santonakakis
Created: 1/17/2026
Status: Closed

Base: masterHead: feature/allm-mcp-oauth


📝 Commits (10+)

  • 8fbd9df Refactored UI architecture to align light and dark to theme system
  • c54426f fix: login page light mode issues and theme selector clarity
  • cc4a0c8 feat: add System/Light/Dark theme selector
  • 3a9fcd8 Fix theme consistency across UI components
  • 6eb2c8d Fix chat bubble theme and scroll behavior
  • 3efa6c2 fix: increase light mode border opacity to 20% for visibility
  • 2ae88bc docs: make code comments generic for upstream compatibility
  • 1ca8f35 docs: add upstream-first development guidelines to CLAUDE.md
  • 2460ab7 chore: clean up unused imports and improve code organization
  • bdcf007 fix: add light mode scrollbar support for manual theme toggle

📊 Changes

287 files changed (+2966 additions, -1579 deletions)

View changed files

CLAUDE.md (+199 -0)
📝 frontend/src/AuthContext.jsx (+15 -0)
📝 frontend/src/components/ChangeWarning/index.jsx (+4 -4)
📝 frontend/src/components/ChatBubble/index.jsx (+1 -1)
📝 frontend/src/components/CommunityHub/PublishEntityModal/AgentFlows/index.jsx (+6 -6)
📝 frontend/src/components/CommunityHub/PublishEntityModal/SlashCommands/index.jsx (+9 -9)
📝 frontend/src/components/CommunityHub/PublishEntityModal/SystemPrompts/index.jsx (+9 -9)
📝 frontend/src/components/CommunityHub/PublishEntityModal/index.jsx (+1 -1)
📝 frontend/src/components/CommunityHub/UnauthenticatedHubModal/index.jsx (+3 -3)
📝 frontend/src/components/ContextualSaveBar/index.jsx (+1 -1)
📝 frontend/src/components/DataConnectorOption/index.jsx (+3 -3)
📝 frontend/src/components/DefaultChat/index.jsx (+1 -1)
📝 frontend/src/components/EditingChatBubble/index.jsx (+4 -4)
📝 frontend/src/components/EmbeddingSelection/AzureAiOptions/index.jsx (+6 -6)
📝 frontend/src/components/EmbeddingSelection/CohereOptions/index.jsx (+6 -6)
📝 frontend/src/components/EmbeddingSelection/EmbedderItem/index.jsx (+1 -1)
📝 frontend/src/components/EmbeddingSelection/GeminiOptions/index.jsx (+4 -4)
📝 frontend/src/components/EmbeddingSelection/GenericOpenAiOptions/index.jsx (+10 -10)
📝 frontend/src/components/EmbeddingSelection/LMStudioOptions/index.jsx (+13 -13)
📝 frontend/src/components/EmbeddingSelection/LiteLLMOptions/index.jsx (+10 -10)

...and 80 more files

📄 Description

Summary

  • Implement OAuth/OIDC impersonation authentication flow for per-user MCP server connections
  • Add SSO login button with configurable OIDC provider support
  • Enhance MCP compatibility layer to inject user OAuth tokens into server environment
  • Fix various UI issues with scrolling, light mode, and admin page layouts

Key Changes

OAuth/OIDC Integration:

  • frontend/src/pages/Login/OAuth/callback.jsx - Handle OAuth callback and token exchange
  • frontend/src/hooks/useOIDCAuth.js - React hook for OIDC authentication state
  • frontend/src/components/Modals/Password/MultiUserAuth.jsx - Conditional SSO button rendering
  • server/endpoints/system.js - OAuth login initiation and callback endpoints
  • server/utils/boot/validateOAuthConfig.js - Startup validation for OAuth configuration

MCP Server Enhancement:

  • server/utils/MCP/index.js - MCPCompatibilityLayer now supports OAuth impersonation mode
  • Inject user's OAuth tokens into MCP server environment variables
  • Support for MCP_AUTH_MODE=impersonation configuration

Database Schema:

  • server/prisma/schema.prisma - Add oauthProvider and oauthId fields to users table
  • Migration for OAuth user fields

UI Fixes:

  • Improved scroll position restoration in SettingsSidebar
  • Light mode scrollbar styling
  • Admin page button layout fixes
  • CTAButton negative margin correction

Test plan

  • Verify OAuth login flow redirects to configured OIDC provider
  • Confirm callback handles token exchange and creates/links user
  • Test MCP servers receive user OAuth tokens in impersonation mode
  • Validate fallback to password auth when OAuth not configured
  • Check scroll position persistence in settings sidebar
  • Verify light mode scrollbar styling

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4876 **Author:** [@santonakakis](https://github.com/santonakakis) **Created:** 1/17/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/allm-mcp-oauth` --- ### 📝 Commits (10+) - [`8fbd9df`](https://github.com/Mintplex-Labs/anything-llm/commit/8fbd9df9fde125b4dd5285bb9728aac6307ce6d1) Refactored UI architecture to align light and dark to theme system - [`c54426f`](https://github.com/Mintplex-Labs/anything-llm/commit/c54426fcfeca0056e9652aba242e28e10aa7f9a7) fix: login page light mode issues and theme selector clarity - [`cc4a0c8`](https://github.com/Mintplex-Labs/anything-llm/commit/cc4a0c83740e8d4f0109606e0abb9cb030ed00d1) feat: add System/Light/Dark theme selector - [`3a9fcd8`](https://github.com/Mintplex-Labs/anything-llm/commit/3a9fcd81f94fde176cf9354a82606b8cdf5dcbd6) Fix theme consistency across UI components - [`6eb2c8d`](https://github.com/Mintplex-Labs/anything-llm/commit/6eb2c8d2a15bcff84aa80515fa5d851387062c6f) Fix chat bubble theme and scroll behavior - [`3efa6c2`](https://github.com/Mintplex-Labs/anything-llm/commit/3efa6c20af5c9f6d1d56cf0fa6b6579a93a3bac2) fix: increase light mode border opacity to 20% for visibility - [`2ae88bc`](https://github.com/Mintplex-Labs/anything-llm/commit/2ae88bca716943e77768f750775b4fa31df089d5) docs: make code comments generic for upstream compatibility - [`1ca8f35`](https://github.com/Mintplex-Labs/anything-llm/commit/1ca8f35699012a7c6f217429c7141c463218cc9e) docs: add upstream-first development guidelines to CLAUDE.md - [`2460ab7`](https://github.com/Mintplex-Labs/anything-llm/commit/2460ab73c0c69f45bfb443131c9f3785b3c9204a) chore: clean up unused imports and improve code organization - [`bdcf007`](https://github.com/Mintplex-Labs/anything-llm/commit/bdcf0076df953c88b6a46647879b8ed241d512af) fix: add light mode scrollbar support for manual theme toggle ### 📊 Changes **287 files changed** (+2966 additions, -1579 deletions) <details> <summary>View changed files</summary> ➕ `CLAUDE.md` (+199 -0) 📝 `frontend/src/AuthContext.jsx` (+15 -0) 📝 `frontend/src/components/ChangeWarning/index.jsx` (+4 -4) 📝 `frontend/src/components/ChatBubble/index.jsx` (+1 -1) 📝 `frontend/src/components/CommunityHub/PublishEntityModal/AgentFlows/index.jsx` (+6 -6) 📝 `frontend/src/components/CommunityHub/PublishEntityModal/SlashCommands/index.jsx` (+9 -9) 📝 `frontend/src/components/CommunityHub/PublishEntityModal/SystemPrompts/index.jsx` (+9 -9) 📝 `frontend/src/components/CommunityHub/PublishEntityModal/index.jsx` (+1 -1) 📝 `frontend/src/components/CommunityHub/UnauthenticatedHubModal/index.jsx` (+3 -3) 📝 `frontend/src/components/ContextualSaveBar/index.jsx` (+1 -1) 📝 `frontend/src/components/DataConnectorOption/index.jsx` (+3 -3) 📝 `frontend/src/components/DefaultChat/index.jsx` (+1 -1) 📝 `frontend/src/components/EditingChatBubble/index.jsx` (+4 -4) 📝 `frontend/src/components/EmbeddingSelection/AzureAiOptions/index.jsx` (+6 -6) 📝 `frontend/src/components/EmbeddingSelection/CohereOptions/index.jsx` (+6 -6) 📝 `frontend/src/components/EmbeddingSelection/EmbedderItem/index.jsx` (+1 -1) 📝 `frontend/src/components/EmbeddingSelection/GeminiOptions/index.jsx` (+4 -4) 📝 `frontend/src/components/EmbeddingSelection/GenericOpenAiOptions/index.jsx` (+10 -10) 📝 `frontend/src/components/EmbeddingSelection/LMStudioOptions/index.jsx` (+13 -13) 📝 `frontend/src/components/EmbeddingSelection/LiteLLMOptions/index.jsx` (+10 -10) _...and 80 more files_ </details> ### 📄 Description ## Summary - Implement OAuth/OIDC impersonation authentication flow for per-user MCP server connections - Add SSO login button with configurable OIDC provider support - Enhance MCP compatibility layer to inject user OAuth tokens into server environment - Fix various UI issues with scrolling, light mode, and admin page layouts ## Key Changes **OAuth/OIDC Integration**: - `frontend/src/pages/Login/OAuth/callback.jsx` - Handle OAuth callback and token exchange - `frontend/src/hooks/useOIDCAuth.js` - React hook for OIDC authentication state - `frontend/src/components/Modals/Password/MultiUserAuth.jsx` - Conditional SSO button rendering - `server/endpoints/system.js` - OAuth login initiation and callback endpoints - `server/utils/boot/validateOAuthConfig.js` - Startup validation for OAuth configuration **MCP Server Enhancement**: - `server/utils/MCP/index.js` - MCPCompatibilityLayer now supports OAuth impersonation mode - Inject user's OAuth tokens into MCP server environment variables - Support for `MCP_AUTH_MODE=impersonation` configuration **Database Schema**: - `server/prisma/schema.prisma` - Add oauthProvider and oauthId fields to users table - Migration for OAuth user fields **UI Fixes**: - Improved scroll position restoration in SettingsSidebar - Light mode scrollbar styling - Admin page button layout fixes - CTAButton negative margin correction ## Test plan - [ ] Verify OAuth login flow redirects to configured OIDC provider - [ ] Confirm callback handles token exchange and creates/links user - [ ] Test MCP servers receive user OAuth tokens in impersonation mode - [ ] Validate fallback to password auth when OAuth not configured - [ ] Check scroll position persistence in settings sidebar - [ ] Verify light mode scrollbar styling --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:33 -05:00
yindo closed this issue 2026-02-22 18:36:33 -05:00
yindo changed title from [PR #4876] feat: OAuth/OIDC impersonation support with MCP server integration to [PR #4876] [CLOSED] feat: OAuth/OIDC impersonation support with MCP server integration 2026-06-05 15:20:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4801