Deployment
Deploying MCP Servers
Learn how to deploy MCP servers for production use — locally via npm, or remotely via Docker and cloud platforms.
typescript
// Option 1: Publish to npm
// Users install with: npx your-mcp-server
// package.json: { "bin": { "your-server": "./dist/index.js" } }
// Option 2: Docker
// FROM node:20-slim
// WORKDIR /app
// COPY package*.json ./
// RUN npm ci --production
// COPY dist/ ./dist/
// CMD ["node", "dist/index.js"]
// Option 3: Claude Desktop config for local development
// { "command": "npx", "args": ["tsx", "src/index.ts"] }Tip:Publishing to npm is the easiest way to distribute your MCP server. Users just add it to their Claude config with npx.
PreviewTypeScriptRead Only
Copy this code and run it locally with
npx tsx server.ts