Skip to content

Conversation

ankittk
Copy link
Contributor

@ankittk ankittk commented Sep 15, 2025

ISSUE: #98
The issue was that when MCPJungle runs inside a Docker container, the filesystem MCP server could only access files within the container, not the host machine's filesystem.

It uses npx @modelcontextprotocol/server-filesystem . runs with the container's working directory, which is typically / or the container's root. This means it can only access files within the container, not the host machine's filesystem.

Why?
The client.NewStdioMCPClient() function from the mcp-go library doesn't provide a way to specify the working directory for the subprocess, so it inherits the working directory of the parent MCPJungle process.

So if we modify the docker config to mount the host fs into the container and update the MCP server fs config to use the mounted path, this should fix this.

  • Added volume mounts to both docker-compose.yaml and docker-compose-prod.yaml to mount the host filesystem at /host inside the container.
  • Added readme + develoment instruction for docker filesystem
  • Instead of storing filesystem.json in examples/ directory, we could simply use in README and DEVELOPMENT, users can copy paste and use directly as they are very simple and reduces maintenance, fewer files to manage too

@ankittk ankittk force-pushed the feature/fs-run-inside-docker branch from 544bf5b to 242619d Compare September 15, 2025 07:37
@@ -298,6 +299,8 @@ The config file format for registering a Streamable HTTP-based MCP server is:
### Registering STDIO-based servers

Here's an example configuration file (let's call it `filesystem.json`) for a MCP server that uses the STDIO transport:

**For local development:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with When running mcpjungle directly on the host machine

@@ -40,6 +40,12 @@ services:
OTEL_ENABLED: ${OTEL_ENABLED:-true}
ports:
- "8080:8080"
volumes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep this code but comment it out, with a comment that tells the user to enable it if they want to mount.

This compose file is designed to be run on remote servers and by default, we shouldn't touch things outside docker boundary.
because production users will probably not use filesystem mcp server (filesystem is useful for running locally, so mostly individual users running mcpjungle for their personal use benefit from it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants