
Mastra Factory: AI Coding Agents from Issue to PR
A shared software factory for coding agents and human reviewers.

Mastra Factory is an open-source environment for moving software work from an issue to a reviewed pull request. It brings coding agents, repository workspaces and a shared task board into one configurable development process. Developers can delegate implementation while keeping explicit checkpoints for scope, plans and the final code change.
What does Mastra Factory do, in plain English?
Imagine giving a developer a small bug report, discussing a plan, and checking the resulting patch before merging it. Factory organizes that same sequence around AI coding agents. You provide a repository and a task; agents investigate the code, propose changes, edit files and run checks; your team reviews the work.
The useful output is a traceable implementation and pull request, not just a code snippet in a chat. This makes Factory relevant to teams handling feature requests, bug fixes, refactoring and test work in an existing codebase. It still needs a configured development environment and people who can judge the resulting changes.
From incoming issue to reviewed implementation
The lifecycle includes Intake, Triage, Planning, Building, Review and Done. Connected sources bring work into the board, and rules determine how each kind of task progresses. During triage, the team supplies missing context. During planning, reviewers can edit or reject the proposed approach before implementation begins.
Work items retain their own sessions, keeping discussion attached to the issue. A pull request has a separate review item and review session. That separation matters: merging one PR does not necessarily finish the original task, which may require more work or additional PRs. Check both the source issue and Factory's work state when assessing completion.
Try a first task with an existing GitHub repository
The official setup guide provides a practical local-server route:
- Outside the repository agents will edit, run
npm create factory@latest my-factory, enter the new directory and complete the platform prompts. - Configure
FACTORY_CREDENTIAL_ENCRYPTION_KEYonce in.env. If absent, the guide usesopenssl rand -base64 32to generate it. Keep a protected backup; replacing the key can make saved credentials unreadable. - Run
npm run devand open the URL printed by the server. Create a Factory, choose the GitHub repository, connect a model provider and optionally add Linear. - In
Settings → Work Intake, enable GitHub issue synchronization and select the repository. Repository access alone does not subscribe you to issue intake. - Start with a narrow task, such as adding contribution instructions to a README. Specify acceptance criteria and leave automatic run start and plan approval off for the first trial.
- Investigate the issue, answer questions, accept and plan the work, then inspect the plan. After implementation, review the actual diff, tool output and repository checks before merging through your normal process.
A model saying “tests passed” is not the final acceptance criterion. Verify what ran and whether the patch meets the original request.
Choose hosting and understand where data goes
Factory supports full platform hosting, a local server using platform resources, and fully self-hosted infrastructure. The local-server option can still use Mastra's authentication, PostgreSQL and cloud sandboxes. Running the UI locally therefore does not establish that all processing stays on your machine.
Fully self-hosted setup uses --no-platform and requires your own authentication, persistent database and execution configuration. Production hosting needs a persistent Node.js process and an HTTPS endpoint supporting streamed sessions. Follow the deployment requirements before selecting a host.
Model access depends on the provider account. Personal credentials and organization credentials have different scopes. Keep secrets in credential settings or server configuration, not issues or repository instructions. Review the privacy policy and the terms of the model and execution providers you select; the available documentation does not establish a universal no-training guarantee for every setup.
Open source, platform fees and real running costs
Checked on September 10, 2026, the official USD pricing shows Starter at $0/month, with 100K observability events, 24 CPU hours and 15 days of data retention. Teams is listed at $250/month; Enterprise is quoted individually. These are platform terms, not an unlimited allowance of coding-agent work.
Additional resource consumption and model usage affect the bill. Self-hosting also requires infrastructure. Consult current platform pricing for usage rates rather than treating the subscription price as the total project cost. Local taxes or currency conversion are not established here.
Mastra's license documentation distinguishes Apache 2.0 code from enterprise features in ee/ directories. Those enterprise features require a valid enterprise license for production use; “open source” does not make every enterprise capability free.
Frequently asked questions
Can I connect an existing codebase?
Yes. Connect the GitHub repository and configure issue intake. Factory can investigate and implement work against that repository; Linear is optional.
Is Mastra Factory completely free to run?
There is an open-source foundation and a free platform starting tier. Model usage, resource overages, infrastructure and licensed enterprise features can still create costs.
Does self-hosting automatically keep everything local?
No. The server, authentication, storage, model provider and sandbox are separate choices. Inspect the whole configuration before drawing conclusions about data location.
Who controls the final change?
Humans can clarify the task, review the plan and decide whether to merge the PR. Board automation rules should reflect the level of review the team wants to retain.
Official resources and developer community
- Factory documentation — setup and configuration details.
- Mastra on GitHub — source code and issue tracking.
- Official Discord — developer discussions.
- Mastra on X — product announcements.
- Contact the Mastra team — demos and enterprise questions.





