3 ms·
For anyone trying this at home, if you want a starting point, you could use OP's, or you could use the official Filesystem API: https://github.com/modelcontextp
by rahimnathwani 2y ago
For anyone trying this at home, if you want a starting point, you could use OP's, or you could use the official Filesystem API: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem https://github.com/modelcontextprotocol/servers/tree/main/sr...
There are folks using just this filesystem API for coding: https://x.com/Zirkman/status/1897003182049649000 https://x.com/Zirkman/status/1897003182049649000
I'm not sure I would prefer it to using Cursor. I was using Claude Desktop client to edit a bunch of (non-code) text files a couple of days ago, and a couple of times it crashed, and I had to restart it. When this happened, it lost some conversation history, although of course the files it had already edited were fine.
There are other approaches to having Claude edit files, but they're less suited for use with MCP (and hence they don't save cost like the OP does).
A) Aider gives very specific instructions about how Claude should describe patch operations: https://github.com/Aider-AI/aider/blob/dd4d2420df51dc29c2aed4596f66272ae254bb24/aider/coders/editblock_prompts.py#L149 https://github.com/Aider-AI/aider/blob/dd4d2420df51dc29c2aed...
This works, but I don't know if anyone has tried using this technique in an MCP server. It seems like the way OP and the Filesystem MCP might be superior for small edits, but Aider's approach might be better for multiple edits in a single request-response. It should be possible to do this with an MCP server.
B) Anthropic provides fine-tuned models (text_editor_20250124 and text_editor_20241022) that know a specific text editing protocol: https://docs.anthropic.com/en/docs/build-with-claude/tool-use/text-editor-tool https://docs.anthropic.com/en/docs/build-with-claude/tool-us...
You could build a coding assistant like Aider on top of these, but obviously you're then tied to this implementation and it's harder to switch out models. And it wouldn't work with Claude Desktop.
- ezyang 2y agoI don't really recommend using filesystem MCP directly, it won't checkpoint changes so it's easy to end up in a state where you can't recover an older working version of the code. Use an actual coding oriented MCP.
- rahimnathwani 2y agoI'm going to try out yours (https://github.com/ezyang/codemcp https://github.com/ezyang/codemcp). I already pay for Cursor, but I'm curious. EDIT: I really like the way that each change generates a commit, and that all commits in a single session are squashed into one commit, whilst preserving the hash of each individual change. EDIT2: I also like you only have one function (each command being a 'subtool'), which means Claude Desktop asks for permission only once per session.
- ezyang 2y agoAnd if you don't like clicking, even once, check out my other project, Refined Claude :)
- rahimnathwani 2y agoWow. You should go on baby leave more often!
- dang 2y agoRelated ongoing thread: Show HN: Codemcp – Claude Code for Claude Pro subscribers – ditch API bills - https://news.ycombinator.com/item?id=43356016 https://news.ycombinator.com/item?id=43356016 - March 2025 (3 comments)