claude-os/deployment/mcp-only/docker-compose.yml
Claude 0e5687b0f1
Add MCP-only deployment package for standalone knowledge base server
This commit adds a complete deployment solution for running Claude OS's
MCP (Model Context Protocol) server as a standalone service, separate
from the full coding environment. This allows other applications to
access the knowledge bases without requiring the CLI or coding tools.

Features:
- Docker-based deployment with Ollama integration
- Automated setup script with model pulling
- Read-only database mounting by default
- CORS and authentication configuration
- Complete API documentation and examples
- Python and JavaScript client examples

Also includes alternative Cloudflare Workers implementation:
- TypeScript starter template
- D1 and Vectorize integration examples
- Migration scripts and documentation
- Deployment comparison guide

Files added:
- deployment/mcp-only/Dockerfile
- deployment/mcp-only/docker-compose.yml
- deployment/mcp-only/requirements.txt
- deployment/mcp-only/setup.sh
- deployment/mcp-only/.env.example
- deployment/mcp-only/.dockerignore
- deployment/mcp-only/README.md
- deployment/mcp-only/DEPLOYMENT_COMPARISON.md
- deployment/mcp-only/examples/chat-integration.py
- deployment/mcp-only/examples/chat-integration.js
- deployment/mcp-only/cloudflare-workers/*

This addresses the need to expose MCP data to other applications
(knowledge base access, live chat) without deploying the full
Claude OS environment to production servers.
2025-11-05 17:46:00 +00:00

69 lines
1.7 KiB
YAML

version: '3.8'
services:
# Ollama service (required for embeddings & LLM)
ollama:
image: ollama/ollama:latest
container_name: claude-os-ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
# MCP Server (knowledge base access only)
mcp-server:
build:
context: ../.. # Build from root of claude-os
dockerfile: deployment/mcp-only/Dockerfile
container_name: claude-os-mcp
ports:
- "8051:8051"
volumes:
# Mount your existing database from local machine
- ../../data:/app/data:ro # Read-only: your populated DB
# Or use a volume if you want to persist changes
# - mcp_data:/app/data
environment:
# Database
SQLITE_DB_PATH: /app/data/claude-os.db
# MCP Server
MCP_SERVER_HOST: 0.0.0.0
MCP_SERVER_PORT: 8051
# Ollama connection
OLLAMA_HOST: http://ollama:11434
OLLAMA_EMBED_MODEL: nomic-embed-text
OLLAMA_MODEL: llama3.1:latest
# Optional: Authentication
# JWT_SECRET_KEY: your-secret-key-here
# JWT_ALGORITHM: HS256
# API_USERNAME: admin
# API_PASSWORD: changeme
# Optional: CORS (adjust for your other apps)
CORS_ORIGINS: "*"
depends_on:
ollama:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8051/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
ollama_data:
driver: local
# Uncomment if you want persistent MCP data in Docker
# mcp_data:
# driver: local