fitchmultz/pi-cursor-sdk

Run Cursor's agent loop inside the pi coding agent via local Cursor SDK agents, with native model selection, thinking controls, fast/plan modes, image input, and MCP-bridged pi tools.

What it solves

pi-cursor-sdk allows users of the pi agent runtime to use Cursor models while preserving Cursor's native SDK agent loop. It avoids the need for OpenAI-compatible proxies, which often translate Cursor's behavior into a generic format, instead providing a native integration that supports Cursor's specific features like thinking controls, session behavior, and local agent tools.

How it works

The extension integrates the @cursor/sdk into pi. It defaults to a local-by-default runtime but allows for explicit opt-in to Cursor Cloud. It manages model discovery, authentication via API keys, and maps pi's native controls (like thinking levels) to Cursor SDK parameters (such as reasoning or effort). It also implements a caching system for the model catalog to speed up startups and a per-session SQLite store to handle agent resume and state management.

Who it’s for

Developers and pi users who want first-class access to Cursor models and their agentic capabilities (including local SDK tools and MCP) directly within the pi ecosystem.

Highlights

  • Native Cursor Integration: Preserves the Cursor SDK agent loop rather than using an OpenAI-shaped adapter.
  • Thinking Controls: Maps pi thinking levels (medium, xhigh, max) to Cursor SDK parameters.
  • Flexible Runtime: Local-by-default execution with explicit opt-in for Cursor Cloud.
  • Session Management: Supports branch-scoped local resume to reattach to recorded local SDK agents after a pi restart.
  • Fast Mode: Provides a persistent toggle (/cursor-fast) and virtual model aliases (e.g., :fast, :slow) for models supporting Cursor's fast parameter.
  • Mode Switching: Supports switching between agent and plan modes via CLI flags or slash commands.

Related

  • Project
  • Project
  • Project
  • Project