Skip to content

fix(agent-environment): sync MCP install script with template pins (#34)#57

Closed
Abhishek21g wants to merge 1 commit into
scaleapi:mainfrom
Abhishek21g:fix/mcp-atlas-fs-pin-sync
Closed

fix(agent-environment): sync MCP install script with template pins (#34)#57
Abhishek21g wants to merge 1 commit into
scaleapi:mainfrom
Abhishek21g:fix/mcp-atlas-fs-pin-sync

Conversation

@Abhishek21g

@Abhishek21g Abhishek21g commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Problem

mcp_server_template.json bumped @modelcontextprotocol/server-filesystem to 2026.7.10 but dev_scripts/install_mcp_packages.sh still installed @2025.11.25. Docker builds use the install script, so images could ship the broken pin — every directory_tree call fails MCP output validation (-32602) regardless of model (see #34, modelcontextprotocol/servers#3110).

Also drifted: duckduckgo-mcp-server (0.1.1 vs 0.5.0) and wikipedia-mcp (missing from install script).

Repro

cd services/agent-environment
python3 -m pytest tests/test_mcp_config_sync.py -v

Fails on main before this fix (NPX version mismatch on filesystem pin).

Fix

Verification

cd services/agent-environment
python3 -m pytest tests/ -v

Both test_package_sync and test_filesystem_pin_meets_minimum_for_directory_tree pass.

Greptile Summary

This PR syncs dev_scripts/install_mcp_packages.sh with mcp_server_template.json to fix a version drift that caused every directory_tree call to fail with MCP output validation error -32602 when using the @2025.11.25 filesystem server pin.

  • Bumps @modelcontextprotocol/server-filesystem from 2025.11.25 to 2026.7.10, duckduckgo-mcp-server from 0.1.1 to 0.5.0, and adds wikipedia-mcp==2.0.1 to the install script.
  • Adds tests/test_filesystem_pin.py as a regression guard enforcing the minimum CalVer pin, and documents the pin policy in README.md.

Confidence Score: 4/5

The version bump and sync are correct and well-guarded by two new tests; only minor polish issues remain.

The core changes — version pin updates and the new CalVer regression guard — address a real runtime breakage. The only findings are a redundant assertion, an upstream issue-number discrepancy in a docstring, and a missing trailing newline in the shell script, none of which affect runtime behavior.

The docstring in tests/test_filesystem_pin.py references a different upstream issue number than the PR description; worth a quick double-check before merge.

Important Files Changed

Filename Overview
services/agent-environment/dev_scripts/install_mcp_packages.sh Bumps filesystem server from 2025.11.25 to 2026.7.10, duckduckgo from 0.1.1 to 0.5.0, and adds wikipedia-mcp==2.0.1 to align with template pins; still missing trailing newline.
services/agent-environment/tests/test_filesystem_pin.py New regression guard that reads the template JSON and verifies the filesystem CalVer pin meets the minimum; contains a logically redundant second assertion and an upstream issue-number discrepancy in its docstring.
services/agent-environment/README.md Adds pin-policy documentation explaining the template-as-source-of-truth contract and the minimum filesystem version required to avoid -32602 errors.

Fix All in Cursor Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
services/agent-environment/tests/test_filesystem_pin.py:50-56
The second assertion is logically redundant: if `calver >= MIN_FILESYSTEM_CALVER` (2025, 12, 18) passes, the result can never equal `KNOWN_BAD_FILESYSTEM_CALVER` (2025, 11, 25) since that value is strictly less than the minimum. The extra check adds noise without catching any additional cases.

```suggestion
    assert calver >= MIN_FILESYSTEM_CALVER, (
        f"filesystem pin {pin} is below minimum {MIN_FILESYSTEM_CALVER} "
        "(directory_tree MCP validation — see #34)"
    )
```

### Issue 2 of 3
services/agent-environment/tests/test_filesystem_pin.py:4-6
The PR description cites `modelcontextprotocol/servers#3110` as the upstream bug report, but the module docstring references `#3113`. These point to different issues — one of the two is wrong and will mislead anyone tracing the fix.

```suggestion
The filesystem MCP server @2025.11.25 returns structured content for
directory_tree that fails MCP output validation (-32602). Fixed upstream in
modelcontextprotocol/servers#3110 (2025.12.18+).
```

### Issue 3 of 3
services/agent-environment/dev_scripts/install_mcp_packages.sh:44
The file is still missing a trailing newline (the diff shows `\ No newline at end of file`). POSIX requires text files to end with a newline, and some tools (e.g. `cat`, `wc -l`) behave unexpectedly without one.

```suggestion
echo "All UVX/NPX MCP packages installation complete. Ignored any that install from github!"
```

Reviews (1): Last reviewed commit: "fix(agent-environment): sync MCP install..." | Re-trigger Greptile

…caleapi#34)

Template bumped filesystem to @2026.7.10 but install_mcp_packages.sh still
installed @2025.11.25, breaking directory_tree MCP validation in Docker builds.
Also sync duckduckgo-mcp-server and wikipedia-mcp pins; add regression test.
@kalyanamdewri

Copy link
Copy Markdown

Container-level directory_tree validation

Image sha256:bffc65f85555c35647b3e856c328f3da634e76fac364049d5e86e187ff1fd109 installed filesystem server 2026.7.10. Request hash sha256:b917460a753778d7dbab4d45d12e50c2d2ac7319c50b588ac1c151e947cf29ce returned JSON-RPC code none (success); schema validation PASSED at none.

Ref Installed package RPC result Duration
main d01e9b590e931f877bc01565ab57d191603561f6 @modelcontextprotocol/server-filesystem@2026.7.10 success; schema and expected tree passed 0.002757 s
PR 9c0bc6098784093daf5c547fe9712ed99d31476e @modelcontextprotocol/server-filesystem@2026.7.10 success; schema and expected tree passed 0.002833 s

Request, response, and image manifest: https://gist.github.com/kalyanamdewri/b21e64b90332b07c0004d9d7263d8b2d. This validates the built container only; I did not test other MCP tools, the HTTP /call-tool aggregation path, production-scale directory trees, or non-Docker deployments.

geobio added a commit that referenced this pull request Jul 22, 2026
…63)

* ci: add pin-sync CI + regression guards for MCP install-script drift

The template->install-script pin drift that broke directory_tree (#34) shipped
because the sync test was never wired to run — the repo had no CI at all.

- Add .github/workflows/agent-environment-tests.yml to run the pin-sync tests
  on every PR touching the template, install script, or tests.
- Add tests/test_filesystem_pin.py: minimum-CalVer floor so the filesystem pin
  can't regress below the upstream fix (2025.12.18), which the sync test alone
  would miss when template and script are bumped down together. (from #57)
- Close the reverse-drift blind spot in test_package_sync: the docstring
  claimed to catch stale packages left in the script, but only checked the
  template->script direction. Now asserts script-template is empty too.
- Document the pin policy in services/agent-environment/README.md. (from #57)

Supersedes the remainder of #57 (its version bumps already landed via 60ae87d).

Co-Authored-By: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Update README.md

---------

Co-authored-by: Abhishek Enaguthi <enaguthiabhishek@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@geobio

geobio commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

I couldn't directly push to this branch, but I took your changes into this new PR. Thanks @Abhishek21g !! #63

@geobio geobio closed this Jul 22, 2026
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.

3 participants