
Salesforce Metadata Mcp
io.github.semwalajay83-sem由 GitHub 账号 semwalajay83-sem 发布v3.2.0更新于 Nov 4, 2026
The only Salesforce MCP with Agentforce, OmniStudio & DevOps Center tools — 228 total.
概览
本地 MCP 服务器,为助手提供 228 个工具,用于在 Salesforce 组织中构建、配置和部署元数据、Apex、Flow、Agentforce 与 OmniStudio。
- 可以做什么
- 创建和更新对象、字段、记录类型、页面布局、验证规则与共享规则
- 搭建自动化:Flow、审批流程、工作流操作、分配规则与升级规则
- 编写并部署 Apex 类、触发器和测试类,运行测试、执行匿名 Apex、读取调试日志并做静态分析
- 部署、检索和删除元数据,管理更改集并查看部署状态
- 配置安全与访问:权限集、角色、队列、命名凭证,审计字段级安全性
- 构建 Agentforce 智能体、主题与操作,OmniStudio 组件、DevOps Center 流水线、LWC、Experience 站点与外部集成
- 适用场景
- 适合在 Salesforce 组织上做管理或开发、希望助手用自然语言创建元数据、部署代码、查看架构或搭建 Agentforce 与 OmniStudio 的场景,尤其在沙盒或 scratch 组织中。
- 运行要求
- 通过 npx 或全局 npm 安装以 stdio 在本地运行(需要 Node.js),也可用 Docker 镜像。需要 SF_INSTANCE_URL,并选择一种认证方式:SF_ACCESS_TOKEN、配合 Salesforce CLI 的 SF_ALIAS,或 SF_CLIENT_ID、SF_CLIENT_SECRET、SF_REFRESH_TOKEN 等 OAuth/JWT 变量。需要访问组织的网络。可选 SF_TOOLSETS 与 SF_PRODUCTION_GUARD。
安装
在 SourceWeft 中
- 打开 控制台中的 Salesforce Metadata Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
salesforce-metadata-mcp
[npm version] [npm downloads] [License: MIT] [MCP Compatible]
The only Salesforce MCP server that builds Agentforce agents, OmniStudio components, and DevOps Center pipelines — alongside a complete daily developer loop (schema describe, Apex read, debug logs) and 228 tools total for building, configuring, and automating Salesforce orgs directly from Claude or any MCP client.
Quick Start
Or install globally:
Configuration (Claude Desktop / Claude Code)
Add to your MCP configuration (claude_desktop_config.json or .claude/settings.json):
See SETUP.md for all authentication methods and detailed setup instructions.
One-click install (Claude Desktop)
Download salesforce-metadata-mcp-<version>.mcpb from the latest release, then drag it into Claude Desktop → Settings → Extensions. It prompts for your org URL and credentials — no JSON editing.
The bundle resolves the server from npm at launch rather than embedding a copy, so it always runs the current published version and never needs re-downloading after an upgrade.
Docker
The image builds from source, runs as a non-root user, and ships production dependencies only. Because this server speaks MCP over stdio, -i is required — the container is driven by its client, not run as a background service. SF_ALIAS will not work in a container: the Salesforce CLI's login flow needs a browser, so use token, JWT, refresh-token, or client-credentials variables instead.
Toolsets — loading 228 tools without burning your context
All 228 tools are always available. Most are not loaded into the model's context until something asks for them.
Listing every tool up front costs roughly 98,000 tokens — about half a 200k context window, spent before you type anything, whether or not the session ever touches OmniStudio or DevOps Center. A 228-candidate tool list also makes the model measurably worse at picking the right tool. So the server starts with a small core loaded and pulls in the rest on demand:
The default covers what nearly every session needs: describe/list objects, SOQL query, deploy/retrieve/delete metadata, deploy status, and core schema creation (objects, fields, formula fields, picklist values, validation rules, approval processes).
Five tools are always present and make everything else reachable:
sf_find_tool— search all 228 tools by name and load whatever contains the matches, in one call. Ask for "create an omniscript" and it finds the tools, loadsomnistudio, and they are callable immediately. This is usually all you or the model needs.sf_load_toolset— load named toolsets explicitly.sf_list_toolsets— browse all toolsets, their tool counts, and what is loaded.sf_call_tool— invoke any tool by name, loaded or not, without it having to appear in the tool list first. Arguments are validated and the production guard applies exactly as on a direct call.sf_tool_schema— return any tool's input schema, sosf_call_toolcan be constructed for a tool the client cannot see.
In practice you don't manage this by hand: ask for what you want, and the model loads what it needs.
If loaded tools don't show up
Loading a toolset enables it on the server and emits notifications/tools/list_changed. A client is
supposed to re-fetch tools/list when it sees that. Some clients don't — and when that happens, the
load reports success, the tools really are enabled, and the model still cannot call any of them
because they never entered its tool list.
Two things handle this, so no client can lose access to a tool:
sf_load_toolsetchecks whether the client re-fetched and says so in its response, instead of reporting an unqualified success for tools that have become unreachable.sf_call_toolreaches every tool without needing a re-fetch at all. Combined withsf_tool_schema, the full 228-tool surface is usable from the handshake tool list alone — even underSF_TOOLSETS=none.
To restore the previous behaviour of loading everything at startup, set SF_TOOLSETS=all. To start
with only the five meta-tools, set SF_TOOLSETS=none. To pick your own core, pass a list:
Available toolsets: core, metadata, objects, data, flows, automation, security, apex,
lwc, ui, pages, actions, agentforce, omnistudio, omnichannel, devops, deployment,
integrations, identity, reports, experience, admin, monitoring, audit, einstein,
knowledge, cpq, sandbox, streaming, visualforce, aura, comms, mcp, i18n.
Flow tools live in their own flows toolset because sf_create_flow carries the full Flow element
schema — 15,266 bytes (~4,126 tokens) on its own, the largest tool definition in the server. Keeping
it out of the default means sessions that never build a Flow never pay for it, while sessions that do
still get the complete validated schema.
Tools — 228 total
Highlights below; see TOOLS.md for the complete reference with parameters and example prompts.
Objects & Fields
Automation
Security & Access
UI & Experience
Apex Development
LWC Development
Experience Cloud
Agentforce
External Integrations
Change Sets & Deployment
MCP Server Management
Example Prompts
Build a complete object:
"Create a custom object called Project__c with fields: Name (text), Status__c (picklist: Planning/Active/Complete), Budget__c (currency), then add a validation rule requiring Budget when Status is Active."
Deploy Apex:
"Create an Apex class called OpportunityService that queries all Opps with Amount > 100000. Then create a test class for it."
Create a flow:
"Create a record-triggered flow on Opportunity that fires after save when Stage = Closed Won. Send an email alert to the owner and create a follow-up Task due in 30 days."
Set up an LWC:
"Create a Lightning Web Component called accountSummary that displays account name, industry, and annual revenue. Make it available on Record Pages."
Agentforce setup:
"Create an Agentforce agent called SalesAssistant. Then create a GetOrders action linked to the Get_Account_Orders flow. Then create an OrderManagement topic with actions: [GetOrders]. Finally wire SalesAssistant to topic OrderManagement."
Environment Variables
Production write guard
This server hands an LLM a Salesforce credential, and the LLM decides what to do with it. Any text
the model reads on the way — a case comment, a field description, a retrieved .flow file, an
email body — can carry an instruction, and nothing downstream can tell it apart from one you typed.
So against a production org, nine tools are refused by default:
Metadata creation is not affected. All 137 sf_create_* tools, sf_deploy_metadata and
sf_retrieve_metadata work against production exactly as before — authoring metadata by natural
language is the point of this package, and a guard that taxed it would just get switched off.
Apex authoring (sf_create_apex_class, sf_create_apex_trigger) is also not blocked, even
though a trigger runs on every DML. The line drawn is auditability: created Apex is metadata — it
has a name, an author and a deploy record, and can be found and removed. sf_execute_anonymous_apex
leaves nothing to find, which is why that one is blocked.
An org counts as production only when it is not a sandbox, not a Developer Edition org, and not on a trial/scratch expiry. Sandboxes, dev orgs and scratch orgs are never gated.
The guard is a hard refusal, not a confirmation prompt: a prompt the calling agent can approve by itself is not a control, and this server is often run with client permissions bypassed. Only the environment variable lifts it.
Documentation
- SETUP.md — Prerequisites, authentication, Claude configuration
- TOOLS.md — All 228 tools with full parameter documentation
- AGENTFORCE.md — Agentforce agent creation guide
- APEX_LWC.md — Apex and LWC development guide
- CHANGELOG.md — Version history
Bugs & Feature Requests
Found a bug or want a new tool? Open an issue — there are templates for bug reports and feature requests. Please include the package version and the tool name, and remove any org URLs or credentials before posting.
License
MIT
来源:README.md,提交 f17af23
工具
0版本历史
2- v3.2.0最新Sep 30, 2026
- v3.0.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分