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.
Just download the proto from cursor/aiserver/v1/aiserver.proto
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 prettierThe script will automatically install the required npm packages upon execution.
To run the extractor, execute the following command:
go run .Or specify a custom Cursor path:
go run . /path/to/Cursor.appThe extracted Protobuf files will be generated and placed inside the cursor/aiserver/v1/ directory.
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.
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.
The tool has a 5 minute timeout for npm install. If it fails:
- Check your network connection
- Try running
npm cache clean --force - Run the extractor again
If extraction fails with "Could not find any service registries", the Cursor version may have changed its internal structure so please open an issue
Install prettier globally:
npm install -g prettier