Skip to content

Could not attach to MCP server filesystem #267

Closed as not planned
Closed as not planned

Description

@mearleycf

Describe the bug
I'm trying to implement various MCP servers, including the filesystem server, the memory server, and the playwright server. However, I keep getting failures.
CleanShot 2024-12-08 at 03 24 23
I've uploaded a screenshot of the errors I get in the app. In the dev tools console, I see:

Could not attach to MCP server filesystem: eE: MCP error -2: Request timed out
  at https://claude.ai/_next/static/chunks/foo.js:1:4404
  at r (https://claude.ai/_next/static/chunks/bar.js:15:2950)
(anonymous) @baz.js:18

This is my config.json content:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/server-filesystem",
        "/Users/myusername/code/"
      ]
    },
    "mcp-obsidian": {
      "command": "uvx",
      "args": ["mcp-obsidian"],
      "env": {
        "OBSIDIAN_API_KEY": "reallylongkey"
      }
    },
    "@modelcontextprotocol-server-memory": {
      "runtime": "node",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    },
    "playwright": {
      "command": "npx",
      "args": ["-y", "@automatalabs/mcp-server-playwright"]
    }
  }
}

Note: MCP Obsidian DOES work--the other three do not.

To Reproduce
Steps to reproduce the behavior:

  1. Set up config.json
  2. launch Claude desktop app
  3. Wait for error message to appear

Expected behavior
I expect to see something like this:

MCP Obsidian Server running on stdio
Allowed directories: [ '/users/myusername/code/pathtovault/vaultname' ]

Logs
This is what appears in the file /Users/myusername/Library/Logs/Claude/mcp.log:

2024-12-08T08:23:21.820Z [info] Attempting to connect to MCP server filesystem...
2024-12-08T08:23:21.823Z [info] Attempting to connect to MCP server mcp-obsidian...
2024-12-08T08:23:21.823Z [info] Attempting to connect to MCP server @modelcontextprotocol-server-memory...
2024-12-08T08:23:21.824Z [info] Attempting to connect to MCP server playwright...
2024-12-08T08:23:21.843Z [info] Connected to MCP server mcp-obsidian!
2024-12-08T08:23:21.845Z [info] Connected to MCP server filesystem!
2024-12-08T08:23:21.852Z [info] Connected to MCP server @modelcontextprotocol-server-memory!
2024-12-08T08:23:21.853Z [info] Connected to MCP server playwright!

Additional context
Like I said, it's working for obsidian, not for the other 3. Also, I AM able to connect to the filesystem server using MCP Inspector:
CleanShot 2024-12-08 at 03 35 45

Activity

  1. MikeyBeez commented on Dec 8, 2024

    @MikeyBeez

    I had the file system working along with Brave search, now nothing is working.

  2. LarsBuur commented on Dec 9, 2024

    @LarsBuur

    It is very random. I also had file system + Brave search working in one instance. Then, after a restart of the Claude desktop without any changes in the configuration file, it stopped working. Now, rarely does the server filesystem work.

    Looking into mcp-server-filesystem.log
    When it works (rarely) this is what it looks like:
    Secure MCP Filesystem Server running on stdio
    Allowed directories: [ '/users/someone/documents/somedir' ]

    When it doesn't work (most of the time) this is what it looks like:
    command not found: /Users/someone/Documents/somedir

    Same config file. No changes.

  3. jobox05 commented on Dec 9, 2024

    @jobox05

    Its happening to me as well, even with just the fileserver installed.

  4. MikeyBeez commented on Dec 9, 2024

    @MikeyBeez

    I fixed my problem. I had a file listed in with the directories. That makes accessing the filesystem fail. I removed it, restarted the claude app, and file access reactivated through MCP.

  5. LarsBuur commented on Dec 10, 2024

    @LarsBuur

    What kind of file @MikeyBeez? - and did it fail if you just ran

    npx -y @modelcontextprotocol/server-filesystem /users/whaever/documents in a console?

  6. MikeyBeez commented on Dec 10, 2024

    @MikeyBeez

    I had included the claude desktop config json file in the list of allowed directories. I didn't get an error message except failure to connect via MCP.

  7. fanthus commented on Mar 26, 2025

    @fanthus
    (base) ➜  ~ npx -y @modelcontextprotocol/server-filesystem /Users/yuyang/Desktop 
    Secure MCP Filesystem Server running on stdio
    Allowed directories: [ '/Users/yuyang/Desktop' ]
    

    the command work fine, however in claude it failed with this

    2025-03-26T03:53:27.788Z [filesystem] [info] Initializing server...
    2025-03-26T03:53:27.794Z [filesystem] [info] Server started and connected successfully
    2025-03-26T03:53:27.823Z [filesystem] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
    **command not found: /Users/yuyang/Desktop**
    2025-03-26T03:53:28.209Z [filesystem] [info] Server transport closed
    2025-03-26T03:53:28.209Z [filesystem] [info] Client transport closed
    2025-03-26T03:53:28.209Z [filesystem] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', file=sys.stderr)` in python) and it will appear in this log.
    2025-03-26T03:53:28.209Z [filesystem] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
    2025-03-26T03:53:28.209Z [filesystem] [info] Client transport closed
    

    Same mcp server config work fine in Cursor, just Claude can't connect server.

  8. added
    server-filesystemReference implementation for the Filesystem MCP server - src/filesystem
    on Apr 26, 2025
  9. bjarkimg commented on Jun 4, 2025

    @bjarkimg

    Close issue, ?

  10. olaservo commented on Jul 3, 2025

    @olaservo
    Member

    Hi, going to close this one since it seems more related to issues with the app than a bug with a server, but feel free to re-open if needed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserver-filesystemReference implementation for the Filesystem MCP server - src/filesystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions