# π³ MCP Dockerized
**Containerized Model Context Protocol (MCP) server with extensible tools and secure API key authentication.**
[](https://hub.docker.com/r/antpavlenkohmcorp/mcp-dockerized)
[](https://hub.docker.com/r/antpavlenkohmcorp/mcp-dockerized)
[](https://github.com/antpavlenko/mcp_dockerized/blob/main/LICENSE)
## π Quick Start
### Basic Usage
```bash
# Run with default settings
docker run -d -p 8000:8000 antpavlenkohmcorp/mcp-dockerized:latest
# Check health
curl http://localhost:8000/health
```
### Production Setup
```bash
# Run with persistent data and custom config
docker run -d \
--name mcp-server \
-p 8000:8000 \
-e MCPD_LOG_LEVEL=INFO \
-e MCPD_API_KEY_LENGTH=32 \
-v mcp_data:/app/data \
--restart unless-stopped \
antpavlenkohmcorp/mcp-dockerized:latest
```
### Docker Compose
```yaml
version: '3.8'
services:
mcp-server:
image: antpavlenkohmcorp/mcp-dockerized:latest
ports:
- "8000:8000"
environment:
- MCPD_PORT=8000
- MCPD_LOG_LEVEL=INFO
volumes:
- ./data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
```
## π Getting Your API Key
After starting the container, get your API key from the logs:
```bash
docker logs <container-name> | grep "First API key"
```
## π οΈ Features
- β
**Multi-Platform Support**: AMD64, ARM64, ARM v7
- β
**API Key Authentication**: Secure access control
- β
**Health Monitoring**: Built-in health check endpoint
- β
**Extensible Tools**: Easy to add custom MCP tools
- β
**Console Tool**: Execute host machine commands
- β
**Configurable Logging**: Timestamped logs with levels
- β
**Non-Root User**: Runs securely as non-privileged user
- β
**Production Ready**: Health checks and restart policies
## π Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `MCPD_PORT` | `8000` | Port for the MCP server |
| `MCPD_LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR) |
| `MCPD_API_KEY_LENGTH` | `32` | Length of generated API keys |
## π API Endpoints
- `GET /health` - Health check
- `GET /api/tools` - List available tools
- `POST /api/tools/{tool_name}` - Execute tool
- `POST /api/generate-key` - Generate new API key
- `GET /api/mcp/initialize` - Initialize MCP connection
- `POST /api/mcp/tools/call` - Call MCP tool
## π Security
- Non-root container execution
- API key authentication required
- Configurable key lengths
- Health check monitoring
- Minimal attack surface
## π Documentation
**Full documentation**: [GitHub Repository](https://github.com/antpavlenko/mcp_dockerized)
**Issues & Support**: [GitHub Issues](https://github.com/antpavlenko/mcp_dockerized/issues)
**Maintainer**: Anton Pavlenko <apavlenko@hmcorp.fund>
## π License
MIT License - see [LICENSE](https://github.com/antpavlenko/mcp_dockerized/blob/main/LICENSE) for details.