# Claude Agent SDK vs Mastra (slim)

> Mastra scores 74.2 (BB) to Claude Agent SDK's 70.3 (BB) for agent frameworks. Prices, MCP, x402, uptime and agent notes side by side.

- Full: https://www.anchorterminal.com/compare/claude-agent-sdk-vs-mastra.md (~5,600 tokens) · this version ~3,380 tokens · JSON https://www.anchorterminal.com/compare/claude-agent-sdk-vs-mastra.json · canonical https://www.anchorterminal.com/compare/claude-agent-sdk-vs-mastra
- Index: https://www.anchorterminal.com/llms.txt · API: https://www.anchorterminal.com/api/v1/index.json · MCP: https://www.anchorterminal.com/mcp · Updated: 2026-11-07
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)

Mastra scores 74.2 (BB) on agent readiness against Claude Agent SDK's 70.3 (BB), and leads in 4 of 7 scored categories. Claude Agent SDK leads on security & auth and transparency & trust. Both do agent frameworks.

- Claude Agent SDK: BB 70.3, rank #204 of 1510 · https://www.anchorterminal.com/tools/claude-agent-sdk.min.md
- Mastra: BB 74.2, rank #91 of 1510 · https://www.anchorterminal.com/tools/mastra.min.md
- Claude Agent SDK, good for Agents that work on files, code and shells and want Claude Code's tool set and permission model without building them. Ahead on Security & auth, 83 against 67; Transparency & trust, 83 against 72.
- Mastra, good for TypeScript teams that want agents, workflows, memory, evals and a local Studio in one framework. Ahead on Reliability, 87 against 70; Schema & documentation, 98 against 89; Payments & pricing, 60 against 40; Maintenance & community, 96 against 87. Also Open source.

| Category | Claude Agent SDK | Mastra |
| --- | --- | --- |
| Reliability (16%) | 70 | 87 |
| Performance (10%) | pending | pending |
| Schema & documentation (13%) | 89 | 98 |
| Agent ergonomics (13%) | 95 | 92 |
| Security & auth (14%) | 83 | 67 |
| Payments & pricing (10%) | 40 | 60 |
| Task success (10%) | pending | pending |
| Maintenance & community (7%) | 87 | 96 |
| Transparency & trust (7%) | 83 | 72 |

| Fact (where they differ) | Claude Agent SDK | Mastra |
| --- | --- | --- |
| Vendor | Anthropic | Kepler Software, Inc. |
| Licence | MIT (Python wrapper), proprietary (TypeScript package and the bundled Claude Code binary) | Apache-2.0 for the core. Code under ee/ directories is source-available under the Mastra Enterprise License, free for development and testing |
| Last release | 2026-10-31 | 2026-11-04 |
| Terms last updated | no date given | 2026-10-26 |
| Customer content may train models | yes, with an opt-out | yes |
| Terms restrict automated access | not found in the text | yes |
| Terms restrict benchmarking | yes | not found in the text |
| Terms or service can change without notice | not found in the text | yes |
| Popularity | 8.2k stars, 10.1M npm/wk, 6.1M PyPI/wk | 29k stars, 3.1M npm/wk |
| Agent reviews | 2.5/5 (4) | none |

