-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
🏹 feat: Concurrent MCP Initialization Support #8677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
This comment was marked as resolved.
This comment was marked as resolved.
danny-avila
requested changes
Jul 27, 2025
This comment was marked as resolved.
This comment was marked as resolved.
- Introduced new functions to retrieve and manage connection status for multiple MCP servers, including OAuth flow checks and server-specific status retrieval. - Refactored the MCP connection status endpoints to support both all servers and individual server queries. - Replaced the old server initialization hook with a new `useMCPServerManager` hook for improved state management and handling of multiple OAuth flows. - Updated the MCPPanel component to utilize the new context provider for better state handling and UI updates. - Fixed a number of UI bugs when initializing servers
cbf270d
to
d5a8a49
Compare
d5a8a49
to
2c70ace
Compare
danny-avila
approved these changes
Jul 28, 2025
jhrozek
pushed a commit
to StacklokLabs/LibreChat
that referenced
this pull request
Jul 31, 2025
* ✨ feat: Enhance MCP Connection Status Management - Introduced new functions to retrieve and manage connection status for multiple MCP servers, including OAuth flow checks and server-specific status retrieval. - Refactored the MCP connection status endpoints to support both all servers and individual server queries. - Replaced the old server initialization hook with a new `useMCPServerManager` hook for improved state management and handling of multiple OAuth flows. - Updated the MCPPanel component to utilize the new context provider for better state handling and UI updates. - Fixed a number of UI bugs when initializing servers * 🗣️ i18n: Remove unused strings from translation.json * refactor: move helper functions out of the route module into mcp service file * ci: add tests for newly added functions in mcp service file * fix: memoize setMCPValues to avoid render loop
xycjscs
pushed a commit
to xycjscs/LibreChat
that referenced
this pull request
Aug 9, 2025
* ✨ feat: Enhance MCP Connection Status Management - Introduced new functions to retrieve and manage connection status for multiple MCP servers, including OAuth flow checks and server-specific status retrieval. - Refactored the MCP connection status endpoints to support both all servers and individual server queries. - Replaced the old server initialization hook with a new `useMCPServerManager` hook for improved state management and handling of multiple OAuth flows. - Updated the MCPPanel component to utilize the new context provider for better state handling and UI updates. - Fixed a number of UI bugs when initializing servers * 🗣️ i18n: Remove unused strings from translation.json * refactor: move helper functions out of the route module into mcp service file * ci: add tests for newly added functions in mcp service file * fix: memoize setMCPValues to avoid render loop
miguelwon
pushed a commit
to miguelwon/LibreChat
that referenced
this pull request
Aug 10, 2025
* ✨ feat: Enhance MCP Connection Status Management - Introduced new functions to retrieve and manage connection status for multiple MCP servers, including OAuth flow checks and server-specific status retrieval. - Refactored the MCP connection status endpoints to support both all servers and individual server queries. - Replaced the old server initialization hook with a new `useMCPServerManager` hook for improved state management and handling of multiple OAuth flows. - Updated the MCPPanel component to utilize the new context provider for better state handling and UI updates. - Fixed a number of UI bugs when initializing servers * 🗣️ i18n: Remove unused strings from translation.json * refactor: move helper functions out of the route module into mcp service file * ci: add tests for newly added functions in mcp service file * fix: memoize setMCPValues to avoid render loop
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.
Summary
This PR enhances MCP initializations to handle multiple server connections and OAuth flows concurrently. It refactors existing single-server initialization processes to work in parallel, creating a smoother experience when managing server connections for users. Key changes include the extraction of reusable utility functions for MCP server status management, the replacement of the previous initialization hook with a centralized server manager, and the addition of a new per-server connection status endpoint.
Core Features
Frontend Changes: MCP Panel and Server Initialization
useMCPServerInitialization
hook with a newuseMCPServerManager
hook to centralize server management logic, enabling support for multiple OAuth flows and improving initialization handling. [1] [2]ServerInitializationSection
component to use the newuseMCPServerManager
hook, simplifying state management and aligning with the updated backend logic. [1] [2] [3] [4] [5]Backend Changes: MCP Server Status Management
/connection/status
endpoint to use new utility functions (getMCPSetupData
,checkOAuthFlowStatus
,getServerConnectionStatus
) for modular handling of MCP server connection statuses. These functions centralize logic for retrieving configuration, checking OAuth flows, and determining connection states./connection/status/:serverName
endpoint to fetch the connection status of a specific MCP server, improving granularity and user-specific responses.Change Type
Details & Change Breakdown
1. Server-Side Refactor (
mcp.js
)getMCPSetupData
,checkOAuthFlowStatus
, andgetServerConnectionStatus
for improved modularity and clarity./connection/status/:serverName
endpoins for per-server reporting of server connection status.2. Client-Side Refactor
MCPPanel.tsx
: Refactored to use centralized logic for handling multiple server connections and states.ServerInitializationSection.tsx
: Updated to handle OAuth flows and connection status using the shared initialization hook (useMCPServerManager
).3. React Queries and Hooks
useMCPServerManager
Hook: RefactoreduseMCPServerInitialization
into the new shareduseMCPServerManager
hook to manage concurrent server initializations and connection states.useMCPServerConnectionStatusQuery
for server-specific connection status checks inreact-query-service.ts
.4. Localization and Data Provider Improvements
Localization Updates:
translation.json
: Minor adjustments for connection status and server initialization strings.Data Provider Updates:
api-endpoints.ts
).packages/data-provider/src/types/queries.ts
).Testing
Checklist