Sign inSign up

tebwritescode/mcp-server

By tebwritescode

•Updated about 1 year ago

A flexible Docker container for running MCP servers

Image
0

389

tebwritescode/mcp-server repository overview

⁠MCP Server Docker Container

A flexible Docker container for running MCP servers with customizable environment variables.

⁠Docker Hub

The image is available on Docker Hub: tebwritescode/mcp-server

⁠Quick Start

# Run with default settings (mcp-server-time)
docker run -p 8000:8000 tebwritescode/mcp-server

# Run a different MCP server
docker run -p 8000:8000 -e MCP_SERVER_COMMAND="mcp-server-github" tebwritescode/mcp-server

# Run with authentication
docker run -p 8000:8000 \
  -e MCP_AUTH_METHOD="token" \
  -e MCP_AUTH_TOKEN="your-secret-token" \
  tebwritescode/mcp-server

⁠Environment Variables

VariableDefaultDescription
MCP_SERVER_COMMANDmcp-server-timeThe MCP server package to run (e.g., mcp-server-github, mcp-server-sqlite, etc.)
MCP_HOST0.0.0.0Host address to bind the server to
MCP_PORT8000Port to expose the server on
MCP_TIMEZONEAmerica/New_YorkTimezone setting (only used for mcp-server-time)
MCP_AUTH_METHODnoneAuthentication method: none, token, or basic
MCP_AUTH_TOKEN Authentication token (when using token auth)
MCP_AUTH_USERNAME Username for basic authentication
MCP_AUTH_PASSWORD Password for basic authentication
MCP_EXTRA_ARGS Additional arguments to pass to the MCP server
MCP_USE_UVXtrueWhether to use uvx to run the server command
MCP_LOG_LEVELinfoLogging level: debug, info, warning, error

⁠Examples

⁠Running Different MCP Servers
# GitHub MCP Server
docker run -p 8000:8000 \
  -e MCP_SERVER_COMMAND="mcp-server-github" \
  -e MCP_EXTRA_ARGS="--repo owner/repo" \
  tebwritescode/mcp-server

# SQLite MCP Server
docker run -p 8000:8000 \
  -e MCP_SERVER_COMMAND="mcp-server-sqlite" \
  -v /path/to/data:/data \
  -e MCP_EXTRA_ARGS="--db-path /data/database.db" \
  tebwritescode/mcp-server

# File System MCP Server
docker run -p 8000:8000 \
  -e MCP_SERVER_COMMAND="mcp-server-filesystem" \
  -v /path/to/files:/files:ro \
  -e MCP_EXTRA_ARGS="--root /files" \
  tebwritescode/mcp-server
⁠Authentication Examples
⁠Token Authentication
docker run -p 8000:8000 \
  -e MCP_AUTH_METHOD="token" \
  -e MCP_AUTH_TOKEN="my-secret-token-123" \
  tebwritescode/mcp-server
⁠Basic Authentication
docker run -p 8000:8000 \
  -e MCP_AUTH_METHOD="basic" \
  -e MCP_AUTH_USERNAME="admin" \
  -e MCP_AUTH_PASSWORD="secure-password" \
  tebwritescode/mcp-server
⁠Advanced Configuration
# Custom port, debug logging, and timezone
docker run -p 3000:3000 \
  -e MCP_PORT="3000" \
  -e MCP_LOG_LEVEL="debug" \
  -e MCP_TIMEZONE="Europe/London" \
  tebwritescode/mcp-server

# Using without uvx (if server is pre-installed)
docker run -p 8000:8000 \
  -e MCP_USE_UVX="false" \
  -e MCP_SERVER_COMMAND="/usr/local/bin/custom-mcp-server" \
  tebwritescode/mcp-server

⁠Docker Compose Example

version: '3.8'

services:
  mcp-server:
    image: tebwritescode/mcp-server
    ports:
      - "8000:8000"
    environment:
      - MCP_SERVER_COMMAND=mcp-server-time
      - MCP_AUTH_METHOD=token
      - MCP_AUTH_TOKEN=${MCP_TOKEN}
      - MCP_LOG_LEVEL=info
      - MCP_TIMEZONE=UTC
    restart: unless-stopped

⁠Supported Architectures

The image supports multiple architectures:

  • linux/amd64 (x86_64)
  • linux/arm64 (ARM 64-bit)
  • linux/arm/v7 (ARM 32-bit)

Docker will automatically pull the correct architecture for your platform.

⁠Security Notes

  • Authentication credentials should be provided via environment variables or Docker secrets
  • Use Docker secrets or environment files (.env) for sensitive information in production
  • The container runs with minimal privileges by default
  • Consider using read-only volume mounts when appropriate

⁠Building from Source

If you want to build the image yourself:

# Clone or create the Dockerfile
# Build for current architecture
docker build -t my-mcp-server .

# Build for multiple architectures
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t my-mcp-server .

⁠Troubleshooting

⁠Container fails to start
  • Check logs: docker logs <container-id>
  • Verify the MCP_SERVER_COMMAND is a valid MCP server package
  • Ensure authentication credentials are properly set if using auth
⁠Authentication not working
  • Verify MCP_AUTH_METHOD is set to either "token" or "basic"
  • Ensure corresponding credentials (token or username/password) are provided
  • Check that credentials don't contain special characters that need escaping
⁠Server not accessible
  • Verify port mapping with docker ps
  • Check firewall rules on the host
  • Ensure MCP_HOST is set to "0.0.0.0" for external access

⁠License

This Docker image is provided as-is for running MCP servers. The individual MCP servers have their own licenses.

⁠Support

Issues? Questions? Praise-singing?
File an issue on GitHub or yell at teb⁠.


šŸ‘‘ Created by: tebbydog0605⁠
šŸ‹ Docker Hub: tebwritescode⁠
šŸ’» Website: teb.codes⁠

Tag summary

Content type

Image

Digest

sha256:bc6f690e1…

Size

85.8 MB

Last updated

about 1 year ago

docker pull tebwritescode/mcp-server