DiffCI

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" check

Generate 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_check, diffci_init, and diffci_verify_workflow. diffci_check may run the inferred full and selected commands just like the CLI.

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.mdc is enabled for the repository and that its scope includes the files Cursor is changing.
  • For local MCP, verify the configured cwd is the repository root before calling diffci_check.
  • Run a direct command once to distinguish rule-discovery problems from Node, package-installation, or Git-history problems.