diff --git a/.gitignore b/.gitignore index ca98aa1..b01aba3 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,8 @@ typings/ # Claude files .claude.json .claude/ +CLAUDE.md +PROJECT_STATUS.md # Vite .vite/ diff --git a/MANIFEST.md b/MANIFEST.md index 1bb7f50..8ba7fa2 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -403,11 +403,9 @@ Four server types are supported: - **`node`**: Node.js server with bundled dependencies - **`python`**: Python server with bundled dependencies - **`binary`**: Compiled executable -- **`uv`**: Python server using UV runtime (experimental, v0.4+) +- **`uv`**: Python server using UV runtime (v0.4+) -### UV Runtime (Experimental, v0.4+) - -> **Note:** UV runtime support is experimental and may change in future versions. +### UV Runtime (v0.4+) The `uv` server type enables cross-platform Python extensions without bundling dependencies. Instead, dependencies are declared in `pyproject.toml` and installed by the host application using UV. diff --git a/README.md b/README.md index 34aaaf5..d9f1fbe 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ bundle.mcpb (ZIP file) ### Bundling Dependencies -**UV Runtime (Experimental - v0.4+):** +**UV Runtime (v0.4+):** - Use `server.type = "uv"` in manifest - Include `pyproject.toml` with dependencies (no bundled packages needed) diff --git a/examples/file-manager-python/.mcpbignore b/examples/file-manager-python/.mcpbignore new file mode 100644 index 0000000..f753254 --- /dev/null +++ b/examples/file-manager-python/.mcpbignore @@ -0,0 +1,7 @@ +.venv/ +__pycache__/ +*.pyc +.pytest_cache/ +.mypy_cache/ +*.egg-info/ +uv.lock diff --git a/examples/file-manager-python/manifest.json b/examples/file-manager-python/manifest.json index 964b2aa..69b43e2 100644 --- a/examples/file-manager-python/manifest.json +++ b/examples/file-manager-python/manifest.json @@ -1,28 +1,28 @@ { - "$schema": "../../dist/mcpb-manifest.schema.json", - "manifest_version": "0.1", + "manifest_version": "0.4", "name": "file-manager-python", "display_name": "Python File Manager MCP", - "version": "0.1.0", + "version": "0.2.0", "description": "A Python MCP server for file operations", - "long_description": "This extension provides file management capabilities through a Python MCP server. It demonstrates Python-based MCP Bundle development, including file operations, directory management, and proper MCP protocol implementation.", + "long_description": "This extension provides file management capabilities through a Python MCP server. It demonstrates Python-based MCP Bundle development using UV runtime, including file operations, directory management, and proper MCP protocol implementation.", "author": { "name": "Anthropic", "email": "support@anthropic.com", "url": "https://github.com/anthropics" }, "server": { - "type": "python", + "type": "uv", "entry_point": "server/main.py", "mcp_config": { - "command": "python", + "command": "uv", "args": [ - "${__dirname}/server/main.py", + "run", + "--directory", "${__dirname}", + "server/main.py", "--workspace=${user_config.workspace_directory}" ], "env": { - "DEBUG": "${user_config.debug_mode}", - "PYTHONPATH": "${__dirname}/server/lib" + "DEBUG": "${user_config.debug_mode}" } } }, @@ -62,8 +62,7 @@ "claude_desktop": ">=0.10.0", "platforms": ["darwin", "win32", "linux"], "runtimes": { - "python": ">=3.8.0 <4" + "python": ">=3.10.0 <4" } - }, - "privacy_policies": [] + } } diff --git a/examples/file-manager-python/pyproject.toml b/examples/file-manager-python/pyproject.toml index 7895f32..5a1e799 100644 --- a/examples/file-manager-python/pyproject.toml +++ b/examples/file-manager-python/pyproject.toml @@ -1,31 +1,8 @@ -[build-system] -requires = ["setuptools>=42", "wheel"] -build-backend = "setuptools.build_meta" - [project] name = "file-manager-python" -version = "0.1.0" +version = "0.2.0" description = "A Python MCP server for file operations" -authors = [ - {name = "Anthropic", email = "support@anthropic.com"} +requires-python = ">=3.10" +dependencies = [ + "mcp>=1.0.0", ] -license = {text = "MIT"} -classifiers = [ - "Private :: Do Not Upload" # Prevents accidental uploads to PyPI -] - -[project.dependencies] -mcp = ">=1.0.0" -trio = ">=0.22.0" - -[tool.setuptools] -packages = ["server"] - -[project.scripts] -bundle-deps = "python:install_deps" - -# Custom scripts section for DXT development -[tool.dxt] -bundle = "pip install \"mcp[all]\" --target server/lib --upgrade --force-reinstall" -test = "python server/main.py --debug" -pack = "npx @anthropic-ai/dxt pack" \ No newline at end of file diff --git a/examples/file-manager-python/requirements.txt b/examples/file-manager-python/requirements.txt deleted file mode 100644 index d90d65c..0000000 --- a/examples/file-manager-python/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -mcp>=1.0.0 -trio>=0.22.0 diff --git a/examples/hello-world-node/server/index.js b/examples/hello-world-node/server/index.js index 03efb72..1d68293 100644 --- a/examples/hello-world-node/server/index.js +++ b/examples/hello-world-node/server/index.js @@ -64,7 +64,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }); // Start the server -const transport = new StdioServerTransport(); -server.connect(transport); +async function main() { + const transport = new StdioServerTransport(); + await server.connect(transport); + console.error("Hello World MCP server running..."); +} -console.error("Hello World MCP server running..."); +main().catch((error) => { + console.error("Fatal error in main():", error); + process.exit(1); +}); diff --git a/examples/hello-world-uv/README.md b/examples/hello-world-uv/README.md index ae898df..853bb06 100644 --- a/examples/hello-world-uv/README.md +++ b/examples/hello-world-uv/README.md @@ -1,6 +1,4 @@ -# Hello World UV Runtime Example (Experimental) - -> **Note:** UV runtime support is experimental and may change in future versions. +# Hello World UV Runtime Example This example demonstrates a minimal MCP server using **UV runtime**. @@ -28,7 +26,7 @@ hello-world-uv/ **UV Runtime** (this example): - `server.type = "uv"` - No bundled dependencies -- No `mcp_config` needed +- `mcp_config` uses `uv run` to auto-resolve deps from `pyproject.toml` - Small bundle size (~2 KB) - Works on any platform diff --git a/examples/hello-world-uv/manifest.json b/examples/hello-world-uv/manifest.json index f3d3b4a..534ef4d 100644 --- a/examples/hello-world-uv/manifest.json +++ b/examples/hello-world-uv/manifest.json @@ -10,7 +10,11 @@ "icon": "icon.png", "server": { "type": "uv", - "entry_point": "src/server.py" + "entry_point": "src/server.py", + "mcp_config": { + "command": "uv", + "args": ["run", "--directory", "${__dirname}", "src/server.py"] + } }, "compatibility": { "platforms": ["darwin", "linux", "win32"], diff --git a/src/schemas/0.4.ts b/src/schemas/0.4.ts index e044b91..ae97d17 100644 --- a/src/schemas/0.4.ts +++ b/src/schemas/0.4.ts @@ -1,5 +1,4 @@ // v0.4: Adds UV runtime support for Python extensions -// NOTE: This schema version is experimental and subject to change. import * as z from "zod"; export const MANIFEST_VERSION = "0.4"; diff --git a/src/schemas_loose/0.4.ts b/src/schemas_loose/0.4.ts index d75eed3..395fd60 100644 --- a/src/schemas_loose/0.4.ts +++ b/src/schemas_loose/0.4.ts @@ -1,5 +1,4 @@ // v0.4: Adds UV runtime support for Python extensions -// NOTE: This schema version is experimental and subject to change. import * as z from "zod"; export const MANIFEST_VERSION = "0.4"; diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 4dd48a5..a7c460a 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -15,7 +15,7 @@ export const LATEST_MANIFEST_VERSION = "0.4" as const; /** * Default manifest version for new packages */ -export const DEFAULT_MANIFEST_VERSION = "0.2" as const; +export const DEFAULT_MANIFEST_VERSION = "0.3" as const; /** * Map of manifest versions to their strict schemas