Skip to content

Refactor files directory to /app/files with Docker volume support#13

Merged
BillJr99 merged 1 commit into
mainfrom
claude/docker-install-volumes-24d5I
May 25, 2026
Merged

Refactor files directory to /app/files with Docker volume support#13
BillJr99 merged 1 commit into
mainfrom
claude/docker-install-volumes-24d5I

Conversation

@BillJr99
Copy link
Copy Markdown
Owner

Summary

Migrates the built-in mcpproxy__listfiles and mcpproxy__getfile tools from using a relative .playwright-mcp directory to an absolute /app/files path 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)

    • Updated config.py, builtin_tools.py, and server.py to reflect new default
    • run_local.sh sets MCPPROXY_FILES_DIR to ./files for local non-Docker runs
  • Docker Compose volumes: Added five new named volumes to docker-compose.yml for 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.yml to bind-mount ./tools, ./files, and ./repos locally while keeping cache volumes as named volumes

  • Dockerfile: Added environment variables MCPPROXY_FILES_DIR=/app/files and MCPPROXY_REPOS_DIR=/app/repos

  • Documentation: Comprehensive updates to README.md including:

    • New "Volumes & caching" section explaining each volume's purpose and cold-start speedup
    • Updated Docker run examples with persistent volume mounts
    • Migration notes for users with existing .playwright-mcp directories
    • Clarified provider artifact organization (e.g., Playwright under /app/files/playwright)
  • Tests: Added TestDefaultBaseDir class to verify /app/files is the correct default and matches config

  • Build context: Updated .dockerignore to exclude files/ and repos/ directories from Docker builds

Notable Implementation Details

  • All cache/artifact volumes are optional—containers fall back to ephemeral storage if volumes are omitted
  • Provider commands should write artifacts to subdirectories (e.g., --output-dir /app/files/playwright for Playwright)
  • mcpproxy__listfiles and mcpproxy__getfile now support path parameters to drill into subdirectories
  • Backward compatibility: MCPPROXY_FILES_DIR environment variable can still override the default

https://claude.ai/code/session_012Dvze1U4rQkqTsfKFatWVr

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.
@BillJr99 BillJr99 merged commit cc56201 into main May 25, 2026
2 checks passed
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