con un clic
mcp-deployment
Plan and execute MCP server deployment to production environments
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Plan and execute MCP server deployment to production environments
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Perform comprehensive code review of MCP tools focusing on security, reliability, and best practices
Generate professional documentation for MCP tools including docstrings, examples, and API reference
Generate and manage comprehensive test suites for MCP tools with coverage reporting
| name | mcp-deployment |
| description | Plan and execute MCP server deployment to production environments |
The MCP Deployment Skill manages the complete deployment lifecycle for Model Context Protocol servers. It handles pre-deployment validation, deployment execution, health verification, and post-deployment monitoring.
Request: "Deploy weather MCP server to production"
[Provide server code and configuration]
Skill: Validates, packages, deploys, and verifies
Output: Deployment complete with monitoring active
Request: "Deploy with blue-green strategy, capture baseline metrics"
[Provide server, config, performance targets]
Skill: Executes phased deployment with validation
Output: Deployment with A/B comparison metrics
✓ All tests passing (pytest --cov, 80%+ coverage)
✓ No linting errors (pylint, black)
✓ Type checking passes (mypy)
✓ Code reviewed and approved
✓ All tools quality score 8+/10
✓ No hardcoded secrets
✓ Environment variables configured
✓ API keys rotated (if needed)
✓ .env file not in git
✓ Permissions properly scoped
✓ Dependencies listed in requirements.txt
✓ Configuration externalized (not hardcoded)
✓ Health check endpoint ready
✓ Logging configured
✓ Monitoring setup planned
✓ Deployment runbook written
✓ Troubleshooting guide prepared
✓ Rollback procedure documented
✓ Alert escalation paths defined
✓ API documentation current
When: Before first production deployment Process:
pip install -r requirements.txtpython src/server/index.pyVerification:
# Check server running
ps aux | grep "python src/server"
# Test tool discovery
mcp-cli list-tools
# Test invocation
mcp-cli invoke weather get_current_weather --lat 51.5 --lon -0.1
When: Consistent environments, cloud deployment Process:
docker build -t mcp-weather:1.0.0 .docker run -e OPENWEATHERMAP_API_KEY=key mcp-weather:1.0.0docker push myregistry.azurecr.io/mcp-weather:1.0.0Dockerfile Example:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY src/ ./src/
ENV PYTHONUNBUFFERED=1
CMD ["python", "src/server/index.py"]
Verification:
docker run --name mcp-test myregistry/mcp-weather:1.0.0
# Wait 5 seconds
docker logs mcp-test
docker stop mcp-test
When: Minimal DevOps effort, managed scaling Process:
Benefits:
When: Low traffic, cost-sensitive Process: Adapt server for function runtime (different I/O model)
# Verify code and configuration
pytest tests/ --cov=src --cov-report=term-missing
mypy src/
# Build artifact
docker build -t mcp-weather:1.0.0 .
docker run --rm mcp-weather:1.0.0 # Quick validation
# Prepare environment
source .env.production
# Verify all required env vars set
# Tag image for production
docker tag mcp-weather:1.0.0 myregistry/mcp-weather:1.0.0
# Push to registry
docker push myregistry/mcp-weather:1.0.0
# Deploy to target environment
# (Cloud-specific commands vary)
# Wait for server to start
sleep 10
# Test connectivity
curl http://localhost:8000/health
# Test tool discovery
mcp-cli list-tools
# Test sample invocation
mcp-cli invoke weather get_current_weather --lat 51.5 --lon -0.1
# Monitor logs for errors
docker logs mcp-weather | head -20
# Measure response times
time mcp-cli invoke weather get_current_weather --lat 51.5 --lon -0.1
# Check error rates (from monitoring)
# Target: <0.1% error rate in first hour
# Verify memory/CPU usage
docker stats mcp-weather
# Verify server responds to requests
response = client.get("http://localhost:8000/health")
assert response.status_code == 200
# Verify all tools are discoverable
tools = mcp_client.list_tools()
assert len(tools) == 5 # Expect 5 tools
assert any(t.name == "get_current_weather" for t in tools)
# Test actual tool invocation
result = await mcp_client.invoke(
"get_current_weather",
{"lat": 51.5, "lon": -0.1}
)
assert "error" not in result
assert result["temperature"] is not None
# Verify error handling works
result = await mcp_client.invoke(
"get_current_weather",
{"lat": 95, "lon": -0.1} # Invalid latitude
)
assert "error" in result
assert "latitude" in result["error"].lower()
- Request count (tools invocations per minute)
- Error rate (% of failed invocations)
- Response time (p50, p95, p99 percentiles)
- Success rate (% of successful tools)
- Memory usage (MB)
- CPU usage (%)
Alert if:
- Error rate > 5% (something is wrong)
- Response time p95 > 10 seconds (performance degradation)
- Memory > 500MB (resource leak)
- Server restarts unexpectedly
Log levels:
- ERROR: Tool invocation failures
- WARN: Slow responses (>5s)
- INFO: Tool invocation counts, deployment events
- DEBUG: Parameter details, response samples
# Immediately roll back
docker stop mcp-weather
docker run -d --name mcp-weather myregistry/mcp-weather:PREVIOUS_VERSION
# Verify previous version working
curl http://localhost:8000/health
# Investigate failure
docker logs mcp-weather-failed > /tmp/deployment.log
# Fix issue
# Commit fix, redeploy
Document baseline metrics:
- Response time: 2.3s p95
- Error rate: 0.02%
- Memory: 128MB
- CPU: 15% average
| Issue | Cause | Fix |
|---|---|---|
| Tools not discoverable | Deployment incomplete | Restart server, check logs |
| Timeouts on invocation | Slow API responses | Check external API status |
| High memory usage | Resource leak | Restart server, add gc.collect() |
| API key not working | Env var not set | Verify .env configuration |
| Connection refused | Server not running | Check if process crashed |
# MCP Weather Server Deployment Runbook
## Pre-Deployment (15 min)
1. Code review complete and approved
2. All tests passing (pytest)
3. Security scan passed
4. Rollback plan reviewed
## Deployment (10 min)
1. Build Docker image
2. Push to registry
3. Deploy to production
4. Verify connectivity
## Validation (10 min)
1. Health check passes
2. Tools discovered
3. Sample invocations work
4. No errors in logs
## Monitoring (Ongoing)
1. Alert for error rate >5%
2. Alert for response time >10s
3. Daily metrics review
4. Weekly performance review
## Rollback (If needed)
1. Stop current server
2. Revert to previous version
3. Verify working
4. Investigate and fix
## Estimated Deployment Time: 35-45 minutes
prompts/deploy-mcp-server.prompt.md - Deployment planning templateREADME.md - Project setup and configuration.github/copilot/tech-stack.md - Technology details