MCPcopy Create free account
hub / github.com/CopilotKit/open-mcp-client / handleExampleConfig

Function handleExampleConfig

app/components/MCPConfigForm.tsx:98–116  ·  view source on GitHub ↗
(exampleConfig: Record<string, ServerConfig>)

Source from the content-addressed store, hash-verified

96 }, [agentState]);
97
98 const handleExampleConfig = (exampleConfig: Record<string, ServerConfig>) => {
99 // Merge the example with existing configs or replace them based on user preference
100 if (Object.keys(configs).length > 0) {
101 const shouldReplace = window.confirm(
102 "Do you want to replace your current configuration with this example? Click 'OK' to replace, or 'Cancel' to merge."
103 );
104
105 if (shouldReplace) {
106 setConfigs(exampleConfig);
107 } else {
108 setConfigs({ ...configs, ...exampleConfig });
109 }
110 } else {
111 setConfigs(exampleConfig);
112 }
113
114 // Close the examples panel after selection
115 setShowExampleConfigs(false);
116 };
117
118 const addConfig = () => {
119 if (!serverName) return;

Callers

nothing calls this directly

Calls 1

setConfigsFunction · 0.85

Tested by

no test coverage detected