From 91d9ddd0fe08f982b2246026d3067cfc130631d5 Mon Sep 17 00:00:00 2001 From: Mathew Goldsborough <1759329+mgoldsborough@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:48:56 -1000 Subject: [PATCH] Anchor project-only patterns in .mcpbignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unanchored gitignore patterns (no leading `/`) in .mcpbignore match anywhere in the tree — including inside vendored `deps/` (Python) or `node_modules/` (Node). mcpb pack then strips legitimate runtime files from bundled packages, which can break imports when the bundle starts. The trap fired on synapse-research 0.1.1 and openweathermap 0.4.0: an unanchored `conftest.py` pattern stripped `deps/beartype/_conf/ conftest.py` (a real runtime module, not a pytest config), and the bundle failed with `MCP error -32000: Connection closed`. Fix: anchor project-only patterns with a leading `/`, keep cross-tree hygiene (`__pycache__/`, `*.pyc`, `.DS_Store`) unanchored, and drop the redundant `conftest.py` rule (pytest configs already live under `/tests/`). No behavior change for the currently-published artifact; this is preventive — the next release will produce a bundle that keeps vendored deps intact. --- .mcpbignore | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/.mcpbignore b/.mcpbignore index e483ce8..a767974 100644 --- a/.mcpbignore +++ b/.mcpbignore @@ -1,43 +1,51 @@ +# mcpb pack loads this file and treats each pattern as gitignore-style. +# Gitignore rule that bites: a pattern without a leading `/` matches +# anywhere in the tree, including inside `deps/` / `node_modules/`. +# Unanchored `tests/` or `conftest.py` strips vendored runtime modules +# and breaks imports at bundle startup. Project-only patterns are +# anchored with `/` below; cross-tree hygiene (`__pycache__`, `*.pyc`, +# `.DS_Store`) is left unanchored intentionally. + # Development environment (deps/ is created by build action) -.venv/ -.git/ -.github/ -.pytest_cache/ +/.venv/ +/.git/ +/.github/ +/.pytest_cache/ __pycache__/ *.pyc # Tool caches -.mypy_cache/ -.ruff_cache/ -.coverage +/.mypy_cache/ +/.ruff_cache/ +/.coverage # Test files -tests/ -e2e/ +/tests/ +/e2e/ # Build artifacts -dist/ -build/ +/dist/ +/build/ *.egg-info/ *.mcpb # Dev config -Makefile -pytest.ini -pyproject.toml -.env -.env.* +/Makefile +/pytest.ini +/pyproject.toml +/.env +/.env.* # Lock files -uv.lock +/uv.lock # Scripts -scripts/ +/scripts/ # Claude Code -.claude/ -CLAUDE.md +/.claude/ +/CLAUDE.md # IDE -.vscode/ -.idea/ +/.vscode/ +/.idea/