Skip to main content
Glama

example-mcp-server-stdio

by yigitkonur
Dockerfileโ€ข1.58 kB
# ================================================================= # Stage 1: The Builder # This stage installs all dependencies and compiles the TypeScript # ================================================================= FROM node:20-slim AS builder # Set the working directory inside the container WORKDIR /app # Copy package.json and package-lock.json first to leverage Docker's layer caching. # This step will only be re-run if these files change. COPY package*.json ./ # Install all dependencies, including devDependencies needed for building RUN npm ci # Copy the rest of the application source code COPY . . # Compile TypeScript to JavaScript RUN npm run build # ================================================================= # Stage 2: The Runner (Final Image) # This stage creates the final, lean, and secure production image # ================================================================= FROM node:20-slim AS runner WORKDIR /app # Copy package files again COPY package*.json ./ # Install *only* production dependencies. This makes the image smaller. RUN npm ci --only=production # Copy the compiled JavaScript from the 'builder' stage. # We are NOT copying the source TypeScript files or devDependencies. COPY --from=builder /app/dist ./dist # Create and switch to a non-root user for security. # Running containers as root is a major security risk. USER node # Define the command to run the application when the container starts. # Smithery will handle the transport protocol (STDIO) as defined in smithery.yaml CMD ["node", "dist/server.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/yigitkonur/example-mcp-server-stdio'

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