mcpb/src/shared/constants.ts
Joan Xie d90365e626
feat: add UV runtime support in manifest v0.4
Add UV as a new server type for Python extensions that use UV runtime
for dependency management instead of bundling dependencies.

Schema changes (v0.4):
- Add "uv" to server.type enum
- Make mcp_config optional (not needed for UV type)
- UV extensions rely on pyproject.toml for dependencies

Documentation:
- Add UV runtime section to MANIFEST.md explaining benefits and usage
- Update README.md to recommend UV runtime for Python
- Add complete hello-world-uv example

Benefits of UV runtime:
- Cross-platform support (Windows/macOS/Linux, Intel/ARM)
- Small bundle size (~100 KB vs 5-10 MB)
- Handles compiled dependencies portably
- No user Python installation required

Example manifest:
{
  "manifest_version": "0.4",
  "server": {
    "type": "uv",
    "entry_point": "src/server.py"
  }
}

Co-authored-by: Joan <joan@anthropic.com>
2025-12-02 21:22:19 -08:00

38 lines
1.4 KiB
TypeScript

import { McpbManifestSchema as ManifestSchemaV0_1 } from "../schemas/0.1.js";
import { McpbManifestSchema as ManifestSchemaV0_2 } from "../schemas/0.2.js";
import { McpbManifestSchema as ManifestSchemaV0_3 } from "../schemas/0.3.js";
import { McpbManifestSchema as ManifestSchemaV0_4 } from "../schemas/0.4.js";
import { McpbManifestSchema as LooseManifestSchemaV0_1 } from "../schemas_loose/0.1.js";
import { McpbManifestSchema as LooseManifestSchemaV0_2 } from "../schemas_loose/0.2.js";
import { McpbManifestSchema as LooseManifestSchemaV0_3 } from "../schemas_loose/0.3.js";
import { McpbManifestSchema as LooseManifestSchemaV0_4 } from "../schemas_loose/0.4.js";
/**
* Latest manifest version - indicates the maximum supported version by vAny schema
*/
export const LATEST_MANIFEST_VERSION = "0.4" as const;
/**
* Default manifest version for new packages
*/
export const DEFAULT_MANIFEST_VERSION = "0.2" as const;
/**
* Map of manifest versions to their strict schemas
*/
export const MANIFEST_SCHEMAS = {
"0.1": ManifestSchemaV0_1,
"0.2": ManifestSchemaV0_2,
"0.3": ManifestSchemaV0_3,
"0.4": ManifestSchemaV0_4,
} as const;
/**
* Map of manifest versions to their loose schemas (with passthrough)
*/
export const MANIFEST_SCHEMAS_LOOSE = {
"0.1": LooseManifestSchemaV0_1,
"0.2": LooseManifestSchemaV0_2,
"0.3": LooseManifestSchemaV0_3,
"0.4": LooseManifestSchemaV0_4,
} as const;