We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/poguuniverse/42crunch-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# Docker Deployment Guide
This guide explains how to deploy the 42crunch MCP Server in Docker for remote access.
## Prerequisites
- Docker and Docker Compose installed
- Valid `42C_TOKEN` environment variable or `.env` file
## Quick Start
### 1. Build and Run with Docker Compose
```bash
# Set your token
export 42C_TOKEN=your_token_here
# Or create .env file
echo "42C_TOKEN=your_token_here" > .env
# Build and start
docker-compose up -d
# Check logs
docker-compose logs -f
# Check health
curl http://localhost:8000/health
```
### 2. Build and Run with Docker
```bash
# Build image
docker build -t 42crunch-mcp:latest .
# Run container
docker run -d \
--name 42crunch-mcp-server \
-p 8000:8000 \
-e 42C_TOKEN=your_token_here \
--restart unless-stopped \
42crunch-mcp:latest
# Check logs
docker logs -f 42crunch-mcp-server
# Check health
curl http://localhost:8000/health
```
## Production Deployment
### Using Production Compose File
```bash
# Use production configuration
docker-compose -f docker-compose.prod.yml up -d
# View logs
docker-compose -f docker-compose.prod.yml logs -f
```
### Environment Variables
The server requires the `42C_TOKEN` environment variable. You can set it:
1. **Via environment variable:**
```bash
export 42C_TOKEN=your_token_here
docker-compose up -d
```
2. **Via .env file:**
```bash
echo "42C_TOKEN=your_token_here" > .env
docker-compose up -d
```
3. **Via docker run:**
```bash
docker run -d -p 8000:8000 -e 42C_TOKEN=your_token_here 42crunch-mcp:latest
```
## Remote Access
Once deployed, the server is accessible at:
- **HTTP Server:** `http://localhost:8000` (or your server IP)
- **Health Check:** `http://localhost:8000/health`
- **JSON-RPC:** `http://localhost:8000/jsonrpc`
- **API Docs:** `http://localhost:8000/docs`
### Example Remote Client
```python
import requests
# Remote server URL
SERVER_URL = "http://your-server-ip:8000"
# Health check
response = requests.get(f"{SERVER_URL}/health")
print(response.json())
# Call MCP tool
response = requests.post(
f"{SERVER_URL}/jsonrpc",
json={
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_collections",
"arguments": {"per_page": 10}
}
}
)
print(response.json())
```
## Docker Commands
### Build
```bash
docker build -t 42crunch-mcp:latest .
```
### Run
```bash
docker run -d -p 8000:8000 -e 42C_TOKEN=your_token 42crunch-mcp:latest
```
### Stop
```bash
docker stop 42crunch-mcp-server
# or
docker-compose down
```
### Restart
```bash
docker restart 42crunch-mcp-server
# or
docker-compose restart
```
### View Logs
```bash
docker logs -f 42crunch-mcp-server
# or
docker-compose logs -f
```
### Remove
```bash
docker rm -f 42crunch-mcp-server
# or
docker-compose down
```
## Security Considerations
1. **Token Security:**
- Never commit `.env` files to git
- Use Docker secrets or environment variables in production
- Rotate tokens regularly
2. **Network Security:**
- Use reverse proxy (nginx/traefik) with SSL/TLS
- Restrict port access with firewall
- Use Docker networks for isolation
3. **Container Security:**
- Runs as non-root user
- Minimal base image (slim)
- No unnecessary packages
## Reverse Proxy Setup (Nginx)
Example nginx configuration:
```nginx
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
## Troubleshooting
### Container won't start
```bash
# Check logs
docker logs 42crunch-mcp-server
# Common issues:
# - Missing 42C_TOKEN
# - Port already in use
# - Permission issues
```
### Health check failing
```bash
# Check if server is responding
curl http://localhost:8000/health
# Check container status
docker ps -a
# Check logs
docker logs 42crunch-mcp-server
```
### Token not working
```bash
# Verify token is set
docker exec 42crunch-mcp-server env | grep 42C_TOKEN
# Restart with new token
docker stop 42crunch-mcp-server
docker rm 42crunch-mcp-server
docker run -d -p 8000:8000 -e 42C_TOKEN=new_token 42crunch-mcp:latest
```
## Multi-Architecture Build
For ARM64 (Apple Silicon, Raspberry Pi):
```bash
docker buildx build --platform linux/amd64,linux/arm64 -t 42crunch-mcp:latest .
```
## CI/CD Integration
Example GitHub Actions:
```yaml
- name: Build and push Docker image
run: |
docker build -t 42crunch-mcp:${{ github.sha }} .
docker tag 42crunch-mcp:${{ github.sha }} 42crunch-mcp:latest
```