🪄 fix: MCP UI Renders for OAuth and Custom User Vars Servers #9559
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 pull request changes the behavior of the MCP UI elements in chat so that they will now always appear if there are any MCP servers configured in
librechat.yaml
that do not have chatMenu set to false in order to address the issue raised in [Enhancement]: Stop hiding MCP Servers badge when all servers are "oauth" or "customUserVars"Previously,
startup: false
and OAuth servers would not cause the MCP UI to render on their own, requiring users to initialize them in the MCP Settings Panel before the badge / tools dropdown would appear. In order to accomplish this change, themcpServerNames
property has been removed from the context in favor of using the more comprehensivemcpServerManager
, which provides access toconfiguredServers
directly. This has the added benefit of streamlining server configuration checks and improving maintainability.Context refactoring:
mcpServerNames
property and its associated logic fromBadgeRowContext.tsx
, replacing it withmcpServerManager
for more robust server configuration handling. [1] [2] [3] [4]Component updates for server configuration:
Updated
MCPSelect.tsx
andToolsDropdown.tsx
components to useconfiguredServers
frommcpServerManager
instead of relying onmcpServerNames
, ensuring consistent server availability checks and rendering logic. [1] [2] [3]Simplified conditional rendering in
MCPSelectContent
by removing checks forisPinned
andmcpValues
, relying solely onconfiguredServers
for display logic. [1] [2]Change Type
Testing
Verified absence of MCPSelect and ToolsDropdown when only github-mcp with startup: false or spotify mcp server (OAuth) configured in YAML
Verified presence of aforementioned elements with same YAML configuration after changes
Checklist