MCPcopy
hub / github.com/codeaashu/claude-code / mcpAddFromDesktopHandler

Function mcpAddFromDesktopHandler

src/cli/handlers/mcp.tsx:317–349  ·  view source on GitHub ↗
(options: {
  scope?: string;
})

Source from the content-addressed store, hash-verified

315
316// mcp add-from-claude-desktop (lines 4881–4927)
317export async function mcpAddFromDesktopHandler(options: {
318 scope?: string;
319}): Promise<void> {
320 try {
321 const scope = ensureConfigScope(options.scope);
322 const platform = getPlatform();
323 logEvent('tengu_mcp_add', {
324 scope: scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
325 platform: platform as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
326 source: 'desktop' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
327 });
328 const {
329 readClaudeDesktopMcpServers
330 } = await import('../../utils/claudeDesktop.js');
331 const servers = await readClaudeDesktopMcpServers();
332 if (Object.keys(servers).length === 0) {
333 cliOk('No MCP servers found in Claude Desktop configuration or configuration file does not exist.');
334 }
335 const {
336 unmount
337 } = await render(<AppStateProvider>
338 <KeybindingSetup>
339 <MCPServerDesktopImportDialog servers={servers} scope={scope} onDone={() => {
340 unmount();
341 }} />
342 </KeybindingSetup>
343 </AppStateProvider>, {
344 exitOnCtrlC: true
345 });
346 } catch (error) {
347 cliError((error as Error).message);
348 }
349}
350
351// mcp reset-project-choices (lines 4935–4952)
352export async function mcpResetChoicesHandler(): Promise<void> {

Callers 1

runFunction · 0.85

Calls 9

ensureConfigScopeFunction · 0.85
getPlatformFunction · 0.85
logEventFunction · 0.85
cliOkFunction · 0.85
renderFunction · 0.85
unmountFunction · 0.85
cliErrorFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected