-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filesystem - edit_file function missing despite being in the codebase #294
Comments
This might be a bug in the MCP implementation of Claude Desktop. It appears to be an issue with the type of the
As far as I can tell an array of objects is a valid type for an argument in the protocol schema. |
Thanks so much for looking into this!
I don't know if I missunderstood you or if we are talking about different
things. The edit_file function isn't showing up at all in my available
tools on Claude Desktop - it's completely missing, not just having
parameter issues. While read_file and write_file work perfectly fine, I
can't even see edit_file in the tools list.
Thanks again !
Le mer. 11 déc. 2024, 22:27, Kees Heuperman ***@***.***> a
écrit :
… This might be a bug in the MCP implementation of Claude Desktop. It
appears to be an issue with the type of the edits argument, which is an
array of objects.
1. The inspector recognises the edit_file tool as expected.
2. If you replace edits and use oldText and newText directly, the tool
is recognised and works (but can only make a single edit at a time of
course).
As far as I can tell an array of objects is a valid type for an argument
in the protocol schema.
—
Reply to this email directly, view it on GitHub
<#294 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQRSZTMYWSCAMC5QT5EBNY32FCU5ZAVCNFSM6AAAAABTKPSUBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZXGIZDQNRSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The issue is that the option isn't being listed as the app is considering that command to be invalid since you're using an array vs something like |
Thanks for explaining! If I understand correctly, this is a Claude Desktop
limitation - it can't handle tools that use array parameters, which is why
edit_file isn't available at all.
Am I right in thinking our only options are either waiting for Claude to
update their app, or trying to build a local version of the MCP server
using strings instead of arrays? For now I'm using read_file + write_file
as a workaround, but I'd love to know if there are other solutions I might
have missed.
Le mer. 11 déc. 2024, 22:56, Aschent ***@***.***> a écrit :
… The issue is that the option isn't being listed as the app is considering
that command to be invalid since you're using an array vs something like
.string(). If you review all of the Schema definitions in index.ts, none
of them except EditFileArgsSchema use an array.
—
Reply to this email directly, view it on GitHub
<#294 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQRSZTOHVI2S5RN2TSEZCFT2FCYHFAVCNFSM6AAAAABTKPSUBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZXGI3TMOBWGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@yannisTr what I meant was that although the Note that the We can either wait for the Claude Desktop team to find out about this issue and fix it, or apply some workarounds. I can think of a few, but they're all quite hacky:
|
This function would be very useful indeed. The hacky ways described above would not really work in my case. I hope the Anthropic folks see this and provide a fix. |
Ditto here - would love for a fix for this! Using write_file to make edits is risky and a waste of tokens! |
@cbusillo you absolute dreamboat! thank you! |
@cbusillo you are the godsend, thank you! |
@xRoyBatty funny story. I saw filesystem only had write_file so I made my own filesystem MCP. Then I saw in the readme it does have an edit_file, so I deleted mine and reinstalled. I spent time trying to figure out why the LLM REFUSED to use edit_file. Turns out, as you found out, the npm version didn't have edit_file. Lol. I felt dumb. |
@cbusillo I think another problem has occured now. Whenever I tell claude to use edit_file the app crashes "Claude will eturn soon". It is listed in tools and all the other tools work fine. |
That's odd. Just to confirm, it does work for me. Can you test it with something other than Claude, since I don't believe Claude has a per MCP log? I know LibreChat does. That may be helpful for troubleshooting. |
For anyone trying to get this working until implementation is streamlined, here are the below steps: |
I've noticed a discrepancy between the documented features and actual implementation of the MCP filesystem server.
What's happening:
But:
Current config
Solutions tried
npm install -g @modelcontextprotocol/server-filesystem
@modelcontextprotocol/server-filesystem@latest
The text was updated successfully, but these errors were encountered: