modelcontextprotocol / modelcontextprotocol/servers

mcp/filesystem cannot use working directory only on LM Studio

Open
#2,389 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug server-filesystem
Dominant language
TypeScript
Stars
90.5k
Forks
11.7k
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Describe the bug
mcp/filesystem does not start under LM Studio without specified path or with working directory as described in intelij idea integration

To Reproduce
Steps to reproduce the behavior:

  1. put the tool in mcp.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
      ]
    }
  }
}
  1. Enable it
    Expected behavior
    The tool should be usable.

Logs

2025-07-20 22:12:47 [ERROR]
 [Plugin(mcp/filesystem)] stderr: Usage: mcp-server-filesystem <allowed-directory> [additional-directories...]
2025-07-20 22:12:47 [ERROR]
 [Plugin(mcp/filesystem)] stderr: Error in LM Studio MCP bridge process: _0x4143fb [McpError]: MCP error -32000: Connection closed
    at _0x477d3a._onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:822761)
    at <computed>.onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:821476)
    at ChildProcess.<anonymous> (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:796633)
    at ChildProcess.emit (node:events:519:28)
    at _0x4f9a1e.<computed> [as emit] (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:279636)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: -32000,
  data: undefined
}
_0x4143fb [McpError]: MCP error -32000: Connection closed
    at _0x477d3a._onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:822761)
    at <computed>.onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:821476)
    at ChildProcess.<anonymous> (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:796633)
    at ChildProcess.emit (node:events:519:28)
    at _0x4f9a1e.<computed> [as emit] (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:279636)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: -32000,
  data: undefined
}

Additional context
with "${workspaceFolder}" as standin for working directory shows

2025-07-20 22:27:14 [ERROR]
 [Plugin(mcp/filesystem)] stderr: Error accessing directory ${workspaceFolder}: Error: ENOENT: no such file or directory, stat 'C:\Users\danda\.lmstudio\extensions\plugins\mcp\filesystem\${workspaceFolder}'
    at async Object.stat (node:internal/fs/promises:1032:18)
    at async file:///C:/Users/danda/AppData/Local/npm-cache/_npx/a3241bba59c344f5/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js:48:23
    at async Promise.all (index 0)
    at async file:///C:/Users/danda/AppData/Local/npm-cache/_npx/a3241bba59c344f5/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js:46:1 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'C:\\Users\\danda\\.lmstudio\\extensions\\plugins\\mcp\\filesystem\\${workspaceFolder}'
}
2025-07-20 22:27:14 [ERROR]
 [Plugin(mcp/filesystem)] stderr: Error in LM Studio MCP bridge process: _0x4143fb [McpError]: MCP error -32000: Connection closed
    at _0x477d3a._onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:822761)
    at <computed>.onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:821476)
    at ChildProcess.<anonymous> (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:796633)
    at ChildProcess.emit (node:events:519:28)
    at _0x4f9a1e.<computed> [as emit] (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:279636)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: -32000,
  data: undefined
}
2025-07-20 22:27:14 [ERROR]
 [Plugin(mcp/filesystem)] stderr: _0x4143fb [McpError]: MCP error -32000: Connection closed
    at _0x477d3a._onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:822761)
    at <computed>.onclose (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:821476)
    at ChildProcess.<anonymous> (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:796633)
    at ChildProcess.emit (node:events:519:28)
    at _0x4f9a1e.<computed> [as emit] (D:\Program Files\LM Studio\resources\app\.webpack\lib\mcpbridgeworker.js:1:279636)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: -32000,
  data: undefined
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mcp/filesystem entry point and the server-filesystem dist/index.js behavior shown in the logs, then review the mcp.json arguments used by LM Studio. Reproduce both the missing-path and literal ${workspaceFolder} cases. Done means the filesystem server starts in LM Studio with an appropriate working-directory configuration and the connection remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.