* Generate MCP server configuration from DXT manifest
(
manifest: McpbManifest,
extractedPath: string,
userConfig: UserConfigValues = {},
)
| 421 | * Generate MCP server configuration from DXT manifest |
| 422 | */ |
| 423 | async function generateMcpConfig( |
| 424 | manifest: McpbManifest, |
| 425 | extractedPath: string, |
| 426 | userConfig: UserConfigValues = {}, |
| 427 | ): Promise<McpServerConfig> { |
| 428 | // Lazy import: @anthropic-ai/mcpb barrel pulls in zod v3 schemas (~700KB of |
| 429 | // bound closures). See dxt/helpers.ts for details. |
| 430 | const { getMcpConfigForManifest } = await import('@anthropic-ai/mcpb') |
| 431 | const mcpConfig = await getMcpConfigForManifest({ |
| 432 | manifest, |
| 433 | extensionPath: extractedPath, |
| 434 | systemDirs: getSystemDirectories(), |
| 435 | userConfig, |
| 436 | pathSeparator: '/', |
| 437 | }) |
| 438 | |
| 439 | if (!mcpConfig) { |
| 440 | const error = new Error( |
| 441 | `Failed to generate MCP server configuration from manifest "${manifest.name}"`, |
| 442 | ) |
| 443 | logError(error) |
| 444 | throw error |
| 445 | } |
| 446 | |
| 447 | return mcpConfig as McpServerConfig |
| 448 | } |
| 449 | |
| 450 | /** |
| 451 | * Load cache metadata for an MCPB source |
no test coverage detected