This guide explains how to connect the MCP Context Server to Claude Code using the one-command Docker bootstrap. One command downloads the Docker Compose stack, starts all services, and fully configures Claude Code with context management hooks, skills, and rules.
The MCP Context Server provides persistent multimodal context storage for LLM agents over the Model Context Protocol (MCP). The one-command bootstrap handles everything:
- Downloads and starts the Docker stack -- PostgreSQL (with pgvector), Ollama (embedding + summary models), and the MCP Context Server (HTTP transport on port
8000). - Fully configures Claude Code -- registers the MCP server, installs context management hooks, skills, rules, and sets appropriate permissions.
No manual steps required. No local clone of this repository needed. No Git required.
- Docker Desktop installed and running
- Windows PowerShell 5.1+ (Windows) or Bash (macOS / Linux)
- Host port
8000available - ~2 GB free disk space (Docker images + Ollama models)
Run the command for your operating system. Each command does the same thing: installs uv, downloads the Docker Compose stack, starts the services, and fully configures Claude Code.
powershell -NoProfile -NoExit -ExecutionPolicy Bypass -Command "`$env:CLAUDE_CODE_TOOLBOX_ENV_CONFIG='https://raw.githubusercontent.com/GetActionSpace/mcp-context-server/refs/heads/main/agents/claude-code/environment-docker-ollama.yaml'; `$env:CLAUDE_CODE_TOOLBOX_SKIP_INSTALL='1'; iex (irm 'https://raw.githubusercontent.com/alex-feel/claude-code-toolbox/main/scripts/windows/setup-environment.ps1')"CLAUDE_CODE_TOOLBOX_ENV_CONFIG='https://raw.githubusercontent.com/GetActionSpace/mcp-context-server/refs/heads/main/agents/claude-code/environment-docker-ollama.yaml' \
CLAUDE_CODE_TOOLBOX_SKIP_INSTALL=1 \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/alex-feel/claude-code-toolbox/main/scripts/macos/setup-environment.sh)"CLAUDE_CODE_TOOLBOX_ENV_CONFIG='https://raw.githubusercontent.com/GetActionSpace/mcp-context-server/refs/heads/main/agents/claude-code/environment-docker-ollama.yaml' \
CLAUDE_CODE_TOOLBOX_SKIP_INSTALL=1 \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/alex-feel/claude-code-toolbox/main/scripts/linux/setup-environment.sh)"Each command performs the same steps, in order:
- Installs
uv(always installed; required for PEP 723 hooks bundled with the environment). - Downloads
docker-compose.postgresql.ollama.ymlto~/.mcp/. - Runs
docker compose -f ~/.mcp/docker-compose.postgresql.ollama.yml up -d. This starts:mcp-context-server(HTTP transport on port8000)postgres(with the pgvector extension for semantic search)ollama(stockollama/ollama:latestimage; pullsqwen3-embedding:0.6bandqwen3:0.6bon first run)
- Configures Claude Code to connect to the server via HTTP at
http://localhost:8000/mcp. - Installs the bundled context-server skills, hooks, and rules into
~/.claude/.
CLAUDE_CODE_TOOLBOX_SKIP_INSTALL=1 tells the bootstrap to skip Claude Code itself and its IDE extensions if you already have them installed -- uv and the environment configuration are still applied.
First-run note. Ollama pulls roughly 1.2 GB of model data (qwen3-embedding:0.6b + qwen3:0.6b) on the first start. Allow 2-5 minutes before the server is ready to serve embedding-backed tools. To follow progress:
docker compose -f ~/.mcp/docker-compose.postgresql.ollama.yml logs -f ollamaTo verify the server responds:
curl http://localhost:8000/healthThis variant uses Ollama for embeddings and OpenAI for summary generation. The embedding model (qwen3-embedding:0.6b) runs locally via Ollama, while summaries are generated by OpenAI (gpt-5.4-nano), producing higher-quality context summaries at the cost of an API key requirement.
- An OpenAI API key (see How to Get an OpenAI API Key below)
The Docker Compose stack reads the OpenAI API key from a .env file in the ~/.mcp/ directory. Create this file before running the setup command.
Windows PowerShell:
New-Item -ItemType Directory -Force -Path "$HOME\.mcp" | Out-Null
Set-Content -Path "$HOME\.mcp\.env" -Value "OPENAI_API_KEY=sk-your-key-here"macOS / Linux:
mkdir -p ~/.mcp && echo 'OPENAI_API_KEY=sk-your-key-here' > ~/.mcp/.envReplace sk-your-key-here with your actual OpenAI API key.
powershell -NoProfile -NoExit -ExecutionPolicy Bypass -Command "`$env:CLAUDE_CODE_TOOLBOX_ENV_CONFIG='https://raw.githubusercontent.com/GetActionSpace/mcp-context-server/refs/heads/main/agents/claude-code/environment-docker-ollama-openai.yaml'; `$env:CLAUDE_CODE_TOOLBOX_SKIP_INSTALL='1'; iex (irm 'https://raw.githubusercontent.com/alex-feel/claude-code-toolbox/main/scripts/windows/setup-environment.ps1')"CLAUDE_CODE_TOOLBOX_ENV_CONFIG='https://raw.githubusercontent.com/GetActionSpace/mcp-context-server/refs/heads/main/agents/claude-code/environment-docker-ollama-openai.yaml' \
CLAUDE_CODE_TOOLBOX_SKIP_INSTALL=1 \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/alex-feel/claude-code-toolbox/main/scripts/macos/setup-environment.sh)"CLAUDE_CODE_TOOLBOX_ENV_CONFIG='https://raw.githubusercontent.com/GetActionSpace/mcp-context-server/refs/heads/main/agents/claude-code/environment-docker-ollama-openai.yaml' \
CLAUDE_CODE_TOOLBOX_SKIP_INSTALL=1 \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/alex-feel/claude-code-toolbox/main/scripts/linux/setup-environment.sh)"The setup performs the same steps as the default variant (see One-Command Setup above), with these differences:
- Downloads
docker-compose.postgresql.ollama-openai.ymlto~/.mcp/(instead of the default Ollama-only compose file). - Uses the
latest-ollama-openaiDocker image, which includes the OpenAI Python SDK for summary generation. - Ollama pulls only the embedding model (
qwen3-embedding:0.6b, ~0.6 GB). The summary model is not downloaded because summaries are generated by the OpenAI API. - Reads
OPENAI_API_KEYfrom~/.mcp/.envand passes it to the container for summary generation.
First-run note. Ollama pulls roughly 0.6 GB of model data (qwen3-embedding:0.6b) on the first start. Allow 1-3 minutes before the server is ready. To follow progress:
docker compose -f ~/.mcp/docker-compose.postgresql.ollama-openai.yml logs -f ollamaTo verify the server responds:
curl http://localhost:8000/health| Feature | Default (Ollama) | Ollama + OpenAI |
|---|---|---|
| Embedding provider | Ollama (qwen3-embedding:0.6b) |
Ollama (qwen3-embedding:0.6b) |
| Summary provider | Ollama (qwen3:0.6b) |
OpenAI (gpt-5.4-nano) |
| Ollama models pulled | 2 (~1.2 GB) | 1 (~0.6 GB) |
| First-run time | 2-5 minutes | 1-3 minutes |
| OpenAI API key | Not required | Required |
.env file |
Optional | Required (~/.mcp/.env) |
| Docker image tag | latest |
latest-ollama-openai |
| Compose file | docker-compose.postgresql.ollama.yml |
docker-compose.postgresql.ollama-openai.yml |
The docker-compose.postgresql.ollama-openai.yml file loads OPENAI_API_KEY from a .env file via the env_file directive -- it does not use ${OPENAI_API_KEY} interpolation in the environment: section. Because env_file reads exclusively from a file on disk, setting export OPENAI_API_KEY=sk-... in the shell before running docker compose up has no effect on the container environment. The .env file is the only supported mechanism.
- Go to platform.openai.com and sign up (or sign in with an existing account). You can register with an email address or use a Google, Microsoft, or Apple account.
- Navigate to Settings > Billing (platform.openai.com/account/billing/overview) and add a payment method. OpenAI uses a prepaid credit system -- you add funds and API calls deduct from that balance. The minimum top-up is $5.
- Go to API Keys (platform.openai.com/api-keys) and click Create new secret key. Give the key a descriptive name (e.g., "MCP Context Server") and copy it immediately -- OpenAI displays the key only once.
Use the copied key in the .env file in Step 1 above.
For full details, see the OpenAI Developer Quickstart.
At current OpenAI API pricing, gpt-5.4-nano costs $0.20 per 1 million input tokens and $1.25 per 1 million output tokens. In practice, generating 1,000 summaries costs approximately $1 USD depending on the average length of stored context entries.
| Symptom | Cause | Fix |
|---|---|---|
docker: command not found (Windows) or Docker Desktop is not running |
Docker Desktop is not installed or not started | Install Docker Desktop and make sure it is running before re-running the bootstrap |
Error response from daemon: ... bind for 0.0.0.0:8000 failed: port is already allocated |
Another process is using port 8000 on the host |
Stop the conflicting process, OR edit ~/.mcp/docker-compose.postgresql.ollama.yml and remap the host port (e.g., "8001:8000"), then update your client URL to http://localhost:8001/mcp |
Bootstrap reports "Ollama not healthy yet" / /health returns connection refused |
First-run model download still in progress | Watch progress with docker compose -f ~/.mcp/docker-compose.postgresql.ollama.yml logs -f ollama. Wait until both qwen3-embedding:0.6b and qwen3:0.6b are pulled |
| GPU acceleration is not used | Docker Compose file's GPU section is commented out by default | See the GPU Acceleration Guide for vendor-specific instructions (NVIDIA / AMD ROCm / Intel Vulkan) |
Two compose variants conflict over the ollama-models volume |
The ollama-models named volume is shared by all Ollama compose variants |
Only one Ollama compose variant can run at a time. Stop the other variant before starting a new one: docker compose -f <other-file> down |
validating .../docker-compose.postgresql.ollama-openai.yml: ... .env: not found |
The .env file is missing from ~/.mcp/ |
Create the file before starting the stack -- see Step 1: Create the .env File above |
openai.AuthenticationError: Incorrect API key provided or summaries are empty |
The OpenAI API key in ~/.mcp/.env is invalid or expired |
Open ~/.mcp/.env, verify the key starts with sk-, and confirm it is active at platform.openai.com/api-keys. Replace the key and restart the stack |
Update -- exit Claude Code and re-run the one-command bootstrap for your OS (see One-Command Setup above). This re-downloads the Compose file and restarts the stack with the latest images.
Stop the stack (preserve data):
docker compose -f ~/.mcp/docker-compose.postgresql.ollama.yml downRemove the stack and all data (Docker volumes):
docker compose -f ~/.mcp/docker-compose.postgresql.ollama.yml down -vThis deletes the PostgreSQL data, the SQLite/Postgres backend volume, and the ollama-models volume (forcing re-download of models on the next start).
For the Ollama + OpenAI variant, substitute the compose file name in the commands above:
# Stop (preserve data)
docker compose -f ~/.mcp/docker-compose.postgresql.ollama-openai.yml down
# Remove stack and all data
docker compose -f ~/.mcp/docker-compose.postgresql.ollama-openai.yml down -vRemove the downloaded Compose file:
# Windows PowerShell
Remove-Item -Recurse -Force "$env:USERPROFILE\.mcp"# macOS / Linux
rm -rf ~/.mcpUnregister the server from Claude Code:
claude mcp remove context-server- Docker Deployment Guide -- full reference for all 15 Docker Compose configurations, environment variables, advanced configuration, and PostgreSQL backend error scenarios.
- GPU Acceleration Guide -- NVIDIA, AMD ROCm, and Intel/Vulkan GPU configuration.
- Database Backends Guide -- choosing between SQLite and PostgreSQL.
- Authentication Guide -- bearer-token authentication for HTTP transport.
- Environment Variables Reference -- full reference for every environment variable the server understands.
- README -- feature overview and entry point.