SFDC
+
C

Salesforce + Cursor · Apex and LWC for delivery teams

Describe a story. Cursor drafts the Apex and the LWC for your org.

A user story goes in. Tested, deployable Apex + LWC comes out. You review one PR.

Exactly what the agent does

1

Reads the story

Jira CRM-3421

2

Reads your org

SOQL + metadata

3

Writes Apex + LWC

8 files

4

Writes the tests

94% coverage

5

Validates deploy

UAT · RunSpecifiedTests

6

Opens the PR

you review + deploy

~18 minutes unattended vs ~6 hours by hand. Every primitive is a real file in .cursor/.

Built against your real org

It reads your schema and trigger framework over the DX MCP before writing a line. No guessed field names.

Zero click-through

SOQL, metadata, deploys, and test runs happen over MCP. You never hunt Setup or paste failing logs into chat.

You own production

The agent stops at a validated UAT deploy and a PR. A human runs the Quick Deploy.

Guardrails every build clears

Grounded in real metadata via MCP·Bulkified, governor-limit safe, CRUD/FLS enforced·Apex tests over the 75% gate before deploy·Validated to UAT, never production·Cursor never self-merges

Consultant workflow · before and after

Where your consultants use Cursor

Same Salesforce story, same human approval. Cursor compresses the manual click-through into one grounded, reviewable delivery pack.

1

Stage

Refine

Jira + Confluence + Setup

Re-read the story, hunt objects and field names, rewrite it as a technical spec.

30m · 2 handoffs

Cursor intake + rules

The story becomes a constrained build plan under your Apex standards.

2m agent workYou validate the requirement.
2

Stage

Org discovery

Setup, Schema Builder, VS Code

Copy field API names, SOQL the data, trace the existing trigger and automations.

50m · 4 handoffs

DX MCP evidence

SOQL + metadata come straight from the org over MCP. Zero click-through.

3m agent workYou inspect what it read.
3

Stage

Build

VS Code + LWC + Apex tests

Write the handler, service, LWC, and a test class with a bulk run to clear 75%.

200m · 5 handoffs

Apex + LWC subagents

Specialists write 8 files in parallel, tests included, coverage at 94%.

8m agent workYou review architecture, not boilerplate.
4

Stage

Review

Code Analyzer, Apex tests, GitHub

Run Code Analyzer, copy failing logs back and forth, fix formatting, collect evidence.

30m · 2 handoffs

Hooks + Codex gate

Hooks format and scan; Codex checks bulkification, CRUD/FLS, and coverage.

2m agent workYou decide if it clears your standard.
5

Stage

Client handoff

Change sets / DevOps Center, GitHub, Jira

Assemble the change set, validate against UAT, write the PR, update the story.

45m · 3 handoffs

PR + deploy pack

PR, validated UAT deploy, test results, and the story linked into one pack.

3m agent workYou approve and run the prod deploy.
No more click-through

The loop between the Salesforce IDE and Cursor, closed

Today you click through Setup to find field API names, copy Apex into an assistant, paste the suggestion back, deploy a change set, run Code Analyzer, and copy the failing test log back again. Each Cursor primitive replaces one manual round-trip, wired with real files you can read in .cursor/.

MCP

Manual round-trip

Hunt field names in Setup, paste Apex through chat, click change sets.

With Cursor

SOQL, metadata, deploys, and test runs happen directly over the DX MCP.

Rules

Manual round-trip

Re-explain bulkification, sharing, and the 75% rule in every chat.

With Cursor

.cursor/rules inject your standards every session, version-controlled.

Hooks

Manual round-trip

Hand-format, run Code Analyzer, paste red test output back.

With Cursor

Hooks format, scan, and re-run tests; failures bounce back to the agent.

Subagents

Manual round-trip

Carry context between separate chats for Apex, LWC, and deploy work.

With Cursor

A planner runs Apex, LWC, deploy, and review specialists in parallel.

Cloud agents

Manual round-trip

Babysit the edit-deploy-test-PR loop at your desk.

With Cursor

A cloud VM runs the whole loop unattended and hands you a verified PR.

