Principle:AI QL Tuui MCPB Bundle Packaging
| Knowledge Sources | |
|---|---|
| Domains | MCPB, Packaging, Distribution |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
A packaging and distribution pattern for MCP servers that bundles server code, a manifest, and user configuration schema into a single installable archive with validation and config resolution.
Description
MCPB (MCP Bundle) packaging addresses the distribution problem for MCP servers. Instead of requiring users to manually configure stdio commands and arguments, a .mcpb archive contains the server code, a manifest.json describing the server and its user-config schema, and any dependencies. The installation flow involves: transferring the archive, unpacking it, validating the manifest against a schema, listing installed manifests, merging user-provided config values with manifest defaults, resolving the manifest to a StdioServerParameters object, and initializing the server. This enables one-click installation of MCP servers with configurable parameters.
Usage
Use this principle when designing a distribution system for MCP servers where users install pre-packaged bundles with configurable parameters (API keys, model names, etc.) rather than manually writing stdio command configurations.
Theoretical Basis
The installation pipeline:
1. Transfer: .mcpb binary → file system
2. Unpack: unpackExtension(archive) → directory with manifest.json
3. Validate: McpbManifestSchema.safeParse(manifest) → validated manifest | errors
4. List: readdirSync → getManifest per directory → manifest registry
5. Merge: user_config schema defaults + user-provided values → merged config
6. Resolve: getMcpConfigForManifest(manifest, userConfig) → StdioServerParameters
7. Init: initSingleClient(resolvedConfig) → connected client
The manifest schema defines:
- server — command, args, env template with
Template:User config keyplaceholders - user_config — JSON schema with defaults for each configurable parameter
- version — manifest format version (e.g.
v0_3)
User config resolution replaces placeholders in args/env with user-provided values, falling back to manifest defaults for any missing values.