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

@otto-assistant/opencode-cursor-oauth

v0.1.28

Published

OpenCode plugin that connects Cursor's API to OpenCode via OAuth, model discovery, and a local OpenAI-compatible proxy.

Readme

@otto-assistant/opencode-cursor-oauth

license: MIT

High-quality OpenCode provider plugin that brings Cursor models into OpenCode through OAuth, model discovery, and a local OpenAI-compatible proxy.

Designed for real-world agent usage: streaming, tool calls, long conversations, and robust continuation behavior.

Highlights

  • OAuth login with automatic token refresh
  • Cursor model discovery directly from API
  • OpenAI-compatible /v1/chat/completions proxy for OpenCode runtime compatibility
  • Stable streaming with tool-calling continuation
  • MCP-first tool execution flow for practical agent environments
  • Conversation-state handling built for long and tool-heavy sessions
  • Production-ready smoke test coverage

Why teams use it

  • Native feel in OpenCode: Cursor models are exposed as a regular provider flow in OpenCode.
  • Reliable tool loops: Tool call handoff and continuation are engineered for iterative agent workflows.
  • Operationally practical: Focused on reducing common runtime failure modes around streaming, tool calls, and conversation state.
  • Simple integration surface: Works with standard OpenCode plugin configuration and auth flow.

Installation

Option A: Install from npm (recommended)

npm install -g @otto-assistant/opencode-cursor-oauth

Then add this to ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "@otto-assistant/opencode-cursor-oauth"
  ],
  "provider": {
    "cursor": {
      "name": "Cursor"
    }
  }
}

Option B: Install from repository source

git clone https://github.com/otto-assistant/opencode-cursor.git
cd opencode-cursor
bun install
bun run build
npm install -g .

Use the same OpenCode config shown above.

Authentication

opencode auth login --provider cursor

This opens Cursor OAuth in your browser. Tokens are stored in ~/.local/share/opencode/auth.json and refreshed automatically.

Quick usage

  1. Start OpenCode.
  2. Select provider cursor.
  3. Choose a Cursor model.
  4. Send prompts as usual; the plugin starts the local proxy on demand.

Architecture

OpenCode
  -> /v1/chat/completions
  -> Bun.serve proxy
  -> Node HTTP/2 bridge (h2-bridge.mjs)
  -> Cursor gRPC API (api2.cursor.sh)

Tool-call lifecycle

1) Model receives tool definitions via request context
2) Model emits tool call
3) Proxy maps tool call into OpenCode-compatible stream events
4) OpenCode executes tool
5) Tool result is sent back
6) Proxy resumes Cursor stream continuation

Development

bun install
bun run build
bun run test

Compatibility

  • OpenCode plugin runtime
  • Bun runtime
  • Node.js >= 18 (HTTP/2 bridge process)
  • Active Cursor subscription

Performance and reliability notes

  • Conversation state is managed to support continuation across multi-turn tool usage.
  • Streaming and bridge lifecycle handling are designed to minimize stuck sessions.
  • Tool execution path is optimized for MCP-based environments.

FAQ

Do I need to clone the repository to use this plugin?

Usually no. OpenCode can install npm plugins automatically when configured.

Is this package published on npm?

This repository publishes under @otto-assistant/opencode-cursor-oauth. If npm install fails, verify that the latest GitHub release workflow completed successfully.

Where is the license?

This project is released under the MIT license (declared in package metadata).

License

MIT