Refactor files directory to /app/files with Docker volume support#13
Merged
Conversation
Adds five named volumes alongside the existing mcpproxy-tools volume so repo clones, provider output artefacts, and package-manager caches survive container restarts: /app/files (mcpproxy-files) — replaces .playwright-mcp /app/repos (mcpproxy-repos) — git workdirs + builds /root/.cache (mcpproxy-cache) — pip / uv / ms-playwright /root/.npm (mcpproxy-npm) — npx package cache /root/.local/share/uv (mcpproxy-uv-tools) — uvx per-tool venvs Without the mounts the directories live on the container's writable layer — everything still works, just paid as cold-start latency on each fresh container. The MCPPROXY_FILES_DIR default moves from `.playwright-mcp` (cwd-relative) to `/app/files` so the built-in mcpproxy__listfiles / mcpproxy__getfile tools point at the new mountable volume. Playwright is launched with `--output-dir /app/files/playwright` in the README example. Migration note added for users with existing playwright.yaml files. run_local.sh now sets MCPPROXY_FILES_DIR=$ROOT_DIR/files and MCPPROXY_REPOS_DIR=$ROOT_DIR/repos for local non-Docker runs. Tests + README updated to reflect the new defaults; existing tests pass (303) and two new assertions cover the /app/files default in both builtin_tools and config.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the built-in
mcpproxy__listfilesandmcpproxy__getfiletools from using a relative.playwright-mcpdirectory to an absolute/app/filespath that can be mounted as a Docker volume. This enables persistent storage of provider artifacts (screenshots, snapshots, etc.) across container restarts and improves the Docker deployment experience.Key Changes
Default files directory: Changed from
.playwright-mcp(relative) to/app/files(absolute, Docker-friendly)config.py,builtin_tools.py, andserver.pyto reflect new defaultrun_local.shsetsMCPPROXY_FILES_DIRto./filesfor local non-Docker runsDocker Compose volumes: Added five new named volumes to
docker-compose.ymlfor persistent caching:mcpproxy-files→/app/files(provider artifacts)mcpproxy-repos→/app/repos(cloned git workdirs + build artifacts)mcpproxy-cache→/root/.cache(pip/uv wheels, Playwright binaries)mcpproxy-npm→/root/.npm(npm/npx package cache)mcpproxy-uv-tools→/root/.local/share/uv(uvx per-tool venvs)Development override: Updated
docker-compose.override.ymlto bind-mount./tools,./files, and./reposlocally while keeping cache volumes as named volumesDockerfile: Added environment variables
MCPPROXY_FILES_DIR=/app/filesandMCPPROXY_REPOS_DIR=/app/reposDocumentation: Comprehensive updates to README.md including:
.playwright-mcpdirectories/app/files/playwright)Tests: Added
TestDefaultBaseDirclass to verify/app/filesis the correct default and matches configBuild context: Updated
.dockerignoreto excludefiles/andrepos/directories from Docker buildsNotable Implementation Details
--output-dir /app/files/playwrightfor Playwright)mcpproxy__listfilesandmcpproxy__getfilenow support path parameters to drill into subdirectoriesMCPPROXY_FILES_DIRenvironment variable can still override the defaulthttps://claude.ai/code/session_012Dvze1U4rQkqTsfKFatWVr