# salesforce-metadata-mcp [Health: Active]

**Category:** 👤 Customer Data Platforms  
**Repository:** https://github.com/semwalajay83-sem/salesforce-metadata-mcp  
**GitHub Stars:** 3  
**npm Downloads (last month):** 2367  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/salesforce-metadata-mcp

## Description
The only Salesforce MCP with Agentforce, OmniStudio & DevOps Center tools — 228 total.

## Tools
Capabilities this server exposes over MCP:

- **sf_create_custom_object** — Creates a new Salesforce Custom Object using the Metadata API. The object name must end with '__c'. Use this when a user asks to create a new object, entity, or table in Salesforce.
- **sf_create_custom_field** — Creates a new custom field on an existing Salesforce object. The field API name must end with '__c'. Supports all field types: Text, Number, Picklist, Lookup, etc.
- **sf_add_picklist_values** — Adds new picklist values to an existing Picklist or MultiselectPicklist field without removing existing values. Use when a user wants to add new options to a dropdown.
- **sf_create_approval_process** — Creates or updates a Salesforce Approval Process via the Metadata API. Define who can submit, approval steps with approvers, entry criteria, and what happens on approval or rejection.
- **sf_create_validation_rule** — Creates or updates a Salesforce Validation Rule on any object via the Metadata API. The errorConditionFormula returns TRUE when data is INVALID. Use for data quality enforcement.
- **sf_create_workflow_field_update** — Creates a Workflow Field Update action that can be referenced by Approval Processes, Workflow Rules, or Flows. Sets a field to a literal value, formula result, or null.
- **sf_create_formula_field** — Creates a formula field on any Salesforce object. Supports all return types (Text, Number, Currency, Date, DateTime, Checkbox, Percent) and the full Salesforce formula language: IF/AND/OR/NOT, BLANKVALUE, TEXT, VALUE, DATE, DATEVALUE, TODAY, NOW, date functions (MONTH/YEAR/DAY), math (FLOOR/CEILING/MOD), string functions (LEN/LEFT/RIGHT/MID/TRIM/UPPER/LOWER/CONTAINS/BEGINS), record type and picklist functions (ISPICKVAL, ISNULL, ISBLANK), cross-object field references (e.g. Account.Owner.Name), and VLOOKUP. Complex multi-line formulas are fully supported.
- **sf_deploy_metadata** — Deploys a set of metadata components directly to the org using the Metadata API SOAP deploy operation. Builds a package.xml and deployment zip in memory. Supports validate-only (checkOnly:true) for pre-deployment validation without making changes. Specify runTests to execute test classes during deployment (required for production). Polls until complete or timeout.
- **sf_check_deploy_status** — Checks the status of an in-progress or recently completed metadata deployment by async job ID. Returns the status (Pending, InProgress, Succeeded, Failed, Canceled), component successes, failures, and test results. Use with the deploy ID returned from sf_deploy_metadata.
- **sf_retrieve_metadata** — Retrieves metadata components from the org and returns their actual file contents. Use this to read existing configuration before making changes, to back up metadata, or to check what is really deployed rather than what you think is deployed. Waits for the async retrieve to finish and unpacks the resulting zip, returning each file's path and source. Large files are truncated. Accepts 'components' (array), or 'metadataType'+'componentName' as a single-item shortcut, or a raw 'packageXml' document — provide exactly one form.
- **sf_delete_metadata** — Permanently deletes one or more metadata components of a given type via the Metadata API's deleteMetadata call — works for CustomObject, CustomField, Flow, GenAiFunction, GenAiPlugin, GenAiPlannerBundle, Bot, ApexClass, and most other metadata types. There was previously no way to remove anything created by this MCP server (sf_deploy_metadata only supports adding/updating components, not destructiveChanges) — diagnostic or abandoned metadata had nowhere to go. Deletes each fullName independently: check the response's deleted/errors lists rather than assuming all all-or-nothing. Some types have dependency order requirements (e.g. delete a Bot's GenAiFunction/GenAiPlugin/GenAiPlannerBundle before the Bot itself, delete CustomField before its parent CustomObject) — Salesforce will reject a delete that still has dependents, naming them in the error.
- **sf_query_records** — Executes a SOQL query against the org and returns matching records. Provide the full SOQL string in the query param. Use for reading data, checking existing records before creating, or verifying changes.

Supports aggregate queries — GROUP BY with COUNT(), SUM(), AVG(), MAX(), MIN(), e.g.:
'SELECT StageName, COUNT(Id), SUM(Amount) FROM Opportunity GROUP BY StageName'
Aggregate results come back as regular records with the aggregate expressions as field keys (e.g. "expr0").

Row cap: 'limit' defaults to 200 and is a ceiling, not a hint. If the SOQL carries its own LIMIT the smaller of the two applies, so a LIMIT in the query can tighten the cap but never raise it. When rows are cut off the response sets truncated: true and reports appliedLimit and limitSource, so a capped result is never mistaken for a complete one.
- **sf_describe_object** — Retrieves schema metadata for a Salesforce object via the REST Describe API: fields (name, label, type, required, picklist values, length, references), child relationships, and record type info. Call this before querying or creating records on an unfamiliar object, or when a user asks what fields exist on an object.

objectApiName: SObject API name, e.g. 'Account', 'My_Object__c'
fieldsOnly: set true for a smaller/faster response with just the field list, omitting child relationships and record types
waitForFields: field API names to poll for after a sf_create_custom_field call — Salesforce's own REST describe/SOQL schema cache can lag several minutes behind the Metadata API on some orgs even though the field is fully deployed; this retries so you don't have to. Not caused by this MCP server and not fixable here — it's Salesforce-side.
timeoutSeconds: max time to poll when waitForFields is set (default 60, max 300)
- **sf_list_objects** — Finds Salesforce objects by PARTIAL name or label — the discovery step before sf_describe_object, which needs an exact API name you may not know yet.

Use this whenever the user refers to objects loosely ("what objects handle cases?", "is there a custom object for invoices?", "show me the custom objects") rather than by exact API name.

searchTerm: partial API name or label, case-insensitive. Omit to list every object in the org.
objectType: 'all' (default), 'custom' (only __c), or 'standard'
queryableOnly: true to hide objects that cannot be queried with SOQL
limit: max results (default 50)

Results rank exact matches first, then prefix matches, then substring matches, so a search for "Account" returns Account before AccountBrandShare. Returns name, label, keyPrefix and CRUD-ability per object; call sf_describe_object with an exact name for full field detail.
- **sf_get_metadata_dependencies** — Answers "what breaks if I change this?" for any metadata component. Read-only — it changes nothing.

Returns every component that REFERENCES the target (Apex classes, triggers, flows, validation rules, layouts, report types, formulas), grouped by type. For custom fields it also reports how many records currently hold a value, which is usually the deciding factor in whether a change is safe.

componentType + componentName: e.g. CustomField + 'Account.Revenue__c', or ApexClass + 'AccountService'
componentId: alternatively pass the Salesforce Id directly (needed for types outside the supported list)
includeUses: also return what the component itself depends on

Run this BEFORE deleting or reshaping anything that holds data. Note the blindSpots list returned with every response: this API cannot see dynamic SOQL, string-built field names, managed-package internals, or external integrations, so an empty result means "nothing found", never "safe to change".
- **sf_list_toolsets** — Lists every available Salesforce toolset, how many tools each contains, and which are currently loaded. This server keeps most of its 228 tools unloaded to save context; unloaded tools do not appear in the tool list until you load their toolset with sf_load_toolset. Call this when you need a capability you cannot see.
- **sf_load_toolset** — Loads one or more Salesforce toolsets, making their tools callable and visible in the tool 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. Call sf_list_toolsets for descriptions and tool counts.
- **sf_find_tool** — Searches all 228 Salesforce tools by name — including tools in toolsets that are not loaded — and by default loads whichever toolsets contain the matches, so you can call them immediately. Use this whenever a tool you expect does not appear in the tool list, or when you do not know which toolset a capability lives in. Example queries: "flow", "permission set", "agent", "omniscript", "debug log".
- **sf_tool_schema** — Returns the input schema, title and description of any of this server's 228 tools, whether or not its toolset is loaded. Use this to find out what arguments a tool takes when it is not in your tool list, then invoke it with sf_call_tool.
- **sf_call_tool** — Invokes any of this server's 228 tools by name, including tools whose toolset is not loaded and tools that do not appear in your tool list. Use this whenever a Salesforce tool you need is not directly callable — it works even on clients that do not refresh their tool list after sf_load_toolset. Get the argument shape first with sf_tool_schema or sf_find_tool. Arguments are validated and permission-checked exactly as they are on a direct call.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "salesforce-metadata-mcp": {
    "command": "npx",
    "args": ["-y","salesforce-metadata-mcp"],
    "env": {
      "SF_INSTANCE_URL": "",
      "SF_ACCESS_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `SF_INSTANCE_URL`, `SF_ACCESS_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What salesforce-metadata-mcp does

salesforce-metadata-mcp connects an MCP client to a Salesforce org for metadata inspection and configuration work. Its advertised catalog contains 228 tools covering object definitions, fields, automation, deployment, Apex, UI components, Agentforce, OmniStudio, DevOps Center, and other Salesforce areas.

Read operations include finding objects by name or label, describing an object’s schema, and checking metadata dependencies. The dependency check is read-only and can identify references to a component and whether a field contains data. Updates to custom objects and fields are risk-classified; destructive field changes report impact before applying them, and object updates use a confirmation gate.

## How it works

The server communicates with MCP clients over stdio. It starts with a core selection of tools rather than placing the entire catalog in the model context. Toolsets can be loaded by name, and the server provides meta-tools for searching, listing, loading, invoking, and inspecting tool schemas.

`s`sf_find_tool` searches the available catalog and loads matching tools. `sf_load_toolset` enables a named group, while `sf_list_toolsets` reports available groups and their load state. `sf_call_tool` can invoke a tool by name even when that tool is not visible in the client’s current tool list; `sf_tool_schema` returns the input schema needed to construct such a call. The default configuration includes core and metadata tools, while `SF_TOOLSETS=all` loads the full catalog at startup. A custom comma-separated list can select specific groups such as `objects`, `flows`, `automation`, or `deployment`.

## Setup and configuration

Run the package directly with `npx -y salesforce-metadata-mcp`, or install it globally with npm and launch `salesforce-metadata-mcp`. A standard MCP configuration supplies the command and passes Salesforce credentials as environment variables:

- `SF_INSTANCE_URL`: the Salesforce org URL.
- `SF_ACCESS_TOKEN`: the access token used by the server.

Docker is supported; run the container interactively with `-i` because the stdio connection is driven by the MCP client. The example Docker setup passes the same instance URL and access token variables.

## Tools and capabilities

The available examples cover several configuration workflows:

- Create custom objects, fields, formula fields, metadata types and records, labels, settings, global value sets, record types, business processes, layouts, sharing rules, and field dependencies.
- Inspect objects and schemas before making changes.
- Create flows with assignment, decision, record retrieval, record creation, record deletion, and loop elements.
- Define approval processes, validation rules, workflow field updates, email alerts, assignment rules, escalation rules, auto-response rules, matching rules, and duplicate rules.
- Create Platform Event objects and analyze metadata dependencies.

The catalog also includes toolsets for areas named in the README, including Agentforce, OmniStudio, DevOps Center, data, Apex, deployment, integrations, monitoring, and reports.

## Limitations and notes

Consult the project’s tool documentation for inputs and examples before constructing calls. Client behavior matters when toolsets change: MCP clients are expected to refresh their tool list after a `notifications/tools/list_changed` event, but clients that do not refresh should use `sf_call_tool` together with `sf_tool_schema`.

Flow tools are kept outside the default selection because their schema is comparatively large.

_Full upstream README: https://allmcps.com/mcp/salesforce-metadata-mcp/readme_

