A deployment story that matches TypeScript developer expectations
Mastra gives you a modern TypeScript-native way to build agents and workflows. Defang gives you an equally modern way to run them in production without leaving the comfort of Docker and familiar CLIs.
Keep your stack cohesive
Run your Next.js frontend, Mastra workflows, and supporting databases as a single application defined in Compose. You avoid one-off infrastructure for each new AI feature and keep deployments predictable.
Use Bedrock and Vertex AI with TypeScript
Running Mastra on Defang inside your own AWS or GCP account lets your TypeScript agents call managed inference services such as Amazon Bedrock or Vertex AI through your existing cloud configuration, with no extra gateways or one-off deployment paths.
Stay close to your users and data
With BYOC, Mastra services live in the same cloud accounts that already host your product. That makes integrating with existing databases and APIs straightforward and keeps compliance audits simple.
How it works
Defang extends the workflows you already know from building modern web apps: develop locally, containerise, then deploy with a CLI.
Containerise your Mastra services
Add Dockerfiles for your Next.js app and any dedicated Mastra backend or ingestion workers. Define them, plus databases and vector stores, in docker-compose.yml.
Deploy with Defang
From your repo, run:
defang compose up --provider=aws
Defang builds the images, provisions compute and networking, and exposes your web and API entrypoints over HTTPS.
Operate with IDE-friendly tooling
Combine Mastra's own MCP servers with Defang's MCP integration to manage deployments and infrastructure from your AI‑powered IDE, all while keeping the underlying configuration in Compose.
