{"id":817,"date":"2026-04-30T12:40:37","date_gmt":"2026-04-30T04:40:37","guid":{"rendered":"https:\/\/connectword.dpdns.org\/?p=817"},"modified":"2026-04-30T12:40:37","modified_gmt":"2026-04-30T04:40:37","slug":"cursor-introduces-a-typescript-sdk-for-building-programmatic-coding-agents-with-sandboxed-cloud-vms-subagents-hooks-and-token-based-pricing","status":"publish","type":"post","link":"https:\/\/connectword.dpdns.org\/?p=817","title":{"rendered":"Cursor Introduces a TypeScript SDK for Building Programmatic Coding Agents With Sandboxed Cloud VMs, Subagents, Hooks, and Token-Based Pricing"},"content":{"rendered":"<p>Cursor, the AI-powered code editor, is opening up the core technology behind its coding agents to developers everywhere. The Cursor team announced the public beta of the <strong>Cursor SDK<\/strong> \u2014 a TypeScript library that gives engineers programmatic access to the same runtime, harness, and models that power Cursor\u2019s desktop app, CLI, and web interface.<\/p>\n<p>This signals a meaningful shift in how AI coding tools are being positioned: not just as interactive assistants sitting alongside a developer, but as deployable infrastructure that organizations can wire into their existing systems.<\/p>\n<h3 class=\"wp-block-heading\"><strong>From Interactive Tool to Programmable Infrastructure<\/strong><\/h3>\n<p>If you\u2019ve used Cursor before, you know it as an IDE where you interact with an agent in real time \u2014 asking it to write functions, fix bugs, or explain code. The Cursor SDK changes the access model. Instead of a developer sitting at a keyboard, the agent can now be invoked programmatically: from a CI\/CD pipeline trigger, a backend service, or embedded directly inside another product.<\/p>\n<p>Think of it this way: previously, you had to be \u201cin\u201d Cursor to use its agents. Now, you can call those same agents from anywhere in your stack with a few lines of TypeScript.<\/p>\n<p><strong>Getting started is a single command:<\/strong><\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">npm install @cursor\/sdk<\/code><\/pre>\n<\/div>\n<\/div>\n<p>From there, you create an <code>Agent<\/code> instance, send it a task, and stream the response back \u2014 all in TypeScript. Here\u2019s the minimal example from Cursor\u2019s announcement:<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">import { Agent } from \"@cursor\/sdk\";\n\nconst agent = await Agent.create({\n  apiKey: process.env.CURSOR_API_KEY!,\n  model: { id: \"composer-2\" },\n  local: { cwd: process.cwd() },\n});\n\nconst run = await agent.send(\"Summarize what this repository does\");\n\nfor await (const event of run.stream()) {\n  console.log(event);\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<p>The <code>Agent.create()<\/code> call accepts an <code>apiKey<\/code>, a <code>model<\/code> field (where you specify which model to run), and either a <code>local<\/code> or <code>cloud<\/code> configuration depending on where you want execution to happen.<\/p>\n<h3 class=\"wp-block-heading\"><strong>Why Building Your Own Agent Stack is Hard<\/strong><\/h3>\n<p>Before diving into what the SDK offers, it\u2019s worth understanding the problem it solves. Building fast, reliable, and capable coding agents that run safely against your data requires meaningful engineering effort: secure sandboxing, durable state and session management, environment setup, and context management. And when a new model ships, dev teams often have to rework their agent loops entirely just to take advantage of it. The Cursor SDK eliminates this complexity so teams can focus on building useful agents instead of maintaining the underlying infrastructure.<\/p>\n<figure class=\"wp-block-video aligncenter\"><video height=\"1080\" width=\"1920\" controls src=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/04\/QxSyhJ1ZPxPlvUt8-1.mp4\" preload=\"none\"><\/video><figcaption class=\"wp-element-caption\">https:\/\/cursor.com\/blog\/typescript-sdk<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\"><strong>The Agent Harness: What \u201cSame Runtime\u201d Actually Means<\/strong><\/h3>\n<p>SDK agents use the same harness that powers Cursor\u2019s own products. \u2018Harness\u2019 here refers to the full set of supporting infrastructure that makes an agent effective beyond just the LLM call itself. In Cursor\u2019s case,<strong> that includes:<\/strong><\/p>\n<p><strong>Intelligent context management<\/strong> \u2014 Codebase indexing, semantic search, and instant grep so agents retrieve the right code context before generating responses. This is critical because LLMs are only as good as the context they receive; poor retrieval leads to hallucinated or irrelevant outputs.<\/p>\n<p><strong>MCP servers<\/strong> \u2014 Agents launched through the SDK can connect to external tools and data sources over <code>stdio<\/code> or HTTP, either via a <code>.cursor\/mcp.json<\/code> config file or passed inline in the API call. MCP (Model Context Protocol) is an open standard for wiring tools into agent runtimes.<\/p>\n<p><strong>Skills<\/strong> \u2014 Agents automatically pick up reusable behavior definitions from a <code>.cursor\/skills\/<\/code> directory in the repository.<\/p>\n<p><strong>Hooks<\/strong> \u2014 A <code>.cursor\/hooks.json<\/code> file lets you observe, control, and extend the agent loop across cloud, self-hosted, and local runtimes \u2014 useful for logging, guardrails, or custom orchestration.<\/p>\n<p><strong>Subagents<\/strong> \u2014 The main agent can delegate subtasks to named subagents with their own prompts and models via the <code>Agent<\/code> tool, enabling multi-agent workflows without custom orchestration code.<\/p>\n<h3 class=\"wp-block-heading\"><strong>Cloud Deployment: Persistent, Sandboxed, and Resumable<\/strong><\/h3>\n<p>One of the more practical features of the SDK is cloud execution. When configured to run in Cursor\u2019s cloud, each agent gets its own dedicated VM with strong sandboxing, a clone of the target repository, and a fully configured development environment. Critically, the agent keeps running even if the initiating machine goes offline \u2014 the developer can reconnect and stream the conversation later.<\/p>\n<p>Cloud agents integrate with Cursor\u2019s existing Agents Window and web app, so a task started programmatically via the SDK can be inspected or taken over manually inside the Cursor interface. When the agent finishes, it can open a PR, push a branch, or attach demos and screenshots \u2014 making them suitable for asynchronous, unattended workflows:<\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">const agent = await Agent.create({\n  apiKey: process.env.CURSOR_API_KEY!,\n  model: { id: \"gpt-5.5\" },\n  cloud: {\n    repos: [{ url: \"https:\/\/github.com\/cursor\/cookbook\", startingRef: \"main\" }],\n    autoCreatePR: true,\n  },\n});\n\nconst run = await agent.send(\"Fix the auth token expiry bug\");\nconsole.log(`Started ${run.id}`);\n\n\/\/ ...check back in later, from anywhere:\nconst result = await (\n  await Agent.getRun(run.id, { runtime: \"cloud\", agentId: run.agentId })\n).wait();\nconsole.log(result.git?.branches[0]?.prUrl);\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p>For dev teams with security requirements, the SDK also supports self-hosted workers, where both code and tool execution remain inside the organization\u2019s own network.<\/p>\n<h3 class=\"wp-block-heading\"><strong>Model Flexibility and Composer 2<\/strong><\/h3>\n<p>The SDK exposes every model supported in Cursor. Switching models is a single field change in the <code>model<\/code> parameter, letting teams route tasks to the best model for a given combination of cost and capability. Cursor\u2019s own <strong>Composer 2<\/strong> \u2014 described as a specialized coding model achieving frontier-level performance at a fraction of the cost of general-purpose models \u2014 is positioned as the default recommendation for most coding agent tasks.<\/p>\n<h3 class=\"wp-block-heading\"><strong>Getting Started<\/strong><\/h3>\n<p>To accelerate adoption, Cursor has published a public <a href=\"https:\/\/github.com\/cursor\/cookbook\">cookbook repository<\/a> on GitHub with four starter projects: a minimal quickstart (a Node.js example that creates a local agent, sends one prompt, and streams the response), a web-based prototyping tool for scaffolding new projects in a sandboxed cloud environment, an agent-powered kanban board that automatically opens PRs when engineers drag a card, and a lightweight coding agent CLI for spawning Cursor agents from the terminal.<\/p>\n<p>Cursor has also released a <strong>Cursor SDK plugin<\/strong> in the Cursor Marketplace to help developers start building directly from within the editor.<\/p>\n<h3 class=\"wp-block-heading\"><strong>Key Takeaways<\/strong><\/h3>\n<ul class=\"wp-block-list\">\n<li><strong>Cursor SDK is now in public beta<\/strong> \u2014 Cursor has released a TypeScript SDK (<code>npm install @cursor\/sdk<\/code>) that gives developers programmatic access to the same runtime, harness, and models that power the Cursor desktop app, CLI, and web interface.<\/li>\n<li><strong>Eliminates the hard parts of building coding agents<\/strong> \u2014 Teams no longer need to engineer secure sandboxing, durable state and session management, environment setup, and context management from scratch \u2014 and won\u2019t need to rework agent loops every time a new model ships.<\/li>\n<li><strong>Runs locally or on Cursor\u2019s cloud<\/strong> \u2014 Agents can execute on a developer\u2019s local machine for fast iteration, on Cursor\u2019s cloud against a dedicated VM with strong sandboxing, or on self-hosted workers for teams with strict network security requirements.<\/li>\n<li><strong>Full harness included out of the box<\/strong> \u2014 SDK agents inherit Cursor\u2019s complete infrastructure: intelligent context management (codebase indexing, semantic search, instant grep), MCP server support, Skills, Hooks, and Subagents \u2014 the same stack powering Cursor\u2019s own products.<\/li>\n<\/ul>\n<hr class=\"wp-block-separator aligncenter has-alpha-channel-opacity is-style-wide\" \/>\n<p>Check out\u00a0the\u00a0<strong><a href=\"https:\/\/github.com\/cursor\/cookbook\" target=\"_blank\" rel=\"noreferrer noopener\">Cookbook<\/a>\u00a0<\/strong>and<strong>\u00a0<a href=\"https:\/\/cursor.com\/blog\/typescript-sdk\" target=\"_blank\" rel=\"noreferrer noopener\">Technical details<\/a><\/strong>.<strong>\u00a0<\/strong>Also,\u00a0feel free to follow us on\u00a0<strong><a href=\"https:\/\/x.com\/intent\/follow?screen_name=marktechpost\" target=\"_blank\" rel=\"noreferrer noopener\"><mark>Twitter<\/mark><\/a><\/strong>\u00a0and don\u2019t forget to join our\u00a0<strong><a href=\"https:\/\/www.reddit.com\/r\/machinelearningnews\/\" target=\"_blank\" rel=\"noreferrer noopener\">130k+ ML SubReddit<\/a><\/strong>\u00a0and Subscribe to\u00a0<strong><a href=\"https:\/\/www.aidevsignals.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">our Newsletter<\/a><\/strong>. Wait! are you on telegram?\u00a0<strong><a href=\"https:\/\/t.me\/machinelearningresearchnews\" target=\"_blank\" rel=\"noreferrer noopener\">now you can join us on telegram as well.<\/a><\/strong><\/p>\n<p>Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?\u00a0<strong><a href=\"https:\/\/forms.gle\/MTNLpmJtsFA3VRVd9\" target=\"_blank\" rel=\"noreferrer noopener\"><mark>Connect with us<\/mark><\/a><\/strong><\/p>\n<p>The post <a href=\"https:\/\/www.marktechpost.com\/2026\/04\/29\/cursor-introduces-a-typescript-sdk-for-building-programmatic-coding-agents-with-sandboxed-cloud-vms-subagents-hooks-and-token-based-pricing\/\">Cursor Introduces a TypeScript SDK for Building Programmatic Coding Agents With Sandboxed Cloud VMs, Subagents, Hooks, and Token-Based Pricing<\/a> appeared first on <a href=\"https:\/\/www.marktechpost.com\/\">MarkTechPost<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Cursor, the AI-powered code ed&hellip;<\/p>\n","protected":false},"author":1,"featured_media":818,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=817"}],"version-history":[{"count":0,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/817\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/media\/818"}],"wp:attachment":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}