Why the edge:
- Payments & pricing, Mastra +20: Claude Agent SDK 40 (No payment protocol (0). Claude model prices and Managed Agents at $0.08 a session-hour are published without a login, per the 17 October check, not re-read on 1 November (20). The package is free and needs no card (20). It runs Claude only, so a person has to create a Claude API key or a cloud account before it does anything, where the other frameworks in this category can run a local model with no signup (0). 0+20+20+0 = 40. Judgement call, and it goes against Anthropic's own listing. We didn't treat Managed Agents, which its overview page still called a beta on 17 October, as this SDK's hosted option, since it doesn't run SDK code, and the score would be the same if we had.); Mastra 60 (No payment protocol (0). Scored on the hosted platform, whose per-unit prices are public without a login ($10 per 100K observability events and $0.35 a CPU hour on Starter) (20). The Apache 2.0 packages install with no card (20) and no account, and run any model (20).)
- Reliability, Mastra +17: Claude Agent SDK 70 (Official packages on PyPI (Requires-Python >=3.10 in pyproject.toml, 0.2.176 tagged on 31 October) and npm (TypeScript 0.3.311 on 26 October raised the minimum Node.js from 18.0.0 to 18.14.0) (20). The Python repository still runs its Test and Lint workflows, and 0.2.169 and 0.2.170 (20 and 21 October) hash-pinned the release build tools and moved PyPI uploads to trusted publishing. Runs on main pass per the 1 October check, not re-read on 1 November (25). 185 to 192 open issues against about 50 releases in 90 days, with triage labels on recent reports, though a regression from 0.2.140 (#1226) and two data-loss reports (#1191, #1200) were still open after five weeks, per the 1 October check, since GitHub's pages weren't reachable on 15 or 17 October or 1 November (18). The changelog has Breaking Changes headings but no dates, 0.2.129 broke skill names in a patch-level bump, TypeScript 0.3.286, 0.3.300 and 0.3.302 changed permission-mode, hook and subagent behaviour in patch releases with no breaking label, and 0.3.311 on 26 October raised the Node.js floor the same way (7). Python 0.2.176 and TypeScript 0.3.316 are pre-1.0, and pyproject.toml still classes the package as 3 - Alpha (0). 20+25+18+7+0 = 70. Judgement call. These patch-level changes aren't deducted under the 1 November rule for breaking changes in a minor release, because both packages are 0.x, the provisional exemption bird v0.77.0 got.); Mastra 87 (Official npm packages, Node 22.13 or newer (20). Public CI workflows for unit, store, workspace and e2e tests; on 6 November the newest runs on main (Version Packages, Trigger Cloud Integration Tests) succeeded, while the test workflows themselves run on pull requests (22). 436 open issues and 795 open issues and pull requests on 6 November from GitHub's API, with 2,077 issues opened in the 90 days to 3 November; all 50 newest had a comment and 24 were closed, with issue-triage automation (18). A changesets CHANGELOG per package, a CI gate that needs approval for any major bump and migration guides, but no written versioning policy found, and `.network()` is deprecated without a removal date (12). 1.82.0 (15). 20+22+18+12+15 = 87, up from 74 on 6 October, when GitHub couldn't be read.)
- Security & auth, Claude Agent SDK +16: Claude Agent SDK 83 (Usage metrics go to Anthropic and third-party logging by default on the Claude API, without code, prompts or file paths, and DISABLE_TELEMETRY=1 turns them off. They're off by default on Google Cloud, Bedrock, Foundry and Claude Platform on AWS, unless a host platform sets CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST. WebFetch sends hostnames to api.anthropic.com for a blocklist check on every provider, with its own opt-out. All re-read on the data-usage page on 1 November (20). canUseTool approval callback and PreToolUse hooks, plan and dontAsk modes with deny rules, and sandbox settings for shell commands, re-read on the permissions page on 1 November. TypeScript 0.3.301 added per-tool `always_ask` and `always_deny` policies for in-process MCP servers, and 0.3.314 and 0.3.316 typed `blockWritesOutsideWorkingDirectories` and `blockReadsExemptPaths` (20). Hooks can block a call and auto mode runs a classifier on actions, but there's no input or output guardrail primitive (10). OpenTelemetry export to your own collector stays off until CLAUDE_CODE_ENABLE_TELEMETRY=1 is set, prompt and tool content need separate flags, and tool_decision and permission_mode_changed events can form a per-user audit trail, per the observability page read on 15 October (15). HackerOne bug bounty, advisories published on the claude-code repository, whose SECURITY.md is unchanged in the clone, and anthropic.com's security.txt valid to 31 December 2026, re-read on 1 November, but neither the Python nor the TypeScript SDK repository has a SECURITY.md, checked again in both clones on 1 November (18). 20+20+10+15+18 = 83. Framework reading, so SOC 2 isn't scored, as for claude-code. The bundled CLI's advisories are counted under negative events, not here.); Mastra 67 (The CLI sends PostHog analytics, server startup sends token counts per model and a count of registered agents, tools and MCP servers, and Studio sends browser analytics, all on by default and documented, with one opt-out, MASTRA_TELEMETRY_DISABLED=1. Since #26986 (16 October 2026) each server process also reports token use per provider and model every 15 minutes, and the telemetry reference read on 6 November says server events carry a project identifier that is a raw Platform UUID or a hash of the Git origin remote, so they "aren't anonymous" (12). requireToolApproval on agents and MCP servers, allowedHosts for MCP HTTP, a curated environment for stdio servers, and sandboxed workspaces (20). PromptInjectionDetector, PII and moderation processors, and docs that call tool results untrusted model input (15). Built-in tracing with OpenTelemetry and other exporters (15). No SECURITY.md, no security.txt and no bug bounty found. A blog post says Mastra is SOC 2 Type II audited, which isn't scored for a framework, and we found no public advisory from Mastra about the June incident (5). Framework reading. 15+20+15+15+5 = 70 on 6 October, 12+20+15+15+5 = 67 on 6 November.)
- Transparency & trust, Claude Agent SDK +11: Claude Agent SDK 83 (The Python wrapper is MIT, but its wheel bundles the proprietary Claude Code binary, and the TypeScript package's LICENSE.md still says All rights reserved under Anthropic's Commercial Terms, both re-read in the clones on 1 November (18). The data-usage page, re-read on 1 November, states 30-day retention for commercial and API users, zero data retention for qualified accounts, no training on commercial data and 30 days of local transcripts in ~/.claude/projects, but still names the logging and error-tracking services only as third parties (25). Deprecations appear in the changelogs without dates, and there's no written deprecation policy for the SDK (8). Telemetry is documented per provider, with an opt-out for each service (20). 18+25+8+20 = 71. Judgement call on the licence line, written on Claude.); Mastra 72 (Apache 2.0 for the core, with ee/ directories source-available under the Mastra Enterprise License (25). The privacy policy (last published 25 April 2025) covers the website, the Teams plan states six months' retention, and the subprocessor list sits in a trust centre our reader couldn't render (15). Migration guides and deprecation warnings, without dated removal windows (12). Every telemetry stream is documented with links to its source and one opt-out, and the reference now spells out what the project identifiers can be correlated with (20).)
- Schema & documentation, Mastra +9: Claude Agent SDK 89 (Typed public interfaces with a full Python and TypeScript reference, options as dataclasses and TypedDicts (25). llms.txt at code.claude.com/docs/llms.txt and Markdown pages, the permissions, permission-modes and MCP pages read as .md on 1 November (10). The overview, per the 15 October check, has a table of when to use the Agent SDK, the CLI, the Client SDK or Managed Agents, and each permission mode says when to use it, but permissions still run through a six-step evaluation order with many exceptions, re-read on 1 November, and open issue #1220 says as much per the 1 October check (15). Permission modes and MCP server configs are typed variants, Python 0.2.166 added typed hook outputs and a `SystemInitData` TypedDict, and TypeScript 0.3.312 to 0.3.316 added typed `Settings` keys for auto mode and working-directory read and write blocks, though TypedDicts still aren't validated at runtime (12). Python and TypeScript examples on every page, with the exception classes and terminal reasons documented (15). A changelog per package, with version headings and no dates, re-read in both repositories on 1 November (12). 25+10+15+12+15+12 = 89.); Mastra 98 (Typed TypeScript API with a reference section (25). llms.txt with a when-to-use list and condensed instructions for coding agents (10). The docs say when to use durable agents, and point multi-agent users from `.network()` to supervisor agents (20). Tools take Zod schemas (15). Examples on every page, and MastraError with ids and categories documented, though errors are spread across pages (13). Per-package changelogs and migration guides (15).)
- Maintenance & community, Mastra +9: Claude Agent SDK 87 (Python 0.2.176 and TypeScript 0.3.316, both tagged on 31 October, PyPI and npm unreadable from here on 1 November (30). 47 Python release tags (0.2.129 to 0.2.176) and 81 TypeScript tags (0.3.221 to 0.3.316) between 4 August and 31 October, inside the 90 days from 3 August (20). Recent bug reports carry triage labels (bug, regression, invalid), but 185 open issues and about 260 open pull requests is a large backlog, and we couldn't see reply times. Per the 1 October check, not re-read on 1 November (15). Python and TypeScript packages both current, each bundling or matching Claude Code 2.1.316 (15). CI and a dependency-graph workflow pass per the 1 October check. Releases have run without a gap since 6 October, 0.2.165 added an alert for blocked releases, 0.2.169 hash-pinned the build tools and 0.2.170 moved to trusted publishing, but no Python release shipped from 30 September to 6 October, and earlier yanks and the partial publish in #1234 still stand (7). 30+20+15+15+7 = 87.); Mastra 96 (@mastra/core 1.82.0 on 2026-11-04 (30). 27 stable releases in the 90 days to 6 November, 8 of them since 6 October (20). 436 open issues on 6 November, all 50 newest issues commented and 24 of them closed (22). Client, MCP and store packages are current, and @mastra/mcp 1.x stays supported beside 2.x (15). Renovate and CI configured, with the newest runs on main passing (9). 30+20+22+15+9 = 96.)
