Skip to content

Anchor project-only patterns in .mcpbignore - #177

Closed
mgoldsborough wants to merge 8 commits into
ClickHouse:mainfrom
NimbleBrainInc:fix/mcpbignore-anchor-patterns
Closed

Anchor project-only patterns in .mcpbignore#177
mgoldsborough wants to merge 8 commits into
ClickHouse:mainfrom
NimbleBrainInc:fix/mcpbignore-anchor-patterns

Conversation

@mgoldsborough

Copy link
Copy Markdown

Summary

Unanchored gitignore patterns in .mcpbignore match anywhere in the tree, including inside vendored deps/ or node_modules/. mcpb pack then strips legitimate runtime files from bundled packages.

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), breaking the FastMCP import chain and crashing the MCP subprocess with MCP error -32000: Connection closed.

This PR anchors project-only patterns with a leading /, leaves cross-tree hygiene (__pycache__/, *.pyc, .DS_Store) unanchored, and drops the redundant conftest.py rule (already covered by /tests/).

No behavior change for the currently-published artifact — this is preventive. The next release from this repo will produce a bundle that keeps vendored deps intact.

Matches the canonical .mcpbignore shape in mcp-server-template-python and mcp-server-template-typescript.

Test plan

  • make bundle (or equivalent) and confirm no regressions in the packaged output
  • On next release, verify the published bundle still starts cleanly

mgoldsborough and others added 8 commits December 24, 2025 08:03
- Export ASGI app for uvicorn (mcp_clickhouse.mcp_server:app)
- Add manifest.json for MCPB packaging
- Add .mcpbignore to exclude dev files from bundle
- Add build-bundle.yml workflow for CI/CD

This enables deployment via MCPB bundles while preserving
all existing functionality (stdio, HTTP, SSE transports).
Add MCPB bundle support for HTTP deployment
- Restructure to src-layout (src/mcp_clickhouse/)
- Update manifest to use module execution (-m mcp_clickhouse.mcp_server)
- Add user_config for connection settings (host, user, password, port, database, secure, verify)
- Update workflow to use mcpb-pack@v2
- Add darwin-arm64 platform support
- Add stdio entry point alongside HTTP app
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.
@mgoldsborough

Copy link
Copy Markdown
Author

Sorry, wrong target — this was meant for our fork at NimbleBrainInc/mcp-clickhouse, not upstream. Re-filing there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant