MCP 2.3.0: tea_file_edit, exact-text replacements in one file (#12) #13

Merged
teahubxyz merged 2 commits from tea-file-edit into main 2026-10-16 23:21:51 +00:00
Owner

Closes #12.

A commit through the MCP needs the whole file in one call, and one model answer carries about 100 KB at most, so a long file (ventures/havre/app.js on teahubxyz/time, 174 KB) could not take an eight-hunk change today. tea_file_edit reads the file at the branch, applies exact-text replacements in order (each old must occur exactly once in the file as it stands; new takes its place, empty removes it), commits one update with the file's sha under the caller's own authority, and answers with the new file's size and sha256 to check against the caller's copy. Same bounds as tea_commit (3 MB), no deletes.

  • mcp/tea_mcp/server.py: the tool, Edit, version 2.3.0
  • mcp/tests/test_server.py: replacements in order and what it answers; every refusal before anything is committed
  • mcp/README.md: tools (32)

Tests: 40 of 40 pass from a clean checkout of this branch on hb-5 (Python 3.13, requirements.txt); the checkout went to the Trash afterwards. This sandbox cannot reach PyPI, so they could not run here.

After the merge: boring_teahub_deploy of the merged main SHA, health check (version 2.3.0), a line in docs/decisions.md, then the Havre edit that needed it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SKUMBXauq7XVN4BhTXjCSM

Closes #12. A commit through the MCP needs the whole file in one call, and one model answer carries about 100 KB at most, so a long file (`ventures/havre/app.js` on `teahubxyz/time`, 174 KB) could not take an eight-hunk change today. `tea_file_edit` reads the file at the branch, applies exact-text replacements in order (each `old` must occur exactly once in the file as it stands; `new` takes its place, empty removes it), commits one update with the file's sha under the caller's own authority, and answers with the new file's size and sha256 to check against the caller's copy. Same bounds as `tea_commit` (3 MB), no deletes. - `mcp/tea_mcp/server.py`: the tool, `Edit`, version 2.3.0 - `mcp/tests/test_server.py`: replacements in order and what it answers; every refusal before anything is committed - `mcp/README.md`: tools (32) Tests: 40 of 40 pass from a clean checkout of this branch on hb-5 (Python 3.13, `requirements.txt`); the checkout went to the Trash afterwards. This sandbox cannot reach PyPI, so they could not run here. After the merge: `boring_teahub_deploy` of the merged main SHA, health check (version 2.3.0), a line in `docs/decisions.md`, then the Havre edit that needed it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SKUMBXauq7XVN4BhTXjCSM
teahubxyz added 2 commits 2026-10-16 22:47:48 +00:00
For a file too long to send whole: the edits apply in order, each old text must occur exactly once in the file as it stands, and the answer gives the new file's size and sha256 to check against the caller's copy. Version 2.3.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKUMBXauq7XVN4BhTXjCSM
Replacements apply in order and the answer says what was made; every refusal comes before anything is committed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKUMBXauq7XVN4BhTXjCSM
teahubxyz merged commit b5376e9dee into main 2026-10-16 23:21:51 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: teahubxyz/teahub#13