This document provides step-by-step instructions for deploying the MCP Server to various platforms.
Railway provides the easiest deployment experience for this MCP server.
- Ensure all files are committed to Git
- Push to GitHub if not already there
- Visit railway.app and sign up/login
- Click "New Project"
- Select "Deploy from GitHub repo"
- Choose this repository
- Railway will automatically:
- Detect it's a Node.js project
- Install dependencies with
npm install - Build the project with
npm run build - Start the server with
npm start
Railway automatically provides:
PORTenvironment variable- Domain/URL for your deployment
No additional configuration needed!
After deployment, you'll get a URL like:
Your MCP endpoint will be:
https://your-url.railway.app/mcp
- Heroku CLI installed
- Heroku account
- Create a Heroku app:
heroku create your-app-name- Set buildpack (optional, auto-detected):
heroku buildpacks:set heroku/nodejs- Deploy:
git push heroku main- The app will be available at:
https://your-app-name.herokuapp.com/mcp
- Vercel CLI or GitHub integration
- Install Vercel CLI:
npm i -g vercel- Deploy:
vercel- Visit vercel.com
- Import your GitHub repository
- Vercel will auto-deploy
Note: Vercel works best with serverless functions. This Express server works but may have cold start delays.
Create a Dockerfile:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]docker build -t starbucks-mcp .
docker run -p 3000:3000 starbucks-mcpThe server supports these environment variables:
| Variable | Description | Default |
|---|---|---|
PORT |
Port to listen on | 3000 |
NODE_ENV |
Environment mode | production |
All platforms can use the built-in health check:
GET /health
Response:
{
"status": "healthy",
"service": "starbucks-mcp-server",
"version": "1.0.0",
"timestamp": "2023-..."
}The server logs to stdout/stderr, which most platforms capture automatically.
For production deployments, consider:
- Uptime monitoring: Ping
/healthendpoint - Error tracking: Services like Sentry
- Performance monitoring: New Relic, DataDog, etc.
- Log aggregation: Logflare, Papertrail, etc.
- Automatic scaling available in pro plans
- Handles traffic spikes automatically
- Use dynos for scaling:
heroku ps:scale web=2- Most platforms offer horizontal scaling
- This server is stateless and scales well
- Port binding errors: Ensure
PORTenvironment variable is set - Build failures: Check Node.js version (requires 18+)
- Memory issues: Most platforms provide 512MB+ which is sufficient
- Check application logs
- Test
/healthendpoint - Verify MCP endpoint with curl:
curl -X GET https://your-url/mcp \
-H "Accept: text/event-stream"- Check platform-specific documentation
- Use platform support channels
- Open an issue in this repository
All production deployments should use HTTPS. Most platforms provide this automatically.
The server has CORS enabled by default for development. Consider restricting origins in production.
Consider adding rate limiting for production deployments using middleware like express-rate-limit.