# Cursor Agent SDK vs Mastra

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

- Canonical: https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-mastra
- Markdown: https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-mastra.md (~4,450 tokens)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-07

Mastra scores 74.2 (BB) on agent readiness against Cursor Agent SDK's 63.7 (B), and leads in 6 of 7 scored categories. Both do agent frameworks.

- Cursor Agent SDK: grade B, 63.7/100, rank #501 of 1486. Markdown https://www.anchorterminal.com/tools/cursor-agent-sdk.md · JSON https://www.anchorterminal.com/api/v1/tools/cursor-agent-sdk.json
- Mastra: grade BB, 74.2/100, rank #91 of 1486. Markdown https://www.anchorterminal.com/tools/mastra.md · JSON https://www.anchorterminal.com/api/v1/tools/mastra.json
- Best agent frameworks and SDKs: https://www.anchorterminal.com/best/frameworks/index.md
- All 171 frameworks comparisons: https://www.anchorterminal.com/compare/frameworks/index.md

## Which one, for what

### Cursor Agent SDK (B)

Good for: Teams already on Cursor who want version-controlled agents for pull request review, triage and Slack, with evals in CI and one-command hosting.

Also in its favour:
- No incidents deducted, where Mastra loses 8 points for them

Watch for: Closed source under Cursor's terms, with no public repository, CI or issue tracker

### Mastra (BB)

Good for: TypeScript teams that want agents, workflows, memory, evals and a local Studio in one framework.

Ahead on:
- Reliability, 87 against 45
- Schema & documentation, 98 against 82
- Agent ergonomics, 92 against 80
- Payments & pricing, 60 against 30
- Maintenance & community, 96 against 74

Also in its favour:
- Agent-ready, a grade of BB or better
- Open source

Watch for: Malicious versions of Mastra npm packages, including @mastra/core 1.42.1, were published on 17 June 2026


## Why the edge

### Reliability: Mastra +42

- Cursor Agent SDK (45): Local-package reading, since the owner runs the framework, with Cursor's hosting as an option. Official npm package with Node 22.13 or newer stated in engines and in the docs, which also say never Bun (20). Closed source, so no public CI or test suite (0). No public issue tracker. github.com/cursor/cursor holds a README and SECURITY.md, and forum.cursor.com has no Agent SDK tag, so there's nothing to count open crashes against. The troubleshooting page lists known failures with fixes (5). A dated changelog of two entries, 0.2.29 and 0.3.0, both 23 October 2026, and 0.3.0 calls out the removed `persistent` option, but the 27 earlier @cursor/bdk versions and 123 @cursor/july versions have no notes, and one build ships under three package names (5). Version 0.3.0, but the changelog post of 20 October says generally available and the docs changelog labels 0.3.0 the GA release, which we read as declared stable (15). 20+0+5+5+15 = 45.
- 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.

### Payments & pricing: Mastra +30

- Cursor Agent SDK (30): Framework reading of the published rubric. No payment protocol (0). Per-million-token prices for Cursor models, including the default Grok 4.5 with Fast, and plan prices are public, but no price for managed hosting and no statement of which plans cover the Agent SDK were found (15). The package is free and the Free plan needs no card, but its usage is only described as limited agent requests (15). A person signs in through a browser or creates an API key in the dashboard before a model turn runs (0). 0+15+15+0 = 30.
- 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).

### Maintenance & community: Mastra +22

- Cursor Agent SDK (74): 0.3.0 on npm on 25 October 2026, per the 27 October check (npm not re-read on 2 November), and the docs changelog still ends at 0.3.0 of 23 October (30). Five @grok/agent-sdk versions from 22 to 25 October and 29 @cursor/bdk versions since 22 September, per the 27 October check (20). Closed product. A public changelog with two entries and a forum with no Agent SDK tag, so we couldn't see replies to SDK reports (8). The npm package is current and official, TypeScript only (12). Dependencies are current releases, but there's no public CI and the same build goes out under three names with a postinstall script (4). 30+20+8+12+4 = 74.
- 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.

### Schema & documentation: Mastra +16

- Cursor Agent SDK (82): Framework reading. Typed TypeScript declarations ship in the package, tools take Zod or JSON Schema, `agent-sdk help --json` describes every command's flags and exit codes, and `GET /v1/info` and `GET /v1/tools/:name` return the discovered surface and each tool's schemas. No OpenAPI document for the HTTP routes (20). cursor.com/llms.txt lists every Agent SDK page with a Markdown twin, and the package ships the docs and an llms.txt (10). The overview has a table of when to use the Agent SDK, Automations or Grok Bot, and the hooks page has a table of what to use instead of a hook for each job (18). Typed config, `effect` as an enum or predicate, `timeArgs` checked against the input schema, and slug patterns stated (13). Examples on every page, with error tables for direct tool calls, HTTP 401, 403 and 409, the limit error's JSON and seven exit codes (15). A dated changelog, but only two entries, both from 23 October 2026 (6). 20+10+18+13+15+6 = 82.
- 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).

### Agent ergonomics: Mastra +12

