Agentforce

wealth-demo: Salesforce + VS Code + Claude setup

A Salesforce DX project wired for Claude Code through the Salesforce DX MCP server. Use a free Developer Edition org or a sandbox, never production. Total time: about 45 to 60 minutes.

1. Install tools

2. Get an org

3. Connect the org

git clone https://github.com/arindambarman/agentforce.git wealth-demo
cd wealth-demo && code .
sf org login web --alias wealthdev --set-default     # browser opens; click Allow
sf project retrieve start --manifest manifest/package.xml
sf data query --query "SELECT Name, AnnualRevenue FROM Account LIMIT 5"

4. Install Claude Code

5. Connect Claude to Salesforce

.mcp.json is already in this repo and limits Claude to the wealthdev org with the orgs,metadata,data,users,testing toolsets. Avoid all, because it floods Claude with tools.

6. Try it

Paste these into Claude one at a time:

  1. “List my authorized orgs.”
  2. “Show my top 5 accounts by annual revenue.”
  3. “Review the Renewal_Case__c metadata in force-app, then deploy it to wealthdev.”
  4. “Create 3 sample Renewal Case records.”
  5. “Write a Flow-invocable Apex class that returns renewals maturing in 120 days, with a test class, and run the tests.”

Or deploy the starter object yourself:

sf project deploy start --source-dir force-app --target-org wealthdev

7. Optional: Salesforce hosted MCP servers

Lets Claude query live business data instead of working on metadata.

  1. Setup, then MCP Servers, then Salesforce Servers tab: activate a server (for example sobject-all).
  2. Setup, then External Client App Manager, then New: enable OAuth.
    • Callback URL: http://localhost:38000/callback (Claude Code) or https://claude.ai/api/mcp/auth_callback (Claude Desktop)
    • Scopes: refresh_token, offline_access, mcp_api
    • Require PKCE and JWT-based access tokens
  3. Add it to Claude Code:
    claude mcp add --transport http salesforce-sobject-all <SERVER_URL> \
      --callback-port 38000 --client-id "<CONSUMER_KEY>" --client-secret
    
  4. Run /mcp, choose Authenticate, and allow access.

Safety checklist

What’s in this repo

| Path | Purpose | |—|—| | .mcp.json | Salesforce DX MCP server config for Claude Code | | CLAUDE.md | Conventions Claude reads automatically | | sfdx-project.json | SFDX project definition (API 65.0; bump if your org is newer) | | manifest/package.xml | What retrieve pulls from the org | | force-app/.../Renewal_Case__c | Starter object: Status (picklist), Request ID (text), Facility (lookup to Account) |