Get the FREE Ultimate OpenClaw Setup Guide →

MCP -docker-guide

Complete guide to setting up Model Context Protocol (MCP) servers with Docker on Linux. Step-by-step tutorial for Claude Desktop, Cursor, and Windsurf integration.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yugp31-mcp-server-docker-guide docker run -i --rm --mount type=bind,src=/path/to/your/repo,dst=/repo git --repository /repo

How to use

This MCP server collection runs as Docker containers, each exposing a specific capability in the MCP standard. The common pattern is to launch a container with docker run and pass arguments that mount your workspace or data, along with any required environment variables (for example API keys). Tools available include a filesystem explorer (filesystem), a Git client (git), Brave Search integration (brave-search), a lightweight SQLite data store (sqlite), a generic fetch tool (fetch), a memory/persistence tool (memory), a headless browser/tooling suite (puppeteer), and a Google Maps integration (google-maps). Clients connect to these servers via the MCP protocol using STDIO, so your MCP client application should forward I/O streams to the corresponding docker run commands. This setup keeps runtimes isolated and portable, ideal for local tool access by AI assistants.

How to install

Prerequisites:

  • Docker installed and running
  • Git installed
  • An MCP-compatible client (e.g., Claude Desktop, Cursor, Windsurf)
  1. Install Docker and Git

  2. Clone the official MCP servers repo

  3. Build MCP server images (optional if prebuilt images are available)

    • Create a build script as shown in the repository and run: chmod +x build_servers.sh ./build_servers.sh
    • This will build the container images used by the MCP servers (filesystem, git, brave-search, sqlite, fetch, memory, puppeteer, google-maps, etc.).
  4. Run MCP servers via Docker (example commands)

    • For each server, run the docker run commands shown in the mcp_config section of this doc. Adjust paths and environment variables to your system: docker run -i --rm --mount type=bind,src=/home/YOUR_USERNAME/mcp-workspace,dst=/workspace,readonly --memory 512m --cpus 0.5 filesystem /workspace docker run -i --rm --mount type=bind,src=/path/to/your/repo,dst=/repo git --repository /repo docker run -i --rm -e BRAVE_API_KEY=YOUR_KEY brave-search docker run -i --rm --mount type=bind,src=/home/YOUR_USERNAME/databases,dst=/data sqlite docker run -i --rm fetch docker run -i --rm memory docker run -i --rm --init --cap-drop=ALL --security-opt=no-new-privileges -e DOCKER_CONTAINER=true puppeteer docker run -i --rm -e GOOGLE_MAPS_API_KEY=YOUR_KEY google-maps
  5. Configure your MCP client

    • Point each server entry in your client configuration to the corresponding docker-based command/args. Example: the filesystem server uses docker with the filesystem image, and maps your workspace read-only for safety.

Additional notes

Tips and notes:

  • Always review the server source code before running containers, especially when using Docker images from third parties.
  • Prefer read-only mounts (:ro) when possible to limit writable access.
  • Do not expose MCP containers directly to the internet; use a controlled network.
  • Manage API keys through environment variables, not in config files.
  • Keep Docker images updated to pick up security fixes.
  • If you modify host paths, ensure they exist and have appropriate permissions for the container user.
  • For the Brave Search tool, provide your BRAVE_API_KEY as an environment variable; similarly provide GOOGLE_MAPS_API_KEY for google-maps.
  • When using the Puppeteer server, security settings (capabilities and no-new-privileges) are applied to minimize risk.

Related MCP Servers

Sponsor this space

Reach thousands of developers