Registry / ai-ml / pi-cursor-provider

pi-cursor-provider

JSON →
library0.1.11jsnpmunverified

Pi extension that authenticates with Cursor via PKCE OAuth and runs a local gRPC proxy translating OpenAI /v1/chat/completions to Cursor's protobuf/HTTP2 Connect protocol. Version 0.1.11, active development. Key differentiators: model deduplication by effort level, session management for multi-turn conversations, tool routing via MCP, and an architecture that lets Pi use Cursor's models without a direct Cursor IDE dependency.

npm install pi-cursor-provider
INSTALL
IMPORT
SIG · PI-CURSOR-PROVIDER
P
pi-cursor-provider
ai-mljavascriptv0.1.11
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PiCursorProvider (extension)
// Install via pi: pi install npm:pi-cursor-provider
import PiCursorProvider from 'pi-cursor-provider'
This is a Pi extension, not a regular npm module. It is loaded by the Pi runtime via the install command. Direct import is not supported.
CursorProvider
import { CursorProvider } from 'pi-cursor-provider';
const CursorProvider = require('pi-cursor-provider').CursorProvider;
Package ships as ESM only (type: module in package.json). Named export for programmatic use within Pi extensions.
type Models
import type { Models } from 'pi-cursor-provider';
TypeScript types exported for model mapping; use import type to avoid runtime inclusion.

Install the pi-cursor-provider extension, authenticate with Cursor via OAuth, select a model, and optionally configure reasoning effort. Shows CLI commands for setup.

// Install the extension pi install npm:pi-cursor-provider // Authenticate with Cursor /login cursor // List and select a model /model // Set reasoning effort (optional) set reasoning_effort high // Environment variable to see raw model IDs PI_CURSOR_RAW_MODELS=1 pi
Debug
Known issues
gotchaModel deduplication collapses similar models by effort level; raw model variants are hidden unless PI_CURSOR_RAW_MODELS=1 is set.
fix
Set PI_CURSOR_RAW_MODELS=1 environment variable to disable dedup and see all raw Cursor model IDs.
affects: >=0.1.0
gotchaExtension requires Node.js >= 18 and depends on peer packages @mariozechner/pi-ai and @mariozechner/pi-coding-agent.
fix
Ensure these peer dependencies are installed in the Pi environment. Run 'pi install' which resolves them.
affects: >=0.1.0
breakingOAuth token management may change across versions; session persistence not guaranteed across Pi restarts.
fix
Re-run /login cursor after restarting Pi. Tokens are stored in local state but may be invalidated.
affects: >=0.1.0
gotchaNot all Cursor models support reasoning effort mapping; models without effort suffixes are left as-is with supportsReasoningEffort: false.
fix
Check the model list output by /model to see which models support reasoning effort. Use raw mode if effort mapping is unwanted.
affects: >=0.1.0
deprecatedThe proxy uses experimental HTTP/2 Connect protocol via h2-bridge.mjs; may not work in all network environments.
fix
Ensure your network allows HTTP/2 connections. Consider using a VPN if behind a restrictive firewall.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module '@mariozechner/pi-ai'
Missing peer dependency when installing via npm directly instead of 'pi install'.
fix
Install via pi: pi install npm:pi-cursor-provider, or manually add @mariozechner/pi-ai and @mariozechner/pi-coding-agent as dependencies.
TypeError: Cannot read properties of undefined (reading 'prototype')
Using CommonJS require() on an ESM-only package.
fix
Use import syntax or ensure your project is ESM (type: 'module' in package.json).
Error: ERR_REQUIRE_ESM
Trying to require() an ES module.
fix
Convert to dynamic import: const { CursorProvider } = await import('pi-cursor-provider');
Error: listen EADDRINUSE :::<port>
Default proxy port already in use (another instance running).
fix
Kill the existing process or set a custom port via environment variable (e.g., PI_CURSOR_PROXY_PORT=8080).
OAuth2Error: invalid_grant
OAuth token expired or revoked by Cursor.
fix
Re-run /login cursor to authenticate again.
Upgrade
Version history
0.1.11latest on npm
Audit
Dependencies
@mariozechner/pi-aioptionalPeer dependency for Pi AI integration
@mariozechner/pi-coding-agentoptionalPeer dependency for Pi coding agent integration
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
pi-cursor-provider — npm install pi-cursor-provider · libregistry