This directory contains Docker configuration files and utilities for running MCP Bridge Server in containerized environments.
Production deployment:
# Build and start the service
npm run docker:run
# Or using docker-compose directly
docker-compose up -d
Development environment:
# Build and start development environment with live reload
npm run docker:run:dev
# Or using docker-compose directly
docker-compose -f docker-compose.dev.yml up -d
Stop the service:
npm run docker:stop
Build the image:
docker build -t mcp-bridge-server .
Run the container:
docker run -d \
--name mcp-bridge \
-p 3000:3000 \
-v $(pwd)/mcp-config.json:/app/mcp-config.json:ro \
-v $(pwd)/logs:/app/logs \
mcp-bridge-server
NODE_ENV: Environment mode (production, development)LOG_LEVEL: Logging level (error, warn, info, debug)CONFIG_PATH: Path to MCP configuration file (default: /app/mcp-config.json)PORT: Server port (default: 3000)mcp-config.json to /app/mcp-config.json/app/logs for persistence/app/mcp-serversUse the provided docker/mcp-config.docker.json as a starting point:
cp docker/mcp-config.docker.json mcp-config.json
# Edit mcp-config.json with your MCP server configurations
Dockerfile: Multi-stage production Docker imagedocker-compose.yml: Production Docker Compose configurationdocker-compose.dev.yml: Development Docker Compose configuration.dockerignore: Files excluded from Docker contextdocker/build.sh: Advanced build and deployment scriptdocker/mcp-config.docker.json: Docker-optimized configuration exampleThe docker/build.sh script provides advanced Docker operations:
# Build production image
./docker/build.sh --action build --env production --tag v1.0.0
# Build and push to registry
./docker/build.sh --action build --tag v1.0.0 --push
# Run development environment
./docker/build.sh --action run --env development
# Clean up all Docker resources
./docker/build.sh --action clean
# View help
./docker/build.sh --help
The container includes built-in health checks:
http://localhost:3000/healthCheck health status:
docker ps # Shows health status
curl http://localhost:3000/health
To run multiple MCP servers as separate containers:
Create a custom docker-compose.yml:
version: '3.8'
services:
mcp-bridge:
# ... (main service configuration)
mcp-filesystem:
image: your-filesystem-mcp-server:latest
networks:
- mcp-network
mcp-search:
image: your-search-mcp-server:latest
networks:
- mcp-network
environment:
- API_KEY=${SEARCH_API_KEY}
Update MCP configuration to use container hostnames:
{
"servers": [
{
"id": "filesystem",
"transport": "http",
"url": "http://mcp-filesystem:3001/mcp"
},
{
"id": "search",
"transport": "sse",
"url": "http://mcp-search:3002/sse"
}
]
}
mcpbridge (UID 1001)services:
mcp-bridge:
# ... other configuration
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
Permission denied errors:
# Ensure correct ownership of mounted volumes
sudo chown -R 1001:1001 logs/
Configuration not found:
# Verify mount path
docker exec mcp-bridge ls -la /app/mcp-config.json
Port already in use:
# Change port mapping
docker-compose down
# Edit docker-compose.yml to use different port
docker-compose up -d
# View container logs
docker-compose logs -f mcp-bridge
# Access container shell
docker exec -it mcp-bridge sh
# Check health status
docker inspect mcp-bridge | grep -A 10 Health
- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Deploy to production
run: |
docker-compose -f docker-compose.prod.yml up -d
Create different compose files for each environment:
docker-compose.yml (production)docker-compose.dev.yml (development)docker-compose.test.yml (testing)docker-compose.prod.yml (production with additional services)Content type
Image
Digest
sha256:d4665c42c…
Size
47.7 MB
Last updated
over 1 year ago
docker pull mako10k/mcp-bridge