Salesforce MCP Server
Provides tools for interacting with Salesforce CRM, including record CRUD operations (create, read, update, delete with permission controls), SOQL/SOSL queries, metadata extraction (Flows, Apex, Validation Rules, etc.), Tooling API access, and sandbox management (create, list).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Salesforce MCP Server show me the 5 most recently created leads"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Salesforce MCP Server
Salesforce CRM과 Claude를 연결하는 MCP 서버. 레코드 CRUD, SOQL/SOSL, Tooling API, Flow/Apex 메타데이터 추출, Sandbox 관리까지 지원합니다.
특징
🔐 SF CLI 기반 자동 토큰 갱신 — 한 번 로그인하면 토큰 만료 걱정 없음
🧰 클론/빌드 불필요 —
npx한 줄로 실행🛡️ 안전한 권한 모드 — 삭제 금지 / 읽기 전용
🧪 Prod / Sandbox 분리 접속 — 동일 MCP 서버로 두 org를 별도 등록
빠른 시작 (팀원 온보딩, 5분)
1. 필수 도구 설치
brew install node sf
npm install -g @anthropic-ai/claude-code이미 설치돼 있으면 건너뛰세요. (
node -v,sf --version,claude --version으로 확인)
2. Salesforce 로그인
sf org login web --instance-url https://channel-b.my.salesforce.com브라우저에서 @channel.io 계정으로 로그인. Successfully authorized ... 뜨면 완료.
3. MCP 등록 (한 줄 — 본인 이메일만 교체)
claude mcp add -s user salesforce -e SALESFORCE_SF_CLI_USERNAME=본인이메일@channel.io -e PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin -e SALESFORCE_NO_DELETE=true -- npx -y github:sunny980123/Salesforce-MCP-Server⚠️ 대괄호 금지.
SALESFORCE_SF_CLI_USERNAME=east@channel.io처럼 값만.
4. 확인
claude mcp list
# → salesforce: ... - ✓ ConnectedClaude Code에서 "Salesforce에서 최근 생성된 리드 5개 보여줘" 요청으로 테스트해보세요.
Related MCP server: Salesforce MCP Server
인증 & 환경변수
SF CLI의 refresh token을 재사용합니다. Security Token, Connected App, JWT 키 전부 불필요.
변수 | 필수 | 설명 |
| ✅ | SF CLI에 로그인된 이메일 (예: |
| ✅ |
|
| ➖ |
|
| ➖ |
|
PATH를 빠뜨리면 MCP 서버가sf를 못 찾아 조용히 실패합니다.
권한 모드
팀원 공유 시 아래 2가지 모드 중 하나를 사용하세요. 레코드 삭제 및 메타데이터 배포는 이 서버를 통해 일반 사용자에게 제공되지 않습니다.
모드 | 설정 | 조회 | 생성 | 수정 | 삭제 |
🛡️ 삭제 금지 (권장) |
| ✅ | ✅ | ✅ | ❌ |
🔒 읽기 전용 |
| ✅ | ❌ | ❌ | ❌ |
🛡️ 삭제 금지 모드 (기본 추천)
claude mcp add -s user salesforce \
-e SALESFORCE_SF_CLI_USERNAME=본인이메일@channel.io \
-e PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin \
-e SALESFORCE_NO_DELETE=true \
-- npx -y github:sunny980123/Salesforce-MCP-Server🔒 읽기 전용 모드 (감사/분석용)
claude mcp add -s user salesforce \
-e SALESFORCE_SF_CLI_USERNAME=본인이메일@channel.io \
-e PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin \
-e SALESFORCE_READONLY=true \
-- npx -y github:sunny980123/Salesforce-MCP-Server도구별 권한 매트릭스
도구 | 삭제 금지 | 읽기 전용 |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ✅ |
| ✅ | ❌ |
| ✅ | ❌ |
| ❌ | ❌ |
| ❌ | ❌ |
| ❌ | ❌ |
제공 도구
📦 레코드 CRUD (표준 API)
도구 | 설명 |
| SOQL 쿼리로 레코드 조회 |
| SOSL로 전체 텍스트 검색 |
| ID로 단일 레코드 조회 |
| 새 레코드 생성 |
| 기존 레코드 수정 |
| 레코드 삭제 (제한적 접근) |
| 오브젝트 필드 메타데이터 조회 |
| 사용 가능한 오브젝트 목록 |
| API 사용량 및 한도 확인 |
🔍 Tooling API 조회 — 메타데이터 SOQL
도구 | 설명 |
| Tooling API로 ValidationRule/Flow/Apex 등 메타데이터 조회 |
표준 SOQL로 접근할 수 없는 설정/메타데이터 조회에 사용:
조회 대상 | 예시 쿼리 |
Validation Rule 전체 목록 |
|
Validation Rule 조건식 (1건) |
|
활성 Flow 버전 목록 |
|
Flow 내부 로직 (1건) |
|
Apex 클래스 코드 |
|
Apex 트리거 코드 |
|
주의:
Metadata또는FullName필드를 포함할 경우 반드시WHERE Id = '...'로 1건만 조회해야 합니다.
활용 예시: 특정 필드를 참조하는 모든 로직 찾기
1. ValidationRule 목록 조회 (Metadata 없이 전체)
→ SELECT Id, ValidationName, EntityDefinitionId FROM ValidationRule
2. 각 Rule의 Metadata 조회 (1건씩)
→ SELECT Id, ValidationName, Metadata FROM ValidationRule WHERE Id = '03d...'
3. Flow 활성 버전 → Metadata 순차 조회📤 메타데이터 추출 — Flow / Apex XML 읽기
도구 | 설명 |
| Flow/ApexClass/ValidationRule 등을 XML로 추출 |
지원 타입: Flow, ApexClass, ApexTrigger, ValidationRule, PermissionSet, Layout, CustomObject
내부 동작: 임시 SFDX 프로젝트를 만들고 sf project retrieve start를 실행합니다. sf CLI가 PATH에 있고 SALESFORCE_SF_CLI_USERNAME이 설정돼 있어야 합니다.
객체 정의 읽기 권한만 있으면 동작하며, 모든 권한 모드에서 사용 가능합니다.
# Claude에 요청 예시
"Existing_Flow라는 Flow의 XML을 가져와서 어떤 조건에서 실행되는지 요약해줘"
→ salesforce_retrieve_metadata(metadata_type="Flow", api_name="Existing_Flow")🧪 Sandbox 관리
도구 | 설명 |
| 존재하는 sandbox + 생성 중인 SandboxProcess 목록 |
| 새 sandbox 생성 (Developer / Dev Pro / Partial / Full) |
두 툴 모두 prod MCP에서 호출합니다 (SandboxInfo는 prod org에 저장). create_sandbox는 Salesforce 측 "Manage Sandboxes" 권한이 필요합니다.
Sandbox 생성부터 접속까지의 전체 플로우는 아래 Sandbox 워크플로우 참조.
Sandbox 워크플로우
생성 → 접속
1. (prod MCP에서) sandbox 생성 요청
Claude에 "Salesforce sandbox 'MyDev' DEVELOPER로 생성해줘" 요청
→ salesforce_create_sandbox 호출됨
2. 진행 상태 확인
Claude에 "sandbox 생성 진행 상황 보여줘" 요청
→ salesforce_list_sandboxes에서 CopyProgress %
3. 완료 후 터미널에서 sandbox 로그인
sf org login web -r https://test.salesforce.com
→ 브라우저에서 sandbox username 입력
(본인이메일@channel.io + "." + sandbox_이름_소문자)
예: east@channel.io.mydev
4. Sandbox 전용 MCP 추가 등록 (prod MCP와 공존)
claude mcp add -s user salesforce-sandbox \
-e SALESFORCE_SF_CLI_USERNAME=본인이메일@channel.io.mydev \
-e PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin \
-e SALESFORCE_NO_DELETE=true \
-- npx -y github:sunny980123/Salesforce-MCP-ServerClaude Code에서:
mcp__salesforce__*툴 → prod에 붙음mcp__salesforce-sandbox__*툴 → sandbox에 붙음
Sandbox username 규칙
Prod의 모든 active user는 sandbox 생성 시 자동 복제됩니다. 별도 등록 불필요.
Prod username | Sandbox username (sandbox 이름이 |
|
|
|
|
비밀번호: Developer/Dev Pro는 prod와 동일 (생성 시점 기준). Partial/Full은 Salesforce가 리셋 이메일 발송.
Email 필드는
.invalid접미사로 자동 스크램블됨 (prod 유저한테 테스트 이메일 발송 방지).Inactive user는 복제되지 않습니다.
권한
Sandbox MCP에서도 prod와 동일한 권한 체계 적용. Deploy/delete가 prod에서 막혀 있는 사용자는 sandbox에서도 막힘 — sandbox는 격리된 환경이지 권한 우회 수단이 아닙니다.
트러블슈팅
NamedOrgNotFoundError: No authorization information found for ...
SALESFORCE_SF_CLI_USERNAME 값이 잘못됐거나, 해당 이메일로 sf org login web을 하지 않았습니다.
# 현재 로그인된 org 확인
sf org list
# 재로그인
sf org login web --instance-url https://channel-b.my.salesforce.com
# MCP 재등록 (이메일 정확히 — 대괄호 없이)
claude mcp remove salesforce -s user
claude mcp add -s user salesforce -e SALESFORCE_SF_CLI_USERNAME=본인이메일@channel.io -e PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin -e SALESFORCE_NO_DELETE=true -- npx -y github:sunny980123/Salesforce-MCP-Serverzsh: command not found: claude
Claude Code CLI가 설치되지 않았습니다.
npm install -g @anthropic-ai/claude-codezsh: command not found: -e
명령어를 여러 줄로 복붙하다가 줄바꿈이 깨졌습니다. 한 줄로 복붙하세요.
sf: command not found (MCP 내부 로그)
PATH 환경변수를 빠뜨렸습니다. MCP 프로세스는 shell profile을 상속받지 않으니 명시적으로 /opt/homebrew/bin을 포함해야 합니다.
✓ Connected인데 툴 호출 시 권한 에러
구버전이 npx 캐시에 남아 있을 수 있습니다:
rm -rf ~/.npm/_npx
claude mcp remove salesforce -s user
# 다시 add (위 명령어 그대로)
# 그 뒤 Claude Code 완전 재시작팀원이 기존 project-scoped 설정과 충돌
이전에 다른 방식으로 등록한 적이 있으면 ~/.claude.json에 project-scoped 엔트리가 남아 있을 수 있습니다. GUIDE.md의 정리 스크립트를 참고하세요.
소스에서 직접 빌드 (개발자용)
서버 코드를 수정·기여하려는 경우:
git clone https://github.com/sunny980123/Salesforce-MCP-Server.git
cd Salesforce-MCP-Server
npm install && npm run build로컬 빌드로 MCP 등록:
claude mcp add -s user salesforce \
-e SALESFORCE_SF_CLI_USERNAME=본인이메일@channel.io \
-e PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin \
-e SALESFORCE_NO_DELETE=true \
-- node ~/Salesforce-MCP-Server/dist/index.cjs라이선스
MIT
Available Tools
14 toolssalesforce_create_recordCreate Salesforce RecordA
Create a new record in Salesforce.
Args:
object_type (string): The Salesforce object type (e.g., 'Account', 'Contact', 'Lead')
fields (object): Key-value pairs of field API names and their values
Returns: { id: string, success: boolean } - The new record ID on success.
Common required fields:
Account: Name (required)
Contact: LastName (required), AccountId (optional)
Lead: LastName + Company (required)
Opportunity: Name + StageName + CloseDate (required)
Case: Subject (required)
Examples:
Create account: object_type='Account', fields={ "Name": "Acme Corp", "Industry": "Technology" }
Create lead: object_type='Lead', fields={ "FirstName": "John", "LastName": "Doe", "Company": "Acme", "Email": "john@acme.com" }
Inputs: fields (required), object_type (required).
salesforce_create_sandboxCreate Salesforce SandboxA
Create a new sandbox via Tooling API SandboxInfo. Requires Manage Sandboxes permission.
Creation is asynchronous and can take minutes (Developer) to hours (Full). After creation, a SandboxProcess record tracks progress — use salesforce_list_sandboxes with include_in_progress=true to monitor.
Args:
sandbox_name: 1-10 chars, letters/digits, must start with a letter. Case-sensitive.
license_type: DEVELOPER (default) | DEVELOPER_PRO | PARTIAL | FULL
description (optional): free-form description
Notes:
DEVELOPER: config-only, metadata copy, refreshable daily
DEVELOPER_PRO: same as DEVELOPER with more storage
PARTIAL: sample of prod data (up to 5GB)
FULL: complete prod clone (costly, limited quota)
Must run against PRODUCTION org. After creation, connect via: sf org login web -r https://test.salesforce.com and register a separate MCP entry targeting the sandbox username.
Caller must be in owner or deployer allowlist.
Inputs: sandbox_name (required), description, license_type.
salesforce_delete_recordDelete Salesforce RecordADestructive
Permanently delete a Salesforce record. This action cannot be undone (record goes to Recycle Bin).
Args:
object_type (string): The Salesforce object type (e.g., 'Account', 'Lead')
record_id (string): The 15 or 18-character Salesforce record ID to delete
Returns: Confirmation message on success.
Warning: This operation moves the record to the Recycle Bin. It can be restored within 15 days.
Inputs: record_id (required), object_type (required).
salesforce_deploy_metadataDeploy Salesforce MetadataA
Deploy a metadata component (Flow, ApexClass, ValidationRule, etc.) to the Salesforce org via the SF CLI.
Use this to create OR update declarative metadata. Salesforce deploy is upsert-style: if 'api_name' already exists in the org, this overwrites it.
Typical workflow for creating a new Flow:
(Optional) salesforce_retrieve_metadata to pull an existing Flow as a template
Author the Flow XML (...)
Call this tool with check_only=true to validate (dry-run)
Re-run with check_only=false to actually deploy
Supported metadata types: Flow, ApexClass, ApexTrigger, ValidationRule, PermissionSet, Layout, CustomObject
Args:
metadata_type: One of the supported types above.
api_name: Metadata API name, e.g. 'My_New_Flow'. Must match Salesforce naming rules.
xml_content: Full *-meta.xml content. For Flows, a complete document.
body_content: Required for ApexClass (.cls body) and ApexTrigger (.trigger body).
object_name: Required for ValidationRule — parent sObject (e.g. 'Account').
check_only: If true, validate without committing (dry-run). Default: false.
Blocked entirely when SALESFORCE_READONLY=true (including dry-runs). Requires SALESFORCE_SF_CLI_USERNAME and the Salesforce user to have metadata deploy permissions (e.g. 'Customize Application' or 'Modify Metadata Through Metadata API Functions').
Returns: Deploy status with per-component successes and failures (with error messages).
Inputs: api_name (required), xml_content (required), metadata_type (required), check_only, +2 more.
salesforce_describe_objectDescribe Salesforce ObjectARead-onlyIdempotent
Get metadata for a Salesforce object: field names, types, labels, and whether fields are required/editable.
Use this to discover what fields are available before writing SOQL queries or creating/updating records.
Args:
object_type (string): The Salesforce object API name (e.g., 'Account', 'Contact', 'Opportunity__c')
include_picklists (boolean): Whether to include picklist values for picklist fields (default: false)
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns: Object metadata including:
All field API names, labels, and data types
Required fields
Createable and updateable flags
Picklist values (if requested)
Inputs: object_type (required), response_format, include_picklists.
salesforce_get_limitsGet Salesforce API LimitsARead-onlyIdempotent
Check your Salesforce org's current API usage and remaining limits.
Returns: Key limits including:
DailyApiRequests: Daily REST API call quota (Max and Remaining)
DailyBulkApiRequests: Bulk API limits
Other org limits
Use this to monitor API consumption before running large batch operations.
Inputs: no named parameters.
salesforce_get_recordGet Salesforce RecordARead-onlyIdempotent
Retrieve a single Salesforce record by its ID.
Args:
object_type (string): The Salesforce object type (e.g., 'Account', 'Contact', 'Opportunity')
record_id (string): The 15 or 18-character Salesforce record ID
fields (string[]): Optional list of specific fields to retrieve. If empty, returns all fields.
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns: The full record with all requested fields.
Examples:
Get an account: object_type='Account', record_id='001xx000003...'
Get specific contact fields: object_type='Contact', record_id='003xx...', fields=['Name','Email','Phone']
Inputs: record_id (required), object_type (required), fields, response_format.
salesforce_list_objectsList Salesforce ObjectsARead-onlyIdempotent
List all available Salesforce objects (standard and custom) in the org.
Use this to discover what objects exist before querying or manipulating data.
Args:
filter (string): Optional text to filter object names/labels (case-insensitive)
queryable_only (boolean): If true, only return objects that support SOQL queries (default: true)
limit (number): Maximum number of objects to return (default: 50, max: 500)
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns: List of objects with their names, labels, and CRUD capabilities.
Inputs: limit, filter, queryable_only, response_format.
salesforce_list_sandboxesList Salesforce SandboxesARead-onlyIdempotent
List all sandboxes registered under the production org via Tooling API SandboxInfo.
Shows both existing sandboxes and in-progress creations. For status of an in-progress creation, also check SandboxProcess records (use salesforce_metadata_query).
Args:
include_in_progress (bool): include SandboxProcess records for pending creations (default: true)
Returns:
SandboxInfo list: Id, SandboxName, LicenseType, Description, Status
(optional) SandboxProcess list: recent creation progress
Note: This tool must be run against the PRODUCTION org (sandboxes live under prod).
Inputs: response_format, include_in_progress.
salesforce_metadata_querySalesforce Metadata QueryARead-onlyIdempotent
Execute a SOQL query using the Salesforce Tooling API to access metadata objects not available via standard SOQL.
Use for: ValidationRule, Flow/FlowVersionView, ApexClass/ApexTrigger, WorkflowRule, FieldDefinition.
Examples:
SELECT Id, ValidationName, Active, EntityDefinitionId FROM ValidationRule
SELECT Id, MasterLabel, Status, VersionNumber FROM Flow WHERE Status = 'Active'
SELECT Id, MasterLabel, Metadata FROM Flow WHERE Id = '301xx...'
SELECT Id, Name, Body FROM ApexClass WHERE Name = 'MyClass'
Note: Queries with Metadata or FullName fields must return exactly 1 row (use WHERE Id = '...')
Inputs: soql (required), limit, response_format.
salesforce_querySalesforce SOQL QueryARead-onlyIdempotent
Execute a SOQL (Salesforce Object Query Language) query to retrieve records from Salesforce.
SOQL is similar to SQL. Example queries:
SELECT Id, Name, Industry FROM Account WHERE Industry = 'Technology' LIMIT 10
SELECT Id, Name, Email FROM Contact WHERE AccountId = '001xx000...'
SELECT Id, Name, StageName, Amount FROM Opportunity WHERE CloseDate = THIS_YEAR
Args:
soql (string): A valid SOQL query string
limit (number): Max records to return from results (default: 20, max: 200)
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns: JSON: { totalSize, done, records[], nextRecordsUrl? } Markdown: Formatted table of results
Error: Returns descriptive error if query syntax is invalid or fields don't exist.
Inputs: soql (required), limit, response_format.
salesforce_retrieve_metadataRetrieve Salesforce MetadataARead-onlyIdempotent
Retrieve a metadata component (Flow, ApexClass, ValidationRule, etc.) from the Salesforce org as XML via SF CLI.
Use this to:
Inspect an existing Flow's XML as a reference before authoring a new one
Fetch a component, modify the XML, then redeploy via salesforce_deploy_metadata
Supported metadata types: Flow, ApexClass, ApexTrigger, ValidationRule, PermissionSet, Layout, CustomObject
Args:
metadata_type: The type of metadata to retrieve
api_name: Metadata API name
object_name: Required for ValidationRule (parent sObject)
Requires SALESFORCE_SF_CLI_USERNAME. This tool is read-only — allowed even under SALESFORCE_READONLY.
Returns: The raw *-meta.xml content (and .cls/.trigger body for Apex).
Inputs: api_name (required), metadata_type (required), object_name.
salesforce_searchSalesforce SOSL SearchARead-onlyIdempotent
Search across multiple Salesforce objects using SOSL (Salesforce Object Search Language).
Use SOSL when you want to search across multiple object types at once or do full-text search.
Example SOSL queries:
FIND {Acme} IN ALL FIELDS RETURNING Account(Id, Name), Contact(Id, Name)
FIND {john@example.com} IN EMAIL FIELDS RETURNING Contact(Id, Name, Email)
FIND {urgent} IN ALL FIELDS RETURNING Case(Id, Subject, Status)
Args:
sosl (string): A valid SOSL query string
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns: JSON: { searchRecords: [...] } Markdown: Formatted results grouped by object type
Inputs: sosl (required), response_format.
salesforce_update_recordUpdate Salesforce RecordAIdempotent
Update fields on an existing Salesforce record.
Args:
object_type (string): The Salesforce object type (e.g., 'Account', 'Contact')
record_id (string): The 15 or 18-character Salesforce record ID
fields (object): Key-value pairs of field API names and their new values
Returns: Confirmation message on success.
Notes:
Only the provided fields are updated; other fields remain unchanged.
To clear a field, set its value to null.
Examples:
Update account industry: object_type='Account', record_id='001xx...', fields={ "Industry": "Finance" }
Update opportunity stage: object_type='Opportunity', record_id='006xx...', fields={ "StageName": "Closed Won", "CloseDate": "2026-03-31" }
Inputs: fields (required), record_id (required), object_type (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a distinct purpose: CRUD operations are separate from queries, metadata operations are distinct from data operations, and sandbox management tools are unique. No overlapping functionality.
All tools start with 'salesforce_' and follow a verb_noun pattern, though a few (query, search) lack a noun after the verb, but overall the pattern is predictable and consistent.
14 tools cover a well-scoped set of Salesforce operations: CRUD, query, search, metadata, and sandbox management. Not excessive and each tool serves a clear purpose.
The surface covers essential data and metadata operations, including CRUD, query, search, deploy/retrieve metadata, and sandbox management. Minor gaps exist (e.g., bulk operations, reports), but core workflows are complete.
Maintenance
Related MCP Connectors
Create contacts, move deals, send proposals and invoices, read your inbox, from Claude or ChatGPT.
Solk CRM for Claude: accounts, pipeline, visits, quotes, orders and tickets with your permissions.
Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.
Your SMB workspace in Claude or ChatGPT: tasks, notes, sales and Michèle's memory, via OAuth.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceIntegrates Claude with Salesforce to enable natural language querying, modification, and management of Salesforce records and metadata. It supports comprehensive operations including object/field management, SOSL searches, and Apex code execution.2,615 npm1MIT
- AlicenseAqualityDmaintenanceIntegrates Claude with Salesforce for natural language interactions with Salesforce data and metadata, enabling querying, modifying, and managing objects and records.2020 npmMIT
- AlicenseAqualityDmaintenanceEnables AI tools like Claude Desktop and Cline to interact with Salesforce, providing tools for SOQL queries, Apex execution, metadata management, and more.1768 npm42MIT
- AlicenseBqualityCmaintenanceConnects to Salesforce and enables running SOQL queries, SOSL searches, managing records, and executing various Salesforce APIs via natural language.10MIT