POST
/
v1
/
deploy
curl -X POST https://api.leanmcp.com/v1/deploy \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mcp_id": "mcp_abc123def456",
    "environment": "production",
    "config": {
      "domain": "my-mcp.example.com",
      "scaling": {
        "min_instances": 2,
        "max_instances": 20
      },
      "env_vars": {
        "API_KEY": "your-api-key",
        "DEBUG": "false"
      }
    }
  }'
{
  "success": true,
  "data": {
    "deployment_id": "deploy_xyz789abc",
    "status": "deployed",
    "url": "https://my-mcp.example.com",
    "deploy_time": 45.2,
    "health_check": "https://my-mcp.example.com/health"
  },
  "meta": {
    "request_id": "req_deploy_456", 
    "timestamp": "2023-12-01T12:00:00Z"
  }
}
Deploy your tested MCP server to production environments.

Request

mcp_id
string
required
ID of the MCP server to deploy
environment
string
required
Deployment environment. Options: production, staging, development
config
object
Deployment configuration

Response

success
boolean
Whether the deployment succeeded
data
object
curl -X POST https://api.leanmcp.com/v1/deploy \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mcp_id": "mcp_abc123def456",
    "environment": "production",
    "config": {
      "domain": "my-mcp.example.com",
      "scaling": {
        "min_instances": 2,
        "max_instances": 20
      },
      "env_vars": {
        "API_KEY": "your-api-key",
        "DEBUG": "false"
      }
    }
  }'
{
  "success": true,
  "data": {
    "deployment_id": "deploy_xyz789abc",
    "status": "deployed",
    "url": "https://my-mcp.example.com",
    "deploy_time": 45.2,
    "health_check": "https://my-mcp.example.com/health"
  },
  "meta": {
    "request_id": "req_deploy_456", 
    "timestamp": "2023-12-01T12:00:00Z"
  }
}

Deployment Environments

Production

  • High availability - Multiple instances across regions
  • Auto-scaling - Scales based on demand
  • Monitoring - Full observability and alerting
  • Custom domains - Use your own domain
  • SSL certificates - Automatic HTTPS

Staging

  • Pre-production testing - Test before going live
  • Shared resources - Lower cost than production
  • Limited scaling - Fewer instances
  • Temporary URLs - Auto-generated domains

Development

  • Quick iterations - Fast deploy cycles
  • Single instance - Minimal resources
  • Debug mode - Enhanced logging
  • Auto-cleanup - Removes old deployments

Deployment Status

Check deployment status:
GET https://api.leanmcp.com/v1/deploy/deploy_xyz789abc/status
Possible statuses:
  • deploying: Deployment in progress
  • deployed: Successfully deployed and running
  • failed: Deployment failed
  • stopped: Deployment manually stopped

Best Practices

Before Deploying

  1. Test thoroughly - Use /v1/test endpoint
  2. Check performance - Monitor response times
  3. Validate tools - Ensure all tools work correctly
  4. Review logs - Check for errors in development

Production Checklist

  • All tools tested with AI
  • Resource access permissions configured
  • Environment variables set
  • Custom domain configured (if needed)
  • Monitoring alerts configured
  • Backup strategy planned

Rollback Plan

If deployment fails:
  1. Check deployment logs
  2. Fix issues in development
  3. Redeploy with fixes
  4. Or rollback to previous version

Monitoring

Once deployed, monitor your MCP:
  • Health checks - Automatic uptime monitoring
  • Performance metrics - Response times and throughput
  • Error rates - Track failed tool calls
  • Usage analytics - See how AI agents use your MCP