mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-16 23:48:09 +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
|
|
@ -1,6 +1,7 @@
|
|||
import React, { createContext, useContext } from 'react';
|
||||
import { Tools, LocalStorageKeys } from 'librechat-data-provider';
|
||||
import { useMCPSelect, useToolToggle, useCodeApiKeyForm, useSearchApiKeyForm } from '~/hooks';
|
||||
import { useGetStartupConfig } from '~/data-provider';
|
||||
|
||||
interface BadgeRowContextType {
|
||||
conversationId?: string | null;
|
||||
|
|
@ -10,6 +11,7 @@ interface BadgeRowContextType {
|
|||
fileSearch: ReturnType<typeof useToolToggle>;
|
||||
codeApiKeyForm: ReturnType<typeof useCodeApiKeyForm>;
|
||||
searchApiKeyForm: ReturnType<typeof useSearchApiKeyForm>;
|
||||
startupConfig: ReturnType<typeof useGetStartupConfig>['data'];
|
||||
}
|
||||
|
||||
const BadgeRowContext = createContext<BadgeRowContextType | undefined>(undefined);
|
||||
|
|
@ -28,6 +30,9 @@ interface BadgeRowProviderProps {
|
|||
}
|
||||
|
||||
export default function BadgeRowProvider({ children, conversationId }: BadgeRowProviderProps) {
|
||||
/** Startup config */
|
||||
const { data: startupConfig } = useGetStartupConfig();
|
||||
|
||||
/** MCPSelect hook */
|
||||
const mcpSelect = useMCPSelect({ conversationId });
|
||||
|
||||
|
|
@ -73,6 +78,7 @@ export default function BadgeRowProvider({ children, conversationId }: BadgeRowP
|
|||
mcpSelect,
|
||||
webSearch,
|
||||
fileSearch,
|
||||
startupConfig,
|
||||
conversationId,
|
||||
codeApiKeyForm,
|
||||
codeInterpreter,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue