Skip to content

A tiny tool for extracting Cursor protobuf definitions. Working with latest Cursor and Cursor Nightly.

Notifications You must be signed in to change notification settings

unkn0wncode/extract-cursor-protos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cursor Protobuf Extractor

This tool extracts Protobuf definitions from the Cursor application.

Some of this project's code is based on the work from everestmz/cursor-rpc, but that repository's extractor doesn't work with the latest versions of Cursor. You can use the extracted proto file with the client found in the linked repository.

Don't wanna bother?

Just download the proto from cursor/aiserver/v1/aiserver.proto

Requirements

Before you begin, ensure you have the following installed:

  • Go (1.21+): Required to run the main extraction script
  • npm: Used to install necessary packages for preprocessing
  • prettier: Used to format the bundled JavaScript for parsing

Install prettier globally if you don't have it:

npm install -g prettier

The script will automatically install the required npm packages upon execution.

Usage

To run the extractor, execute the following command:

go run .

Or specify a custom Cursor path:

go run . /path/to/Cursor.app

Output

The extracted Protobuf files will be generated and placed inside the cursor/aiserver/v1/ directory.

Compatibility

This extractor is compatible with:

  • Latest stable Cursor releases
  • Cursor Nightly builds (2.4.0-pre.14.patch.0)

The tool automatically detects multiple service registries (both aiserver.v1 and agent.v1 namespaces) and merges them.

Troubleshooting

TypeError during extraction

If you see a TypeError: Cannot read properties of undefined, this is usually harmless as long as the proto file is generated successfully. The error comes from Cursor's init code trying to connect.

npm install hangs

The tool has a 5 minute timeout for npm install. If it fails:

  1. Check your network connection
  2. Try running npm cache clean --force
  3. Run the extractor again

No service registry found

If extraction fails with "Could not find any service registries", the Cursor version may have changed its internal structure so please open an issue

prettier not found

Install prettier globally:

npm install -g prettier

About

A tiny tool for extracting Cursor protobuf definitions. Working with latest Cursor and Cursor Nightly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published