Mastra Factory
Mastra Factory is an open source, agent-powered software delivery environment. It combines persistent coding agents, repository workspaces, issue intake, planning, implementation, and pull request review in a web application you control.
The Mastra platform will automatically deploy your Factory during project setup. You can also host your Factory on your own infrastructure.
Mastra Factory is in alpha. Breaking changes may occur without a major version bump until the API is stable. Please report any issues you encounter on GitHub.
Create a project
Install Node.js 22.13.0 or later, then create a Factory project:
- npm
- pnpm
- Yarn
- Bun
npm create factory@latest my-mastra-factorypnpm create factory my-mastra-factoryyarn create factory my-mastra-factorybunx create-factory my-mastra-factoryFollow the prompts to sign in to the Mastra platform. The CLI downloads the Factory template and installs its dependencies. It also provisions the platform resources used by the project.
Start the factory
From the new project directory, start the development server:
- npm
- pnpm
- Yarn
- Bun
cd my-mastra-factory
npm run devcd my-mastra-factory
pnpm run devcd my-mastra-factory
yarn devcd my-mastra-factory
bun run devOpen the Factory UI at http://localhost:4111 in your browser.
Onboarding
Sign in to Mastra platform and GitHub, then connect Mastra to your GitHub organization. Select the GitHub repository that the Factory will work in. You can also connect a Linear project before finishing setup.
Next, choose your Factory model. Sign in with Anthropic, OpenAI, or xAI to use an existing provider account. For any other provider, connect it with your API key. The Factory will use the model for triage and board work.
Run your first task
Existing issues from your connected GitHub repository or Linear project are listed in Intake. Select Investigate on an issue to start an agent session that examines the issue and prepares the work for planning.
If Intake is empty, navigate to your connected GitHub repository and add an issue such as:
Add a Contributing section to the README with instructions for setting up the project and submitting a pull request.Return to the Factory after the issue is listed in Intake, then select Investigate.
Next steps
Your Factory is ready to move work from an issue to an implementation and pull request review.
- Learn how each board stage works in Using the Factory.
- Explore the Factory API in the API reference.