- Cursor Agent SDK (80): Framework reading, scored on what it takes to run a tool-calling agent with MCP. One file per tool and one file per MCP connection, `tools` and `disallowedTools` filters with `effects: "read"`, and an allowlist for the harness's built-in tools (22). Concurrency caps with queued turns, `--fields`, page tokens and limits on list commands, and a per-session cost view. We found no turn cap or spend cap for a run (12). Built-in routes return `{ ok: false, error }` codes, direct tool calls have documented 400, 404, 409 and 500 codes, and the CLI has seven exit codes (18). Reads and idempotent calls retry up to three times, writes run once, MCP readOnlyHint and idempotentHint decide retries for connection tools, and dry-run sessions stub writes (20). `agent-sdk init` scaffolds a working project and every agent field is optional, but the framework is TypeScript only (8). 22+12+18+20+8 = 80.
- Mastra (92): An MCP client in about ten lines with listTools() for static or listToolsets() for per-request tools, and ToolSearchProcessor for loading tools on demand (25). Step limits, memory windows and processors such as a token limiter control what reaches the model (20). MastraError with ids and categories, and processors can abort with a reason the caller can read (17). Workflow step retries, snapshots and durable agents for resuming (20). create-mastra scaffolds a project and the model router takes a plain string, but it's TypeScript only (10).

## Score by category

| Category | Weight | Cursor Agent SDK | Mastra | Edge |
| --- | --- | --- | --- | --- |
| Reliability | 16% (20 this run) | 45 | 87 | Mastra +42 |
| Performance | 10%, pending | pending | pending | not scored in this run |
| Schema & documentation | 13% (16.2 this run) | 82 | 98 | Mastra +16 |
| Agent ergonomics | 13% (16.2 this run) | 80 | 92 | Mastra +12 |
| Security & auth | 14% (17.5 this run) | 68 | 67 | Cursor Agent SDK +1 |
| Payments & pricing | 10% (12.5 this run) | 30 | 60 | Mastra +30 |
| Task success | 10%, pending | pending | pending | not scored in this run |
| Maintenance & community | 7% (8.8 this run) | 74 | 96 | Mastra +22 |
| Transparency & trust | 7% (8.8 this run) | 71 | 72 | Mastra +1 |
| Negative events | ≤15 | 0 | -8 | |
| **Total** | | **63.7 · B** | **74.2 · BB** | |

## Facts side by side

| Fact | Cursor Agent SDK | Mastra |
| --- | --- | --- |
| Kind | Agent framework | Agent framework |
| Vendor | Cursor | Kepler Software, Inc. |
| Hosted endpoint | no (local only) | no (local only) |
| Transports |  |  |
| Auth | OAuth or key | API key |
| Pricing | Your plan | Free |
| x402 | no | no |
| Licence | Proprietary. The package's LICENSE.md reads "© Anysphere Inc. All rights reserved", with use subject to Cursor's Terms of Service (updated 3 September 2026). No source repository is published | Apache-2.0 for the core. Code under ee/ directories is source-available under the Mastra Enterprise License, free for development and testing |
| Read-only variant documented | no | no |
| llms.txt | yes | yes |
| Last release | 2026-10-25 | 2026-11-04 |
| Terms last updated | 2026-09-03 | 2026-10-26 |
| Privacy policy last updated | 2026-09-29 | no date given |
| Customer content may train models | not found in the text | yes |
| Terms restrict automated access | yes | yes |
| Terms restrict benchmarking | yes | not found in the text |
| Terms or service can change without notice | yes | yes |
| Arbitration or class-action waiver | yes | yes |
| Popularity | none | 29k stars, 3.1M npm/wk |

## How the scores have moved

### Cursor Agent SDK

- +0.1 on 28 October 2026: checklist

### Mastra

No score change since it was listed.

## Verdicts

**Cursor Agent SDK.** An agent-as-code framework with typed tools, declared read and write effects that drive retries and dry runs, an approval gate per tool and evals that assert on tool calls. It's closed source, every model turn runs through Cursor's backend on a Cursor plan, local sandboxing is off by default, and the changelog has two entries.

**Mastra.** A TypeScript framework with agents, workflows with suspend and resume, memory, an MCP client and server, per-server tool approval and built-in guardrail processors including a prompt-injection detector. On 17 June 2026 malicious versions of its npm packages were published, and the CLI, server and Studio send usage analytics by default, with token counts every 15 minutes.

## Before you call either

### Cursor Agent SDK

1. Install `@grok/agent-sdk`, not `@cursor/agent-sdk` from the launch post. That name answers 404 on npm
2. Set `local.sandbox` before a turn reads webhook payloads, pull request diffs or chat. Without it shell commands auto-approve with the host's credentials
3. Give every tool an `effect`. A tool without one counts as a write, runs once and is stubbed in dry runs
4. Start `agent-sdk serve` with `--bearer-token` on any shared host. `--allow-anonymous` admits every caller as one principal
5. Delete bot/hooks/memory.ts when sessions serve different people. The journal shares each turn's message and result with later turns

### Mastra

