mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-08 18:44:22 +01:00
✨ feat: Configurable MCP Dropdown Placeholder (#7988)
* new env variable for mcp label * 🔄 refactor: Update MCPSelect placeholderText to draw from interface section of librechat.yaml rather than .env * 🧹 chore: extract mcpServers schema for better maintainability * 🔄 refactor: Update MCPSelect and useMCPSelect to utilize TPlugin type for better type consistency * 🔄 refactor: Pass placeholder from startupConfig to MCPSubMenu for improved localization * 🔄 refactor: Integrate startupConfig into BadgeRowContext and related components for enhanced configuration management --------- Co-authored-by: mwbrandao <mariana.brandao@nos.pt> Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
a058963a9f
commit
2b2f7fe289
9 changed files with 46 additions and 21 deletions
|
|
@ -18,8 +18,15 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
|
|||
const localize = useLocalize();
|
||||
const isDisabled = disabled ?? false;
|
||||
const [isPopoverActive, setIsPopoverActive] = useState(false);
|
||||
const { webSearch, codeInterpreter, fileSearch, mcpSelect, searchApiKeyForm, codeApiKeyForm } =
|
||||
useBadgeRowContext();
|
||||
const {
|
||||
webSearch,
|
||||
mcpSelect,
|
||||
fileSearch,
|
||||
startupConfig,
|
||||
codeApiKeyForm,
|
||||
codeInterpreter,
|
||||
searchApiKeyForm,
|
||||
} = useBadgeRowContext();
|
||||
const { setIsDialogOpen: setIsCodeDialogOpen, menuTriggerRef: codeMenuTriggerRef } =
|
||||
codeApiKeyForm;
|
||||
const { setIsDialogOpen: setIsSearchDialogOpen, menuTriggerRef: searchMenuTriggerRef } =
|
||||
|
|
@ -89,6 +96,8 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
|
|||
[mcpSelect],
|
||||
);
|
||||
|
||||
const mcpPlaceholder = startupConfig?.interface?.mcpServers?.placeholder;
|
||||
|
||||
const dropdownItems = useMemo(() => {
|
||||
const items: MenuItemProps[] = [
|
||||
{
|
||||
|
|
@ -246,8 +255,9 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
|
|||
<MCPSubMenu
|
||||
{...props}
|
||||
mcpValues={mcpValues}
|
||||
mcpServerNames={mcpServerNames}
|
||||
isMCPPinned={isMCPPinned}
|
||||
placeholder={mcpPlaceholder}
|
||||
mcpServerNames={mcpServerNames}
|
||||
setIsMCPPinned={setIsMCPPinned}
|
||||
handleMCPToggle={handleMCPToggle}
|
||||
/>
|
||||
|
|
@ -262,6 +272,7 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
|
|||
canRunCode,
|
||||
isMCPPinned,
|
||||
isCodePinned,
|
||||
mcpPlaceholder,
|
||||
mcpServerNames,
|
||||
isSearchPinned,
|
||||
setIsMCPPinned,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue