Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:AI QL Tuui MCPB SDK

From Leeroopedia
Knowledge Sources
Domains MCP, Packaging, Bundling
Last Updated 2026-10-24 20:38 GMT

Overview

The @anthropic-ai/mcpb SDK for packaging, unpacking, and validating MCPB (MCP Bundle) archives with manifest schemas and user-config resolution.

Description

The MCPB SDK (@anthropic-ai/mcpb >= 2.1.2) provides utilities for working with .mcpb bundle archives. tuui uses unpackExtension to extract bundle archives, getMcpConfigForManifest to resolve manifest configurations with user-supplied config values, and McpbManifestSchema (Zod-based) for manifest validation. The SDK handles path separator resolution, system directory substitution, and user-config merging.

Usage

Use this environment for any implementation that imports from @anthropic-ai/mcpb. This includes MCPB bundle installation, manifest validation, and user-config resolution.

System Requirements

Category Requirement Notes
Runtime Node.js >= 22.12.0 Required by Electron 42+
Disk Write access to assets/mcpb directory Bundles are unpacked into ASSETS_PATH.mcpb

Dependencies

NPM Packages

  • `@anthropic-ai/mcpb` >= 2.1.2

SDK Exports Used

  • `unpackExtension` — Extract .mcpb archive to directory
  • `getMcpConfigForManifest` — Resolve manifest + user config to stdio server config
  • `McpbVersion.McpbManifestSchema` — Zod schema for manifest validation
  • `McpbManifestAny` — Union type for any manifest version
  • `McpbUserConfigValues` — User configuration values type
  • `Logger` — Logger interface for SDK diagnostics

Credentials

No credentials required. User-config values may include API keys per-server, but are stored in the DXT store and passed at resolution time.

Quick Install

npm install @anthropic-ai/mcpb@^2.1.2

Code Evidence

SDK imports from `src/main/mcp/dxt.ts:1-8`:

import {
  unpackExtension,
  getMcpConfigForManifest,
  v0_3 as McpbVersion,
  McpbManifestAny,
  McpbUserConfigValues,
  Logger
} from '@anthropic-ai/mcpb'

Manifest validation with Zod from `src/main/mcp/dxt.ts:69-73`:

const result = McpbVersion.McpbManifestSchema.safeParse(manifestData)
if (result.success) {
  console.log('Manifest is valid!')
  return result.data
}

Config resolution with logger from `src/main/mcp/dxt.ts:34-41`:

const mcpConfig = await getMcpConfigForManifest({
  manifest: baseManifest,
  extensionPath: basePath,
  systemDirs: mockSystemDirs,
  userConfig: userConfig,
  pathSeparator: sep,
  logger
})

Common Errors

Error Message Cause Solution
`Manifest validation failed` Invalid or incomplete manifest.json Check manifest against MCPB schema; review Zod error issues
`mcpConfig is undefined` Config resolution returned undefined Check logger output for resolution errors
`File extension name must be: .mcpb` Non-.mcpb file passed to unpacker Verify file extension before calling getDxtSource

Compatibility Notes

  • mockSystemDirs: tuui uses mock system directories ({ home: '/home/user', data: '/data' }) for manifest path resolution.
  • Path separator: Uses sep from Node.js path module for cross-platform path handling.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment