No slash command · from salesforce-claude-code
Provides patterns for building MCP servers for Salesforce Apex and org integration, covering Node/TypeScript SDK, tools, resources, prompts, Zod validation, and transport choice.
Ships in salesforce-claude-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The Model Context Protocol (MCP) lets AI assistants call tools, read resources, and use prompts from your server. Use this skill when building or maintaining MCP servers, or integrating with the official Salesforce MCP server. The SDK API evolves; check Context7 (query-docs for "MCP") or the official MCP documentation for current method names and signatures.
Use when: implementing a new MCP server, adding tools or resources, choosing stdio vs HTTP, integrating with @salesforce/mcp, upgrading the SDK, or debugging MCP registration and transport issues.
registerTool() or tool() depending on SDK version.registerResource() or resource(). Handlers typically receive a uri argument.registerPrompt() or equivalent.The Node/TypeScript SDK may expose tool() / resource() or registerTool() / registerResource(); the official SDK has changed over time. Always verify against the current MCP docs or Context7.
| Transport | Use When | Examples |
|---|---|---|
| stdio | Local client, same machine, Claude Desktop/Code | Development, local testing |
| Streamable HTTP | Remote clients, cloud deployment, multi-user | Cursor, production APIs |
| Legacy HTTP/SSE | Backward compatibility only | Older clients |
Keep server logic (tools + resources) independent of transport so you can plug in stdio or HTTP in the entrypoint.
npm install @modelcontextprotocol/sdk zod
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
// Register a tool
server.tool(
"search-records",
"Search Salesforce records by keyword",
{ query: z.string(), objectType: z.string().default("Account") },
async ({ query, objectType }) => {
// Your implementation here
return { content: [{ type: "text", text: JSON.stringify(results) }] };
}
);
// Connect via stdio
const transport = new StdioServerTransport();
await server.connect(transport);
Note: Registration API varies by SDK version — some versions use positional args
server.tool(name, description, schema, handler), others use object syntax. Check the official MCP docs or Context7 for current@modelcontextprotocol/sdksignatures.
Use Zod (or the SDK's preferred schema format) for input validation.
MCP config is auto-installed by npx scc-universal install (.mcp.json for Claude Code, .cursor/mcp.json for Cursor). The official @salesforce/mcp server provides these toolsets:
| Toolset | What It Does |
|---|---|
orgs | Org management, auth, user info |
metadata | Deploy, retrieve, list metadata types |
data | SOQL queries, record CRUD, bulk operations |
users | User management, permission sets |
testing | Run Apex tests, get coverage results |
code-analysis | PMD/scanner, code quality checks |
lwc-experts | LWC development guidance |
devops | Source tracking, scratch org operations |
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["-y", "@salesforce/mcp@latest"],
"env": {
"SF_ORG_ALIAS": "my-org"
}
}
}
}
When @salesforce/mcp doesn't cover your use case (org-specific business logic, custom validation rules, internal APIs), build a custom MCP server:
import { execFileSync } from "child_process";
server.tool(
"validate-account-hierarchy",
"Check account hierarchy depth and circular references",
{ accountId: z.string().regex(/^[a-zA-Z0-9]{15,18}$/, "Must be a valid 15- or 18-char Salesforce ID") },
async ({ accountId }) => {
const result = execFileSync("sf", [
"data", "query",
"--sobject", "Account",
"--where", `Id='${accountId}'`,
"--fields", "Id,ParentId",
"--json"
], { timeout: 30000, encoding: "utf-8" });
return { content: [{ type: "text", text: result }] };
}
);
execSync/exec calls (e.g., { timeout: 30000 }) and on HTTP requests./^[a-zA-Z0-9]{15,18}$/) before passing to SF CLI.@modelcontextprotocol/sdk (npm). Use Context7 with library name "MCP" for current registration and transport patterns.modelcontextprotocol/go-sdk).@salesforce/mcp (npm) — official Salesforce MCP server.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jiten-singh-shahi/salesforce-claude-code --plugin salesforce-claude-code58 skills in this plugin
/asideUse when you need a quick Salesforce answer mid-task. Answer a side question about Apex, org config, or metadata without losing context, then resume work automatically./checkpointUse when saving Salesforce development progress. Create a named checkpoint via git stash before risky Apex deploys or org changes for easy recovery./configure-sccUse when setting up SCC for Salesforce Apex and LWC development. Interactive wizard to install profiles, modules, and customize the harness for your org./continuous-agent-loopUse when building autonomous Claude Code loops for Salesforce Apex and LWC projects. Patterns from sequential pipelines to RFC-driven multi-agent DAG systems with quality gates. Do NOT use for single-shot Apex tasks./model-routeUse when selecting Claude model tier for Salesforce development tasks. Recommend haiku, sonnet, or opus based on Apex complexity, deploy risk, and budget./prompt-optimizerUse when improving a Salesforce, Apex, or LWC prompt. Analyze intent and gaps, match SCC skills/agents, output a ready-to-paste optimized prompt. Advisory only.Other plugins' skills for the same job