1. Set MASTRA_TELEMETRY_DISABLED=1 in every environment that runs the CLI, the server or Studio
2. Pin exact versions with a lockfile, and make sure no 17 June 2026 release such as @mastra/core 1.42.1 is installed
3. Set requireToolApproval on MCP servers that write, and allowedHosts when server URLs come from configuration
4. Add PromptInjectionDetector as an input processor when tools return web or user content
5. Use supervisor agents through generate() or stream(). `.network()` is deprecated

## Questions

### Which is better for AI agents, Cursor Agent SDK or Mastra?

Mastra scores 74.2 (BB) on agent readiness against Cursor Agent SDK's 63.7 (B), and leads in 6 of 7 scored categories.

### Are Cursor Agent SDK and Mastra open source?

No open-source release is listed for Cursor Agent SDK. Mastra is open source (Apache-2.0 for the core. Code under ee/ directories is source-available under the Mastra Enterprise License, free for development and testing).


## For agents

- This comparison as JSON: https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-mastra.json, and with the fewest tokens: https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-mastra.min.md
- Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "cursor-agent-sdk", "b": "mastra"}`. From a terminal: `anchor compare cursor-agent-sdk mastra`
- Each listing in full: https://www.anchorterminal.com/api/v1/tools/cursor-agent-sdk.json and https://www.anchorterminal.com/api/v1/tools/mastra.json

## Other comparisons with Cursor Agent SDK or Mastra

- [AgentOS vs Cursor Agent SDK](https://www.anchorterminal.com/compare/agentos-vs-cursor-agent-sdk.md)
- [AgentOS vs Mastra](https://www.anchorterminal.com/compare/agentos-vs-mastra.md)
- [Agno vs Cursor Agent SDK](https://www.anchorterminal.com/compare/agno-vs-cursor-agent-sdk.md)
- [Agno vs Mastra](https://www.anchorterminal.com/compare/agno-vs-mastra.md)
- [BoxLang AI vs Cursor Agent SDK](https://www.anchorterminal.com/compare/boxlang-ai-vs-cursor-agent-sdk.md)
- [BoxLang AI vs Mastra](https://www.anchorterminal.com/compare/boxlang-ai-vs-mastra.md)
- [Claude Agent SDK vs Cursor Agent SDK](https://www.anchorterminal.com/compare/claude-agent-sdk-vs-cursor-agent-sdk.md)
- [Claude Agent SDK vs Mastra](https://www.anchorterminal.com/compare/claude-agent-sdk-vs-mastra.md)
- [CrewAI vs Cursor Agent SDK](https://www.anchorterminal.com/compare/crewai-vs-cursor-agent-sdk.md)
- [CrewAI vs Mastra](https://www.anchorterminal.com/compare/crewai-vs-mastra.md)
- [Cursor Agent SDK vs Docker Agent](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-docker-agent.md)
- [Cursor Agent SDK vs Agent Development Kit (ADK)](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-google-adk.md)
- [Cursor Agent SDK vs guilds.run](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-guilds-run.md)
- [Cursor Agent SDK vs LangGraph](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-langgraph.md)
- [Cursor Agent SDK vs LlamaIndex Framework](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-llamaindex.md)
- [Cursor Agent SDK vs Microsoft Agent Framework](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-microsoft-agent-framework.md)
- [Cursor Agent SDK vs OpenAI Agents SDK](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-openai-agents-sdk.md)
- [Cursor Agent SDK vs Pydantic AI](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-pydantic-ai.md)
- [Cursor Agent SDK vs smolagents](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-smolagents.md)
- [Cursor Agent SDK vs Strands Agents](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-strands-agents.md)
- [Cursor Agent SDK vs TradingAgents](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-tradingagents.md)
- [Cursor Agent SDK vs AI SDK](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-vercel-ai-sdk.md)
- [Docker Agent vs Mastra](https://www.anchorterminal.com/compare/docker-agent-vs-mastra.md)
- [Agent Development Kit (ADK) vs Mastra](https://www.anchorterminal.com/compare/google-adk-vs-mastra.md)
- [guilds.run vs Mastra](https://www.anchorterminal.com/compare/guilds-run-vs-mastra.md)
- [LangGraph vs Mastra](https://www.anchorterminal.com/compare/langgraph-vs-mastra.md)
- [LlamaIndex Framework vs Mastra](https://www.anchorterminal.com/compare/llamaindex-vs-mastra.md)
- [Mastra vs Microsoft Agent Framework](https://www.anchorterminal.com/compare/mastra-vs-microsoft-agent-framework.md)
- [Mastra vs OpenAI Agents SDK](https://www.anchorterminal.com/compare/mastra-vs-openai-agents-sdk.md)
- [Mastra vs Pydantic AI](https://www.anchorterminal.com/compare/mastra-vs-pydantic-ai.md)
- [Mastra vs smolagents](https://www.anchorterminal.com/compare/mastra-vs-smolagents.md)
- [Mastra vs Strands Agents](https://www.anchorterminal.com/compare/mastra-vs-strands-agents.md)
- [Mastra vs TradingAgents](https://www.anchorterminal.com/compare/mastra-vs-tradingagents.md)
- [Mastra vs AI SDK](https://www.anchorterminal.com/compare/mastra-vs-vercel-ai-sdk.md)

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
