Skip to main content
Glama

MCP SSE Server Python

by nguyenxtan
Dockerfile1.42 kB
# Multi-stage Dockerfile for MCP SSE Server # Stage 1: Base image with dependencies FROM python:3.11-slim as base # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Stage 2: Production image FROM python:3.11-slim # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 # Create non-root user RUN useradd -m -u 1000 mcpuser && \ mkdir -p /app && \ chown -R mcpuser:mcpuser /app WORKDIR /app # Copy Python packages from base stage COPY --from=base /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages COPY --from=base /usr/local/bin /usr/local/bin # Copy application code COPY --chown=mcpuser:mcpuser src/ ./src/ COPY --chown=mcpuser:mcpuser .env.example .env # Switch to non-root user USER mcpuser # Expose port EXPOSE 3001 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:3001/health || exit 1 # Run the application CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "3001", "--workers", "4"]

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/nguyenxtan/mcpwn8n'

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