# Multi-stage build for MCP Weather Server
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install all dependencies (including dev dependencies for TypeScript)
RUN npm ci
# Copy source code
COPY src/ ./src/
# Build the application
RUN npm run build
# Production stage
FROM node:20-alpine AS production
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install only production dependencies
RUN npm ci --only=production && npm cache clean --force
# Copy built application from builder stage
COPY --from=builder /app/build ./build
# Create non-root user for security
RUN addgroup -g 1001 -S mcpuser && \
adduser -S mcpuser -u 1001 && \
chown -R mcpuser:mcpuser /app
# Switch to non-root user
USER mcpuser
# Expose port if needed (MCP typically uses stdio, but keeping for flexibility)
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "console.log('MCP Weather Server is healthy')" || exit 1
# Default command to run the MCP server
CMD ["node", "build/index.js"]
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/broerjuang/mcp-weather'
If you have feedback or need assistance with the MCP directory API, please join our Discord server