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.
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.
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.
| Framework | CLAUDE.md / Cursor rules | MCP server | llms.txt | AI integration docs |
|---|---|---|---|---|
| Encore | yes (CLAUDE.md, works as Cursor rules) | yes | yes | yes |
| Hono | no | no | yes | no |
| Express | no | no | no | no |
| Fastify | no | no | no | no |
| NestJS | no | no | no | no |
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,
});
| Framework | Run 1 cost (median) | Run 3 cost | Run 3 rubric (out of 36) | Total cost across three runs |
|---|---|---|---|---|
| Encore | $1.96 | $2.58 | 36/36 | $6.29 |
| Hono | $1.55 | not reported | 29/36 | ~$8 |
| Fastify | similar to Encore | $4.60 | 36/36 | ~$10 |
| Express | similar to Encore | not reported | 35/36 | ~$9 |
| NestJS | $2.61 (one $4.45 outlier) | $5.95 | 30/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.
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.
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.
Clone the repo, point it at your own framework or your own editor: github.com/encoredev/ai-backend-benchmark.