> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leanmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy on AWS, GCP, and Azure

> Deploy MCPs on major cloud providers

If your organization already uses AWS, GCP, or Azure, you can deploy MCPs on your existing infrastructure. The LeanMCP SDK works on any Node.js runtime.

However, deploying on cloud providers requires significant DevOps expertise. You need to configure logging, monitoring, scaling, networking, and security yourself.

***

## The Reality of Cloud Deployment

Deploying MCPs properly on AWS, GCP, or Azure is not trivial. To get it right, you need:

* **Logging and observability** — CloudWatch, Cloud Logging, or Azure Monitor
* **Scaling configuration** — auto-scaling policies, load balancers
* **Networking** — VPCs, security groups, IAM roles
* **Access controls** — who can deploy, who can access logs
* **CI/CD pipelines** — automated builds and deployments
* **Health checks and alerting** — know when things break

Even experienced teams typically need **6-7 DevOps engineers** and **500-600 hours** to set up production-ready infrastructure. That's months of work before you even start building MCP features.

***

## Recommended Services

If you must deploy on cloud providers, use managed container services. They handle scaling and infrastructure, reducing (but not eliminating) the DevOps burden.

| Provider  | Recommended Service | Description                                 |
| --------- | ------------------- | ------------------------------------------- |
| **AWS**   | Fargate (with ECS)  | Serverless containers, no server management |
| **GCP**   | Cloud Run           | Fully managed container platform            |
| **Azure** | Container Apps      | Serverless containers with auto-scaling     |

***

## AWS: Fargate with ECS

AWS Fargate runs containers without managing servers. Combine it with ECS for orchestration.

### Step 1: Create Dockerfile

```dockerfile theme={null}
FROM node:20-alpine

WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .

EXPOSE 3000
CMD ["node", "dist/server.js"]
```

### Step 2: Build and Push to ECR

```bash theme={null}
# Authenticate with ECR
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <account-id>.dkr.ecr.us-east-1.amazonaws.com

# Build image
docker build -t my-mcp .

# Tag and push
docker tag my-mcp:latest <account-id>.dkr.ecr.us-east-1.amazonaws.com/my-mcp:latest
docker push <account-id>.dkr.ecr.us-east-1.amazonaws.com/my-mcp:latest
```

### Step 3: Create ECS Service

```bash theme={null}
# Create task definition (task-definition.json)
aws ecs register-task-definition --cli-input-json file://task-definition.json

# Create service
aws ecs create-service \
  --cluster my-cluster \
  --service-name my-mcp-service \
  --task-definition my-mcp:1 \
  --desired-count 2 \
  --launch-type FARGATE
```

***

## GCP: Cloud Run

Cloud Run is GCP's fully managed container platform. It's simpler than Fargate for basic deployments.

### Step 1: Build with Cloud Build

```bash theme={null}
# Build and push to Artifact Registry
gcloud builds submit --tag gcr.io/PROJECT_ID/my-mcp
```

### Step 2: Deploy to Cloud Run

```bash theme={null}
gcloud run deploy my-mcp \
  --image gcr.io/PROJECT_ID/my-mcp \
  --platform managed \
  --region us-central1 \
  --allow-unauthenticated \
  --memory 512Mi \
  --timeout 300
```

Cloud Run supports up to 60 minutes timeout on paid plans, much better than Lambda/Vercel.

***

## Azure: Container Apps

Azure Container Apps is Microsoft's serverless container platform.

### Step 1: Create Container Registry

```bash theme={null}
az acr create --resource-group myResourceGroup --name myregistry --sku Basic
```

### Step 2: Build and Push

```bash theme={null}
az acr build --registry myregistry --image my-mcp:v1 .
```

### Step 3: Deploy Container App

```bash theme={null}
az containerapp create \
  --name my-mcp \
  --resource-group myResourceGroup \
  --environment myEnvironment \
  --image myregistry.azurecr.io/my-mcp:v1 \
  --target-port 3000 \
  --ingress external
```

***

## Adding Monitoring

Cloud providers require you to configure monitoring yourself:

### AWS CloudWatch

```typescript theme={null}
import { CloudWatchClient, PutMetricDataCommand } from "@aws-sdk/client-cloudwatch";

const cloudwatch = new CloudWatchClient({});

async function logToolCall(toolName: string, duration: number) {
  await cloudwatch.send(new PutMetricDataCommand({
    Namespace: "MCP/Tools",
    MetricData: [{
      MetricName: "Duration",
      Dimensions: [{ Name: "Tool", Value: toolName }],
      Value: duration,
      Unit: "Milliseconds"
    }]
  }));
}
```

### GCP Cloud Monitoring

```typescript theme={null}
const monitoring = require('@google-cloud/monitoring');
const client = new monitoring.MetricServiceClient();

// Similar setup for custom metrics
```

***

## Enterprise Option: LeanMCP on Your Cloud

For enterprise customers who need to stay on AWS/GCP/Azure for compliance or existing infrastructure reasons, we offer a managed deployment option.

We deploy our platform on **your cloud account** with our infrastructure code. You get:

* Battle-tested infrastructure
* Full monitoring and observability
* No DevOps overhead on your team
* Your data stays in your cloud

Contact us at [founders@leanmcp.com](mailto:founders@leanmcp.com) for enterprise deployments.

***

## Comparison

| Approach                  | Setup Time    | DevOps Required | Monitoring         |
| ------------------------- | ------------- | --------------- | ------------------ |
| **DIY on Cloud**          | 500-600 hours | 6-7 engineers   | Configure yourself |
| **LeanMCP Platform**      | Minutes       | None            | Built-in           |
| **LeanMCP on Your Cloud** | Days          | Our team        | Built-in           |

***

## Recommendation

If you're already deep in AWS/GCP/Azure and have DevOps resources, these guides help you get started. But for most teams, [LeanMCP Platform](/deploy/leanmcp-platform) is faster and cheaper than building infrastructure from scratch.

<CardGroup cols={2}>
  <Card title="LeanMCP Platform" icon="rocket" href="/deploy/leanmcp-platform">
    Deploy in minutes, not months
  </Card>

  <Card title="Enterprise Contact" icon="building" href="mailto:founders@leanmcp.com">
    LeanMCP on your cloud
  </Card>
</CardGroup>
