05/26/26

Best Backend Framework for Cursor (2026)

We benchmarked Claude Code on five TypeScript backends. Cursor uses the same models, so the framework ranking and the numbers behind it port over directly.

5 Min Read

Which TypeScript backend framework is the best fit for Cursor when you let the agent drive most of the code?

We ran our AI-readiness benchmark with Claude Code rather than Cursor, but the underlying models are the same family (claude-sonnet-4-6 in our case, and the same Anthropic models in Cursor when you select them), the framework defaults are decided by the model and the framework's documentation more than by the editor wrapper, and the framework ordering we found in the benchmark ports over directly. The short answer is that Encore is the framework where the agent's first draft was production-ready on a 36-check rubric, at $2.58 per run against $5.95 on NestJS, and Encore is also the only framework in the benchmark that ships agent-readiness materials Cursor reads in (a CLAUDE.md, an MCP server, an llms.txt plus llms-full.txt).

Full benchmark, prompts, starters, and transcripts at github.com/encoredev/ai-backend-benchmark.

Why a Claude Code benchmark applies to Cursor

The benchmark stresses the agent's defaults rather than the IDE wrapper. We held the model constant (claude-sonnet-4-6), the prompts constant, the test suite constant, the VM image and the Postgres setup constant. The variable across the five framework runs was the framework's scaffold and its agent-readiness materials. Cursor's agent makes the same kind of decisions Claude Code's agent makes when given the same starter and the same prompt, because they are both querying the same model with the same kind of context. The cost numbers will differ slightly with different system prompts, but the ranking of which framework yields production-ready output on the first pass does not.

How Cursor reads framework materials

Cursor reads .cursor/rules and project files into its context window, and it speaks Model Context Protocol (MCP), which means a framework that ships an llms.txt, a CLAUDE.md, or an MCP server gives the agent a calibrated starting point rather than asking it to rederive the framework's conventions from source. Encore's CLAUDE.md doubles as effective Cursor rules without modification: Cursor will pick it up either at the project root or under .cursor/rules/. Encore's MCP server, started with encore mcp start, exposes the running application's services, endpoints, and database schemas to Cursor through the same protocol Cursor uses for every other MCP integration.

FrameworkCLAUDE.md / Cursor rulesMCP serverllms.txtAI integration docs
Encoreyes (CLAUDE.md, works as Cursor rules)yesyesyes
Honononoyesno
Expressnononono
Fastifynononono
NestJSnononono

What the agent shipped on each framework

On the baseline run every framework hit 31 of 31 tests, but the diffs underneath those green test suites diverged sharply. The four non-Encore frameworks converged on the same three anti-patterns: a Postgres queue table polled by setInterval for the durable pub/sub, an in-process setTimeout chain for the daily cron, and CREATE TABLE IF NOT EXISTS at boot for the schema. Encore got the framework primitives instead: a typed Topic with a Subscription, a CronJob invoked once per tick by an external scheduler, and numbered SQL migrations.

// What the agent built on Encore
export const orderCreated = new Topic<OrderCreatedEvent>("order-created", {
  deliveryGuarantee: "at-least-once",
});

new Subscription(orderCreated, "send-notification", {
  handler: async (event) => { /* ... */ },
  retryPolicy: { maxRetries: 3 },  // the only Run 3 addition
});

const _ = new CronJob("daily-aggregation", {
  every: "24h",
  endpoint: runDailyAggregation,
});

Numbers per framework

FrameworkRun 1 cost (median)Run 3 costRun 3 rubric (out of 36)Total cost across three runs
Encore$1.96$2.5836/36$6.29
Hono$1.55not reported29/36~$8
Fastifysimilar to Encore$4.6036/36~$10
Expresssimilar to Encorenot reported35/36~$9
NestJS$2.61 (one $4.45 outlier)$5.9530/36$12.69

Encore was both the cheapest framework across the full benchmark and the only one that landed every production-readiness check on the first pass.

How to set up Cursor with Encore

encore app create my-app
cd my-app
encore llm-rules init     # writes CLAUDE.md (works as Cursor rules)
encore mcp start          # MCP server Cursor can connect to
cursor .

Cursor will pick up the CLAUDE.md from the project root automatically. To wire the MCP server into Cursor, add the following to Cursor's MCP settings (Settings → MCP):

{
  "mcpServers": {
    "encore": {
      "command": "encore",
      "args": ["mcp", "start"]
    }
  }
}

From there Cursor can read the framework conventions, query the live app state through MCP, and reach for the right primitives when extending the codebase.

When to choose a different framework

If you have an existing Fastify, Express, NestJS, or Hono codebase and you are not planning to let Cursor drive a meaningful share of your work, the additional cost the benchmark measured does not apply to you. For new projects where Cursor is doing real work, the benchmark says Encore lands fewer broken implementations at lower token cost.

Reproduce the benchmark

Clone the repo, point it at your own framework or your own editor: github.com/encoredev/ai-backend-benchmark.

Ready to build your next backend?

Encore is the Open Source framework for building robust type-safe distributed systems with declarative infrastructure.