Skip to main content
Glama

MCP Template

Dockerfile1.3 kB
# Multi-stage build for production-ready MCP server # Build stage FROM python:3.11-slim as builder WORKDIR /build # Install build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ && rm -rf /var/lib/apt/lists/* # Copy dependency files COPY requirements.txt . COPY pyproject.toml . COPY README.md . # Install Python dependencies RUN pip install --no-cache-dir --user -r requirements.txt # Copy source code COPY src/ src/ # Install the package RUN pip install --no-cache-dir --user . # Production stage FROM python:3.11-slim # Create non-root user RUN useradd --create-home --shell /bin/bash mcpuser WORKDIR /app # Copy Python dependencies from builder COPY --from=builder /root/.local /home/mcpuser/.local # Copy application files COPY --chown=mcpuser:mcpuser config/ config/ COPY --chown=mcpuser:mcpuser src/ src/ # Install the package RUN pip install --no-cache-dir -e . # Switch to non-root user USER mcpuser # Add .local/bin to PATH ENV PATH=/home/mcpuser/.local/bin:$PATH # Set environment variables ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD python -c "import sys; sys.exit(0)" # Default command CMD ["mcp-template", "run"]

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/riteshsonawala/mcp-template'

If you have feedback or need assistance with the MCP directory API, please join our Discord server