Skip to main content

License

Mastra uses a dual-license model with the Apache License 2.0 for the majority of the codebase and the Mastra Enterprise License for enterprise-specific features.

  • All content that resides under any directory called ee/ within Mastra's repository, including but not limited to:

    • @mastra/core/auth/ee
    • @mastra/core/agent-builder/ee
    • @mastra/editor/ee

    is licensed under the license defined in ee/LICENSE.

  • All third-party components incorporated into the Mastra Software are licensed under the original license provided by the owner of the applicable component.

  • Content outside of the above-mentioned directories or restrictions is available under the "Apache License 2.0".

What requires an EE license
Direct link to What requires an EE license

Whether you need a Mastra Enterprise Edition (EE) license depends on which features you configure, not on which packages you install. The table shows which features need a license in production. Every feature works without a license in development and testing.

FeatureEE license required in production
Authentication on API routes (server.auth) with any provider, including Simple Auth, JWT, Auth0, Better Auth, Clerk, Firebase, Google, Neon, Okta, Supabase, and WorkOSNo
Studio with Simple Auth, JWT, or Mastra platform authNo
Studio sign-in screen (an SSO button or an email and password form) with a third-party providerYes
Role-based access control (RBAC) with server.rbac or studio.rbac, using any providerYes
Fine-grained authorization (FGA) with server.fga or studio.fgaYes
Agent BuilderYes

Without a license in production
Direct link to Without a license in production

Set your license key in the MASTRA_LICENSE_KEY environment variable. Mastra also reads the older MASTRA_EE_LICENSE variable. Without a valid key in production:

  • RBAC, FGA, or Agent Builder: The server doesn't start, and the error names the feature that needs a license.
  • Studio sign-in screen with a third-party provider: Studio hides the sign-in screen. Authentication on API routes keeps working.

Apache License 2.0
Direct link to Apache License 2.0

Copyright (c) 2025 Kepler Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Mastra Enterprise License
Direct link to Mastra Enterprise License

Code in any directory called ee/ (e.g., @mastra/core/auth/ee) is source-available under the Mastra Enterprise License. These features require a valid enterprise license for production use but can be freely used for development and testing. Contact sales for more information.

Questions?
Direct link to Questions?

For questions about how Mastra's dual-license approach applies to your use case, contact Mastra.