Cursor
Put change-aware CI validation in Cursor's project rules.
DiffCI can be exposed through a generated Cursor rule, a shell command, or a native MCP tool while required repository checks remain authoritative.
npx "@diffci.com/diffci@latest" init
npx "@diffci.com/diffci@latest" verify --changed --jsonGenerate the project rule
init writes .cursor/rules/diffci.mdc. The rule tells Cursor when to run DiffCI, how to handle REFUSED or ERROR, and why a selected command cannot replace required CI.
Review the generated file with the rest of the repository policy. Existing Cursor rules are preserved unless replacement is explicitly requested.
Connect the MCP server
{
"mcpServers": {
"diffci": {
"command": "npx",
"args": ["-p", "@diffci.com/diffci@latest", "diffci-mcp"],
"cwd": "/path/to/repository"
}
}
}Cursor can then call diffci_verify, diffci_verify_changed, diffci_check, diffci_init, and diffci_verify_workflow. Continue only when the verification receipt reports safe_to_continue: true.
Pick the safe mode
Use check when paired execution is desired and repository scripts may run. Use observe --no-send when Cursor should analyze the diff without executing tests. In both modes, nothing is sent without explicit hosted configuration.
If the MCP server does not appear, verify the configured working directory and run the command directly once to expose package-installation or Node-version errors.
Verify the Cursor setup
- Confirm
.cursor/rules/diffci.mdcis enabled for the repository and that its scope includes the files Cursor is changing. - For local MCP, verify the configured
cwdis the repository root before callingdiffci_verify_changed. - Run a direct command once to distinguish rule-discovery problems from Node, package-installation, or Git-history problems.