Straight talk

  • ·The Salesforce DX MCP server (@salesforce/mcp) is published by Salesforce and wraps the Salesforce CLI. Cursor speaks to it over the open MCP standard; Cursor itself ships no native Salesforce connector.
  • ·Cloud agents run only a subset of command-based hooks. The MCP-write gate and the self-repair stop loop run on your local IDE agent; the cloud agent uses afterFileEdit / beforeShellExecution plus the verified-PR handoff.
  • ·For cloud runs, the MCP is configured at cursor.com/agents and the agent authenticates to your sandboxes with sfdx auth URLs held as secrets.

Reference config: docs/partner-demos/salesforce-cursor-config/

Beyond the headline build

What Salesforce delivery teams ship with Cursor

The scripted demo is one motion. Here is the rest of what your team does with Cursor across a client implementation.

Build + deploy

Ship Apex and an LWC from a user story

Story in; bulkified Apex, the LWC, tests over 75%, and a validated deploy out. You review one PR.

Salesforce DX MCPComposer editsGitHub PR

Faster delivery

Clear the 75% coverage gate without hand-writing tests

The agent writes the test class, real asserts plus a 200-record bulk run, and runs it over MCP. The chore everyone dreads, gone.

Apex testsrun_apex_teststop hook self-repair

Grounded agents

Agents that read your org, not guess at it

SOQL and metadata come over the DX MCP, so generated code targets your actual schema and automations.

SOQL + Metadata APITooling APIDX MCP

Migrate

Migrate Workflow Rules and Process Builder to Flow

The agent maps an inherited org, converts legacy automation to Flow, and refactors triggers into a handler framework.

explore subagentLong-context OpusCloud Agents

Integrate

Wire integrations against the real contract

Apex callouts, named credentials, and platform events built from the actual WSDL/OpenAPI and org metadata.

Apex calloutsExternal ServicesMCP

Reusable accelerator

Your delivery standards, repeatable across clients

The MCP wiring, rules, deploy gates, and subagent roles become a kit every new engagement inherits on day one.

SkillsRulesSubagents
How this is wired

One agent · 1 Salesforce MCP · 4 subagents · 4 hooks · 2 rules · 3 model classes

Every primitive below is a concrete file your team commits. The skills, subagents, and rules are real in .cursor/; the runtime config lives in docs/partner-demos/salesforce-cursor-config/.

Architecture

3 trigger surfaces

Jira story · Slack /build · DevOps Center work item

Cursor cloud agent

environment.json · Salesforce CLI · sandbox auth

1 MCP · 4 subagents · 4 hooks

planner + Apex/LWC/deploy/review, each scoped

salesforce-build

Turn a plain-English user story into a bulkified Apex check + an LWC warning + an Apex test class over 75% + a validated deployment + a PR, in one orchestrated run.

salesforce-build-planneropus

apex-engineer

Composer 2.5

lwc-engineer

Composer 2.5

deployment-steward

Composer 2.5

apex-reviewer

Codex

  • salesforce-build-plannerplannerClaude Opus

    Ground the story in the real org, fix the contract, dispatch specialists, synthesize a deploy-ready change set, open the PR. Never writes code itself.

    .cursor/skills/salesforce-build-planner/SKILL.md

  • salesforce-apex-engineerspecialistComposer 2.5

    Write the bulkified Apex (trigger handler, service, Apex tests to clear the 75% gate) against the real SObject metadata through the DX MCP. Never click through Setup.

    .cursor/agents/salesforce-apex-engineer.md

  • salesforce-lwc-engineerspecialistComposer 2.5

    Write the Lightning Web Component bound to the cacheable Apex method, with a Jest test. Keep it accessible and on the record page.

    .cursor/agents/salesforce-lwc-engineer.md

  • salesforce-deployment-stewardspecialistComposer 2.5

    Capture every component into one validated deployment, run the right test level, stage to the UAT sandbox. Never deploy to production.

    .cursor/agents/salesforce-deployment-steward.md

  • apex-reviewerreviewerCodexread-only

    Review bulkification, governor limits, CRUD/FLS, sharing, and 75% test coverage before deploy. Blocks; does not patch.

    .cursor/agents/apex-reviewer.md

Scripted, deterministic demo

See the whole build, from user story to PR.

Story in, grounded Apex + LWC + tests at 94%, a validated UAT deploy, and a PR out. ~18 minutes, unattended.

Run the scripted demo