(options: {
scope?: string;
})
| 315 | |
| 316 | // mcp add-from-claude-desktop (lines 4881–4927) |
| 317 | export 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) |
| 352 | export async function mcpResetChoicesHandler(): Promise<void> { |
no test coverage detected