npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-cursor-sdk

v0.0.1

Published

OpenCode AI SDK provider backed by the Cursor TypeScript SDK

Downloads

152

Readme

opencode-cursor-sdk

An OpenCode V2 provider backed by the official @cursor/sdk TypeScript SDK. No local HTTP proxy is involved.

Cursor's SDK is an agent runtime, not a raw chat-completions API. OpenCode keeps its own agent loop and tools. In OpenCode V2 configuration, the aisdk: prefix selects OpenCode's AI SDK provider loader; this package supplies the provider factory loaded by that mechanism. Cursor's built-in filesystem and shell tools are disabled. OpenCode tools are registered as Cursor custom tools and held until OpenCode executes them.

Architecture

The package root exports both the AI SDK provider factory and the V2 server plugin:

providers.cursor.package = "aisdk:opencode-cursor-sdk"
plugins = ["opencode-cursor-sdk"]
          │
          ├─ V2 integration transform: /connect credentials
          ├─ V2 provider transform: Cursor.models.list() inventory
          └─ createCursor() → in-process OpenAI-compatible fetch

The provider factory keeps the existing Cursor agent and tool bridge. The plugin uses V2 Plugin.define, integration.transform, and provider.transform; it refreshes the catalog after credential changes.

Setup

Requires OpenCode V2 and Node.js >= 26.

Add the following to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "cursor": {
      "name": "Cursor",
      "package": "aisdk:opencode-cursor-sdk"
    }
  },
  "plugins": ["opencode-cursor-sdk"]
}

The aisdk: prefix tells OpenCode to load this package as an AI SDK provider factory. OpenCode calls the exported createCursor() factory and passes the resolved provider settings and credential to it. The plugin is loaded from the package's default export. OpenCode resolves both package names through its package loader.

To load a local checkout directly, use file:// URLs for both entries:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "cursor": {
      "name": "Cursor",
      "package": "aisdk:file:///absolute/path/to/opencode-cursor-sdk"
    }
  },
  "plugins": ["file:///absolute/path/to/opencode-cursor-sdk"]
}

Run /connect, select Cursor, and either log in through the browser or paste a key from Cursor Dashboard → API Keys. OpenCode stores the credential as a V2 integration credential and injects it at request time. CURSOR_API_KEY is also supported for discovery and requests.

SDK usage is billed to your Cursor plan.

Options

The plugin sets the Cursor agent working directory to the current OpenCode project directory. Do not write credentials into opencode.json.

| Option | Required | Meaning | | --- | --- | --- | | apiKey | yes | Cursor user or service-account key, supplied by the V2 integration | | cwd | automatic | Current OpenCode project directory |

Model discovery

The plugin publishes every model returned by Cursor.models.list() to the V2 provider registry.

  • The provider exposes the live catalog returned by Cursor.models.list().
  • If Cursor returns no models, the provider remains available with an empty model catalog.
  • Configured model entries remain as overlays and win on ID collisions.
  • Cursor variants become OpenCode model variants, including Fast and Max Mode.
  • Credential updates trigger a refresh.

Without the plugin, list models under providers.cursor.models yourself and configure a V2 integration credential for cursor.

Scope

  • This is not the ACP cursor-agent package.
  • This is not a nested Cursor coding agent or Cursor Cloud Agent integration.
  • OpenCode remains responsible for files, shells, edits, and the agent loop.