Salesforce Metadata MCP
@semwalajay83-sem
About Salesforce Metadata MCP
The most comprehensive Salesforce MCP server: 212 tools for managing your org from Claude in natural language. Create custom objects, fields, and page layouts; build and activate Flows; write and deploy Apex and LWC; manage permission sets, profiles, and users; reports and dashbo
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": [
"-y",
"salesforce-metadata-mcp"
],
"env": {
"SF_INSTANCE_URL": "https://your-org.my.salesforce.com",
"SF_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}Tools
200Creates 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.
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.
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.
Creates or updates a Salesforce Flow via the Metadata API. Supports AutoLaunchedFlow (required for Agentforce actions), Screen Flow, RecordTriggeredFlow, and ScheduledFlow. Supports advanced elements: Decision, GetRecords, CreateRecords, DeleteRecords, SendEmailAlert, ApexAction, Subflow, Loop, Assignment, Screen via the 'elements' array. GetRecords filter operators supported: EqualTo, NotEqualTo, GreaterThan, LessThan, GreaterThanOrEqualTo, LessThanOrEqualTo, IsNull, StartsWith, EndsWith. Contains is NOT supported by Salesforce Flow record lookups and will return an error. IMPORTANT for Agentforce: set flowType to 'AutoLaunchedFlow' and status to 'Active' — Draft flows and Screen flows cannot be invoked by agents.
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.
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.
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.
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.
Creates a new Custom Metadata Type (ending in __mdt) with optional custom fields. Custom Metadata Types store configuration data that can be packaged and deployed. Use when a user wants to store configuration in metadata rather than custom objects.
Creates a record within an existing Custom Metadata Type (__mdt). Custom metadata records store configuration values that can be read in Apex, Flows, and formulas. Provide typeName (e.g., 'Config__mdt'), a record name, and field values.
Creates or updates a Salesforce Custom Label. Custom Labels are text values accessible in Apex, Visualforce, LWC, and Flows, with support for translation. Use for internationalizable text strings, error messages, or UI labels.
Creates a Custom Setting object (ending in __c) with Hierarchy or List type. Custom Settings store data accessible via Apex without SOQL queries. Hierarchy type supports org/profile/user level overrides. Use for feature flags, thresholds, or configurable constants.
Creates a Global Value Set — a shared picklist definition that can be referenced by multiple Picklist fields across different objects. Any change to the Global Value Set is reflected in all fields that use it. Use when the same set of values (like Status, Priority, Region) should be shared and kept in sync across multiple objects. fullName must end with __gvs, e.g. 'Industry_Types__gvs'.
Creates a Record Type on a Salesforce object. Record Types allow different page layouts, picklist values, and business processes for different types of records on the same object. For example, create 'Enterprise' and 'SMB' record types on Opportunity with different Stage values.
Creates a Business Process for Opportunity (Stage values), Lead (Status values), Case (Status values), or Solution (Status values). Business Processes define which picklist values are available for a given Record Type. Must be created before assigning to a Record Type.
Creates a Page Layout for a Salesforce object. Page Layouts control what fields, related lists, and buttons appear on record detail and edit pages. Layouts are assigned to user profiles and record types. Define sections with fields and the related lists to include.
Creates a Sharing Rule for a Salesforce object. Sharing Rules extend the OWD by automatically sharing records with users who meet criteria (criteria-based) or who own records (ownership-based). Use to give specific roles/groups access to records they wouldn't normally see based on OWD.
Creates a field dependency between a controlling picklist and a dependent picklist on the same object. When a user selects a value in the controlling field, only the relevant dependent field values appear. Example: when Country = 'USA', State shows only US states.
Creates a Workflow Email Alert action that can be triggered by Flows, Approval Processes, or Workflow Rules. Specify the email template to use and recipients (owner, creator, users, roles, or custom email addresses). Use when you need to send notification emails as part of automation.
Creates a Platform Event object (ending in __e) for event-driven architecture. Platform Events enable real-time publish/subscribe communication between systems. Publishers fire events and subscribers (Flows, Apex triggers, external systems) react to them. PublishAfterCommit waits for DML to commit; PublishImmediately fires right away.
Creates an Assignment Rule for Leads or Cases. Assignment rules automatically route new records to the appropriate owner (user or queue) based on matching criteria. Only one rule can be active at a time per object. Rule entries are evaluated top-to-bottom and the first match wins.
Creates an Escalation Rule for Cases. Escalation rules automatically escalate cases that haven't been closed within a specified time, reassigning them to other users or queues and optionally sending notifications. Based on business hours and a configurable start date (creation time or last modification).
Creates an Auto-Response Rule for Web-to-Lead or Web-to-Case. When a lead or case is created via a web form, this rule automatically sends a confirmation email using the specified template. Rule entries define which template to use based on criteria.
Creates a Matching Rule used by Duplicate Rules to detect potential duplicate records. Define which fields to match on and which matching algorithm to use (Exact, FirstName, LastName, Company, Email, Phone, etc.). Must be created before creating a Duplicate Rule that references it.
Creates a Duplicate Rule that uses Matching Rules to detect potential duplicates when records are saved. Can block duplicates, allow with a warning, or allow silently. Works for Leads, Contacts, Accounts, and custom objects. Requires existing Matching Rules.
Creates an Apex Email Service that processes inbound emails via an Apex class implementing Messaging.InboundEmailHandler. Useful for creating support cases from emails, parsing email content, or triggering workflows from inbound messages. The Apex class must exist before creating the service.
Schedules an Apex class that implements the Schedulable interface to run on a cron schedule. Use for batch processing, nightly data cleanup, report generation, or any periodic automation. The Apex class must already exist in the org. Example cron: '0 0 2 * * ?' = daily at 2 AM.
Creates a Schedule-Triggered Flow that runs automatically on a recurring schedule (e.g., daily, weekly) against a batch of matching records. Use for nightly batch processing, periodic data updates, or scheduled notifications. fullName: Flow API name label: Flow display label objectApiName: object whose records to process scheduledPaths: array defining when the flow runs (offsetNumber, offsetUnit, timeSource) description: optional description
Creates an Apex trigger that fires when a Platform Event message is received (after insert). Use to process incoming platform events with Apex logic — e.g., creating records, sending notifications, or calling external APIs when an event is published. triggerName: Apex trigger name eventApiName: Platform event API name, e.g. 'MyEvent__e' body: Apex code body for the trigger apiVersion: Salesforce API version
Creates a Workflow Rule (legacy automation) that evaluates criteria and triggers actions. Use for simple automations that don't require the power of Flows. Supports formula or criteria-based evaluation. Workflow rules can trigger field updates, email alerts, outbound messages, and tasks. objectName: object the rule applies to fullName: rule developer name triggerType: when to evaluate (onCreateOnly, onCreateOrTriggeringUpdate, onAllChanges) active: whether the rule is active formula or criteriaItems: define when the rule fires
Creates a standalone Workflow Field Update action that sets a field to a formula, literal value, or null when triggered. Can be associated with Workflow Rules, Approval Process steps, or used independently. objectName: object the field update applies to fullName: developer name of the field update name: display name field: field API name to update operation: Formula, Literal, LiteralBlank, or Null formula: Apex formula (for Formula operation) literalValue: static value to set (for Literal operation)
Creates a Workflow Outbound Message that sends a SOAP XML payload to an external endpoint when triggered by a Workflow Rule or Approval Process. Use for real-time integration with external systems that need to be notified of record changes. objectName: object the message is for fullName: developer name for the outbound message name: display name endpointUrl: external SOAP endpoint URL fields: field API names to include in the message integrationUser: optional username to authenticate the callout
Creates a Permission Set with object permissions, field permissions, Apex class access, and user permissions. Permission Sets extend a user's access without changing their profile. Use when you need to grant specific permissions to a subset of users (e.g., a 'Sales Manager' permission set that allows deleting opportunities).
Creates a Role in the Salesforce role hierarchy. Roles control record visibility through role-based sharing. Users in higher roles can see records owned by users in subordinate roles. Specify a parentRole to place this role in the hierarchy, or omit it for a top-level role.
Creates a Queue in Salesforce. Queues are groups of users that can be assigned records (Cases, Leads, etc.). When a record is assigned to a queue, any queue member can work on it. Use for support teams, sales teams, or any scenario where multiple people share a pool of records to process.
Creates a Named Credential for making authenticated callouts to external systems from Apex or Flows. Named Credentials store the endpoint URL and authentication details securely, so developers don't hardcode credentials. Supports NoAuthentication, Basic (username/password), OAuth, and more. Use with sf_create_remote_site_setting to also allow the URL.
Creates multiple Salesforce roles in the role hierarchy in a single call. Roles control record visibility — users in higher roles see records owned by subordinate-role users (depending on OWD settings). Use to set up an entire hierarchy at once. roles: array of {fullName, name, parentRole?, description?} - fullName: role API name (e.g. 'VP_Sales') - name: display label - parentRole: API name of parent role (omit for top-level)
Sets field-level security (FLS) for a field across one or more profiles, controlling whether each profile can read and/or edit the field. Use after creating a custom field to make it visible and editable to the right profiles. objectName: object API name fieldName: field API name (e.g. 'Revenue__c') profiles: array of {profileName, readable, editable}
Reads the current field-level security grants for a field across all Profiles and Permission Sets that reference it, via the FieldPermissions query object. Use to audit who can currently see or edit a field before changing access, or to answer "which profiles can edit this field?". Complements sf_create_field_level_security, which sets grants but doesn't report the current state. objectName: object API name, e.g. 'Account' fieldName: field API name, e.g. 'Revenue__c'
Creates a Custom Permission that can be checked in formulas with $Permission.MyPerm or in Apex with FeatureManagement.checkPermission('MyPerm'). Assign custom permissions to users via Permission Sets. Use for feature flags, conditional UI rendering, or access gates. fullName: permission API name (e.g. 'Can_Approve_Discounts') label: display label description: optional description requiredPermissions: other custom permissions required before this one can be granted
Creates a Muting Permission Set that removes specific permissions from users in a Permission Set Group. Use to create exceptions — e.g., a Permission Set Group grants broad access, and a Muting Permission Set removes a subset of that access for specific users. fullName: muting permission set API name label: display label description: optional description
Creates a Permission Set Group that aggregates multiple Permission Sets into a single assignable unit. Users assigned the group receive all permissions from all included permission sets. Simplifies administration when users need a combination of permissions. fullName: Permission Set Group API name label: display label permissionSets: array of Permission Set API names to include
Creates a Lightning App in Salesforce — a branded navigation container with a custom navigation bar, utility bar, and logo. Choose between Standard (tabs) and Console (split view) navigation. Specify navItems to populate the navigation bar with objects, home, reports, etc. Use when a user wants a custom app experience for a specific team or use case.
Creates a Custom Tab for a custom object so it appears in the navigation bar and App Launcher. Tabs are required to make custom objects accessible from the UI. Specify the object API name and choose a motif/icon from Salesforce's icon library (e.g., 'Custom64: Coin').
Creates a Compact Layout for a Salesforce object. Compact Layouts define which fields appear in the highlights panel at the top of a record page (up to 10 fields), in Salesforce Mobile, and in related list cards. Use when you want to surface the most important fields at a glance.
Creates a List View for any Salesforce object. List Views are saved filters that display a subset of records with specific columns, filters, and sorting. Use to create shared views like 'My Open Cases', 'High Priority Leads', or 'Deals Closing This Month' that appear in the object's list view selector.
Creates an HTML or text email template that can be used in Workflow Email Alerts, Approval Processes, or sent manually. Templates support merge fields like {!Account.Name} for personalization. Specify a folder path (e.g., 'unfiled$public/MyTemplate') or 'MyFolder/MyTemplate'. Use relatedEntityType to enable object-specific merge fields.
Creates a Static Resource from text/JSON/JS/CSS content. Static Resources are files stored in Salesforce and served via a CDN URL — ideal for JavaScript libraries, CSS stylesheets, JSON configuration, or any other file that needs to be served from Salesforce. Content is provided as a string and deployed via the Metadata API.
Creates a Custom Notification Type that can be sent from Flows, Apex, or Process Builder using the Send Custom Notification action. Custom Notifications appear in Salesforce notification bell (and optionally mobile push). Use to create in-app alerts for important business events.
Creates a Custom Report Type that defines what objects and fields are available when building reports. A report type specifies a primary object and optionally related objects (joined via relationships). Use when the standard report types don't include the data you need, or when you want to create a specialized reporting structure.
Creates a Salesforce Dashboard with components (charts, metrics, tables, gauges) powered by reports. Dashboards provide visual summaries of key business data. Specify the folder path as 'FolderName/DashboardName' and add components linked to existing reports. Use when a team needs a visual summary of their metrics.
Creates and deploys an Apex class to the Salesforce org using the Metadata API. Accepts the full Apex source code including the class declaration. Use for any type of Apex class: service classes, controllers, batch classes, schedulable classes, queueable classes, test utilities, etc. IMPORTANT — If this class will be used as an Agentforce agent action: it MUST contain a public static method annotated with @InvocableMethod. Classes without @InvocableMethod cannot be invoked by agents and will silently fail at runtime. Example minimum structure: public class MyClass { @InvocableMethod(label='Do Thing' description='Does the thing') public static List<String> doThing(List<String> input) { ... } }
Creates and deploys an Apex Trigger on any Salesforce object. Specify the trigger events (before insert, after update, etc.) and the trigger body code. The trigger declaration (trigger Name on Object (events)) is auto-generated — just provide the code that goes inside the trigger body. Deployed via Metadata API SOAP deploy.
Creates and deploys an Apex Test Class (annotated with @isTest). Provide the full test class source code. Optionally run the tests immediately after deployment. Test classes are required for Salesforce deployments to production (minimum 75% code coverage). Use for unit testing Apex classes, triggers, and business logic.
Runs one or more Apex test classes and returns pass/fail results with any error messages. Uses the Salesforce Tooling API runTestsAsynchronous endpoint and polls for results. Use after deploying Apex code to verify test coverage, or to run regression tests before a release.
Executes anonymous Apex code in the Salesforce org using the Tooling API executeAnonymous endpoint. Returns compile errors, runtime exceptions, and debug log output. Use for one-off data fixes, testing Apex snippets, creating test data, running utilities, or debugging. Code runs in the context of the authenticated user.
Scans Apex classes in the org for common anti-patterns using the Tooling API. Detects SOQL/DML in loops, hardcoded Salesforce IDs, and debug statements left in production code. Use before deploying to catch performance and quality issues early. classNames: optional list of class names to scan (omits test classes with __Test suffix) maxClasses: maximum classes to scan (default 20, max 200)
Runs Salesforce Code Analyzer against Apex classes in the org — a real multi-engine static analysis scan (PMD rules including ApexCRUDViolation and OperationWithLimitsInLoop, SFGE data-flow analysis for SOQL injection, RetireJS for vulnerable JS libraries, ESLint, and Salesforce's regex engine), on top of the lighter-weight sf_scan_apex_antipatterns heuristic check. Retrieves class bodies via the Tooling API into a temp workspace, runs the scanner, and cleans up afterward. PMD/CPD/SFGE engines require Java 11+ on the host running this MCP server — if Java isn't detected, the scan automatically falls back to the Java-free engines (eslint, retire-js, regex, flow) and flags this in the response rather than failing. classNames: optional list of class names to scan (omit to scan all active classes) maxClasses: maximum classes to scan (default 20, max 200) ruleSelector: optional override, e.g. ['pmd:Security'] — defaults to 'Recommended' rules (auto-restricted per the Java note above)
Reads Apex classes via the Tooling API. Two modes: className: exact name — returns the full source body, API version and status. Use before modifying a class, when debugging, or when a user asks "show me the X class". namePattern: a glob — returns every matching class as a list (* = any characters, ? = one character), e.g. 'Account*' or 'Account*Controller' or '*Test'. Use when the user does not know the exact name ("find all the controller classes", "what test classes exist for Account"). Bodies are deliberately omitted in this mode to avoid returning tens of thousands of lines; pick one from the list and re-call with className. Read-only. Not to be confused with sf_create_apex_class, which deploys new or updated code.
Reads Apex triggers via the Tooling API. Three modes: triggerName: exact name — returns the full trigger body, the object it fires on, its active status, and which events (before/after insert/update/delete/undelete) it is registered for. namePattern: a glob — lists matching triggers (* = any characters, ? = one character), e.g. 'Account*'. objectName: lists every trigger on that object, e.g. 'Account' — answers "what triggers run on Case?". Combinable with namePattern. In list modes, bodies are omitted; re-call with triggerName for full source. Read-only.
Creates and deploys a new Lightning Web Component (LWC) to the Salesforce org. Provide the HTML template, JavaScript controller, optional CSS, and component metadata. The component is packaged into a deployment zip and deployed via the Metadata API. Specify targets to make the component available in Lightning App Builder (AppPage, RecordPage, HomePage), Flow Screen, Utility Bar, or Experience Cloud. Use isExposed:true to make it drag-and-drop in App Builder.
Updates an existing Lightning Web Component by redeploying it with updated HTML, JavaScript, or CSS. Provide only the files you want to update — any files omitted will use empty placeholders (so you should provide all files you want to keep). The component is redeployed via the Metadata API.
Creates a Jest test file for an existing LWC component using @salesforce/lwc-jest conventions. The test file is placed in the __tests__ subfolder of the component bundle and deployed via the Metadata API. componentName: LWC component name in camelCase, e.g. 'myButton' testContent: Jest test file content (JavaScript) apiVersion: Salesforce API version
Returns guidance and a checklist for LWC accessibility best practices covering ARIA attributes, keyboard navigation, focus management, and screen reader support. A read-only advisory tool — does not modify the org. componentName: optional component name for context checklistOnly: return only the checklist items without detailed guidance
Analyzes an Aura component and returns a comprehensive migration guide with Aura-to-LWC concept mappings, key differences, and an optional LWC scaffold. A read-only advisory tool — does not modify the org. auraComponentName: the Aura component name to analyze includeScaffold: whether to generate equivalent LWC template, JS, CSS, and meta files
Generates a complete LWC component scaffold (HTML template, JS controller, CSS, and meta XML) from a plain-English requirements description. Returns the generated code for review before deploying with sf_create_lwc. componentName: LWC component name in camelCase requirements: plain-English description of what the component should do includeWireAdapters: include @wire adapter examples for data fetching targetObject: optional Salesforce object to bind to
Returns Salesforce Lightning Design System (SLDS) component examples, best practices, and usage guidance for a given UI pattern. A read-only reference tool — does not modify the org. componentType: SLDS component type, e.g. 'data-table', 'modal', 'combobox' includeExampleCode: whether to include example LWC code snippets
Creates an Experience Cloud site (formerly Community) using a specified template. Supported templates: CustomerService (B2C self-service), Partner (B2B partner portal), LWR (Lightning Web Runtime — high performance), Aloha (App Launcher), Microsites (standalone pages). The urlPathPrefix appears in the site URL (e.g., 'customers' → org.force.com/customers). Site starts in UnderConstruction status by default.
Creates a page within an existing Experience Cloud site. Pages can be standard (home, login, profile, object detail, object list) or custom. The page URL path is relative to the site's URL prefix. Use after creating the site to add additional pages for different content sections.
Creates an Agentforce Agent (Einstein Copilot) shell in Salesforce. THIS IS STEP 1 OF A 5-STEP SEQUENCE — calling this tool alone produces a non-functional agent shell. You MUST continue calling tools in this exact order without stopping: (0) FIRST create the backing flows (sf_create_flow, flowType=AutoLaunchedFlow, status=Active) and/or Apex classes (sf_create_apex_class with @InvocableMethod) for each capability. (1) THIS TOOL — sf_create_agent. (2) sf_create_agent_action — one call per flow/apex. (3) sf_create_agent_topic — group actions into topics; pass all action API names in the 'actions' array. (4) sf_create_agent_planner — wire topics to the agent. DO NOT report completion to the user until sf_create_agent_planner succeeds. Do not ask the user for confirmation between steps — proceed through all steps autonomously. On the first call (no plannerName), this tool probes whether the org can create custom agent actions at all before creating the shell — if it can't, this call fails with no shell created, rather than leaving an orphaned Bot with no planner/topic/action once step 2 turns out to be unreachable. Active Agentforce permission set licenses do NOT guarantee this probe passes — those are a separate signal, confirmed live to be an unreliable one. Pass skipActionCapabilityCheck:true only for a topics-only agent (no custom actions planned) or when you already know the answer.
Creates a Topic (GenAiPlugin) for an Agentforce Agent — step 3 of the agent setup sequence. Call this AFTER all actions have been created with sf_create_agent_action. CRITICAL: pass ALL action API names in the 'actions' array — omitting it creates a topic with no executable actions and the agent silently does nothing. agentName is informational only (not written to XML) — the actual agent→topic wiring happens in sf_create_agent_planner which you MUST call immediately after this step. Do not stop between steps.
Creates a GenAiPlanner that connects an Agentforce Agent (Bot) to its Topics — STEP 4 (FINAL) of the agent setup sequence. Without this step the agent cannot route ANY request regardless of how many topics and actions were created. Also known as: linking topics to agent, connecting topics, finishing agent setup, wiring topics, registering topics. CRITICAL: topicNames must be the COMPLETE list of all topics — this REPLACES any existing planner, so omitting a topic removes it from the agent. When adding a new topic to an existing agent, include ALL previous topic names plus the new one. Only AFTER this step succeeds should you report completion to the user.
Creates an Agentforce Action (GenAiFunction) — step 2 of the agent setup sequence. Call this once per capability (once per flow, once per Apex class). IMPORTANT by type: For Flow — the flow must already exist as an Active AutoLaunchedFlow (use sf_create_flow with flowType='AutoLaunchedFlow' and status='Active' first). For ApexClass — the class must already exist AND have @InvocableMethod (use sf_create_apex_class first). The 'reference' is the exact API name of the flow or class. After ALL actions are created, call sf_create_agent_topic (passing all action API names in 'actions' array), then sf_create_agent_planner. Do not stop between steps.
Creates an Outbound Change Set in the org — a container for metadata components that can be deployed to connected orgs (sandbox → production). Optionally adds specified components immediately. Returns the change set ID and a link to view it in Setup. Use this before deploying to production when using the change set deployment model.
Adds one or more metadata components to an existing Outbound Change Set by change set name. Supports all metadata types: CustomObject, CustomField, ApexClass, ApexTrigger, Flow, ValidationRule, PermissionSet, etc. Use after creating a change set to add the metadata you want to deploy.
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.
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.
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.
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.
Generates a complete, working MCP server project structure on disk targeting a Salesforce org. Creates package.json, tsconfig.json, src/index.ts entry point, .env.example, and README.md. The generated server uses the MCP SDK and includes a sample 'hello_world' tool. Provide an outputDirectory (absolute path) where the files will be written. After generation, run 'npm install' then 'npm run build' in that directory.
Adds a new tool definition to an existing MCP server project by reading the src/index.ts file and appending the tool registration. Provide the tool name, description, input schema as a JSON object (field names to {type, description}), and handler code. The tool code is inserted before the 'Start server' section. Run 'npm run build' after adding tools.
Lists all tools currently registered in a given MCP server project by reading and parsing its src/index.ts file. Returns the tool names in the order they are registered. Use to audit what tools exist before adding new ones.
Creates a Connected App in Salesforce to enable OAuth authentication for external applications. Connected Apps are required for any external system that wants to connect to Salesforce via OAuth 2.0. Specify callback URLs for the OAuth flow, OAuth scopes (api, web, full, offline_access, etc.), and contact email. Used for web apps, mobile apps, desktop apps, or server-to-server integrations.
Creates an External Client App (ECA), Salesforce's newer replacement for Connected Apps, for OAuth authentication and server-to-server integrations. Prefer this over sf_create_connected_app: on ECAs, Client Credentials Flow — including which user it runs as — is fully configurable via this tool (enableClientCredentialsFlow + clientCredentialsFlowUser), whereas on classic Connected Apps that same setting can only be picked in Setup UI. Deploys all 3 underlying metadata records (ExternalClientApplication, ExtlClntAppOauthSettings, ExtlClntAppOauthConfigurablePolicies) in one call. Use 'Chatbot' and/or 'SFApiPlatform' scopes for any app that needs to call the Salesforce Agent API (e.g. testing an Agentforce agent's conversation flow) or a bot's Messaging API. NOTE: the Consumer Key/Secret this app needs to actually mint a token can still only be viewed once in Setup → External Client Apps → [name] → Settings → OAuth Settings — no Salesforce API exposes it, for either app type.
Creates an External Data Source for Salesforce Connect, enabling read-write access to data stored outside Salesforce without importing it. Supports OData 2.0/4.0 for standard REST services, SimpleURL for basic access, Apex for custom adapters. The external data then appears as External Objects (__x) in Salesforce.
Creates an External Object (ending in __x) linked to an External Data Source. External Objects look like regular Salesforce objects but their data lives in an external system. They support lookups from standard/custom objects, appear in related lists, and can be used in reports. Requires an existing External Data Source.
Creates a Remote Site Setting to allow an external URL for Apex callouts. Salesforce blocks outbound HTTP calls by default — adding a Remote Site Setting allows Apex code to call that URL. Required for any external API callout from Apex or Flows. Use with sf_create_named_credential for authenticated callouts.
Creates a Content Security Policy trusted site, allowing LWC components and Visualforce pages to load resources from external URLs. CSP settings are needed when your LWC uses external JavaScript libraries, fonts, images, or APIs. Specify which directives (connect-src, script-src, style-src, img-src, etc.) the URL is trusted for.
Creates a Salesforce Report using the Report metadata type. Supports Tabular, Summary, Matrix, and Joined formats. Specify the report type (e.g., Accounts, Opportunities), columns to display, and optional filters. Reports are created in the specified folder or your personal folder by default.
Updates an existing Dashboard's title or description by reading the current configuration from the org and applying changes. The dashboard must already exist. For structural changes (adding/removing components), use sf_create_dashboard to create a new version.
Creates a folder for organizing Reports or Dashboards. Folder access types: Hidden (only owner), Shared (explicit sharing), Public (all users). After creating, use sf_share_report_folder to grant access to specific users, roles, or groups.
Shares a Report or Dashboard folder with users, roles, groups, or territories. Sets access levels (View, Edit, Manage) per share recipient. Use after creating a folder to grant team members access.
Creates a new Salesforce user via the REST API. Requires username (must be unique and email-like), lastName, email, and profileName. The profile must already exist. Optionally assign a role by roleApiName (DeveloperName of the UserRole). The user will receive a welcome email unless email confirmations are suppressed in org settings.
Updates an existing Salesforce user's properties via the REST API. Look up the user by username and update fields like firstName, lastName, email, title, department, phone, or isActive (to deactivate/reactivate). Only fields you provide are updated.
Adds a user to an existing Queue (GroupMember SObject) by username and queue DeveloperName. The queue must already exist (create via sf_create_queue). Users in queues can be assigned records and receive queue notification emails.
Creates a Public Group (Group SObject with Type=Regular) for sharing rules, email distribution, or queue membership. Public groups can include users, roles, and other groups. Use as a sharing target in sf_create_sharing_rule.
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").
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)
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.
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".
Updates object-level properties of an existing CUSTOM object (label, plural label, description, feature toggles, sharing model, deployment status). Only the properties you pass are changed. Fields, validation rules, record types and list views are never included in the payload, so they cannot be affected by this call. Changes are classified by risk. SAFE changes (labels, description, feature toggles) apply immediately. GUARDED changes (sharingModel, deploymentStatus) do NOT apply on the first call: you get back an impact report — what references this object, plus Salesforce's own validate-only deploy verdict — and must call again with confirmImpact: true to apply. Standard objects are rejected.
Updates an existing CUSTOM field's definition. Only the properties you pass are changed; every other property is preserved, and no other field on the object is touched. Every change is classified by risk before anything is written: - SAFE (label, description, help text, trackHistory, visibleLines) — applied immediately. - GUARDED (required, unique, externalId, defaultValue, length/precision increase) and DESTRUCTIVE (length/precision/scale REDUCTION, removing picklist values, restricting a picklist) — NOT applied on the first call. You receive an impact report: which components reference the field, how many records hold a value in it, and Salesforce's validate-only deploy verdict. Review it with the user, then call again with confirmImpact: true to apply. - REFUSED: changing a field's 'type', or renaming its API name. Both can destroy data or break string references invisible to any dependency API — do them in Setup, where Salesforce shows the conversion warnings. For pure impact analysis without any intent to change, use sf_get_metadata_dependencies instead.
Creates a single SObject record via the Salesforce REST API. Provide the object API name and a fields object with field API names and values. For bulk creation (100+ records), use sf_bulk_import_records instead.
Updates an existing SObject record by record ID via the Salesforce REST API. Provide the object API name, the 15 or 18 character record ID, and the fields to update. Only provided fields are changed — omitted fields retain their current values.
Bulk imports records using the Salesforce Bulk API 2.0. Supports insert, upsert, update, and delete operations on large datasets (thousands to millions of records). Provide CSV data with a header row. For upsert, set externalIdField to the field used for matching. Polls until the job completes and returns success/failure counts.
Deletes a single SObject record by record ID via the Salesforce REST API. The deletion is permanent and cannot be undone (the record goes to the Recycle Bin for objects that support it, from where it can be undeleted within 15 days). Provide the object API name and the 15 or 18 character record ID. For bulk deletions (100+ records), use sf_bulk_import_records with operation='delete'.
Sends an email from Salesforce using the emailSimple invocable action. The email is sent from the running user's email address through Salesforce's email infrastructure (respects org email deliverability settings). toAddresses: one or more recipient email addresses body / htmlBody: email body content (htmlBody takes precedence) templateName: use an existing email template instead of providing body text whatId: related record ID (e.g. Opportunity, Case) — links the email as an activity whoId: Contact or Lead ID — links the email to the person record saveAsActivity: saves the email as an EmailMessage activity (default: true) Note: Salesforce email limits apply (daily email limits based on org edition). Mass emails should use list email features instead.
Exports Salesforce records as CSV data using a SOQL query. Useful for data extraction, backup, or analysis. soql: the SOQL query to run (SELECT fields FROM Object WHERE ...) includeHeader: include column headers in the CSV output (default: true) maxRecords: maximum records to export (default: 50000 — use Bulk API for larger datasets) Returns the CSV content as a string. For very large exports (>50k records), use sf_bulk_import_records with operation='query' instead.
Creates or updates a Salesforce record using an External ID field for matching. If a record with the given external ID value exists, it is updated; otherwise a new record is created. objectApiName: the SObject API name (e.g. 'Account', 'Contact') externalIdField: the External ID field API name used for matching (e.g. 'Legacy_Id__c') externalIdValue: the value to match on fields: the field values to set on the record
Retrieves a single Salesforce record by its 15 or 18 character record ID. Returns all or specified fields. objectApiName: the SObject API name (e.g. 'Account', 'Opportunity') recordId: the 15 or 18 character Salesforce record ID fields: optional list of field API names to return (omit for all fields)
Searches across multiple Salesforce objects using SOSL (Salesforce Object Search Language). SOSL uses the search index and is faster than SOQL for cross-object text searches. searchTerm: the text to search for objects: array of objects to search with optional fields list, e.g. [{ objectName: 'Account', fields: ['Id', 'Name'] }, { objectName: 'Contact', fields: ['Id', 'Name', 'Email'] }] searchGroup: where to search — ALL FIELDS (default), NAME FIELDS, EMAIL FIELDS, or PHONE FIELDS limit: max records per object (default: 20, max: 200)
Creates a Data Category Group with categories for classifying Salesforce Knowledge articles, solutions, or cases. Data categories enable hierarchical content classification and visibility controls. fullName: data category group API name label: display label objectUsage: object type to categorize (e.g. 'KnowledgeArticle') categories: top-level categories with optional sub-categories
Inserts multiple records of the same object type asynchronously using Salesforce Bulk API 2.0. More efficient than individual REST calls for large volumes. Returns a job ID to track status. objectApiName: Salesforce object API name records: array of record objects with field:value pairs externalIdField: if provided, performs an upsert on this external ID field instead of insert
Updates multiple records of the same object type asynchronously using Salesforce Bulk API 2.0. Each record must include its Salesforce Id field. Returns a job ID to track status. objectApiName: Salesforce object API name records: array of records — each must include 'Id' plus fields to update
Deletes multiple records by ID asynchronously using Salesforce Bulk API 2.0. Returns a job ID to track status. Use with caution — deleted records go to the Recycle Bin. objectApiName: Salesforce object API name ids: array of Salesforce record IDs to delete
Creates a custom field with externalId=true on a Salesforce object. External ID fields can be used for upsert operations and integration matching. The field is also automatically marked as unique. objectName: object API name fullName: field API name ending in __c label: display label type: field type (Text, Number, Email, or AutoNumber) length: max length for Text fields
Creates an OmniStudio FlexCard (OmniUiCard metadata type). FlexCards display contextual data on Lightning pages and Experience Cloud sites. A FlexCard defines: - A data source (SOQL query, DataRaptor, Integration Procedure, Apex, or None) - Fields to display from the data source - Actions the user can take (navigate, launch OmniScript, open URL, start Flow) - States (card variations based on data conditions) The card is created in inactive state. Use sf_activate_flexcard to activate it after creation. dataSourceType options: - SOQL: provide a dataSourceName with a SOQL query string - DataRaptor: provide the DataRaptor interface name - IntegrationProcedure: provide the Integration Procedure key (Type_SubType) - Apex: provide the Apex class name - None: no data source (static card)
Updates an existing OmniStudio FlexCard (OmniUiCard). Reads the current definition, merges the provided changes, and redeploys. Provide only the fields you want to change. The card will be deactivated automatically if active — use sf_activate_flexcard to reactivate after the update. All fields arrays (fields, actions, states) are replaced entirely if provided.
Activates an OmniStudio FlexCard so it is visible on Lightning pages and Experience Cloud sites. Reads the existing FlexCard definition and redeploys it with isActive=true. The card must already exist (created with sf_create_flexcard).
Retrieves the configuration of an OmniStudio FlexCard including its data source, fields, actions, states, and activation status.
Creates an OmniStudio OmniScript — a guided interaction flow for collecting data or performing processes. OmniScripts are identified by Type + SubType + Language (e.g. AccountOpening / Personal / English). The fullName becomes Type_SubType_Language. The script is created inactive with the specified elements. Complex element configuration (branching logic, custom LWC overrides, remote actions) should be finalized in the OmniScript Designer after creation. isLwcEnabled: true deploys the script as a Lightning Web Component (recommended for performance). isOmniScriptEmbeddable: true allows embedding this script inside other OmniScripts. Use sf_activate_omniscript to activate after creation.
Updates an existing OmniScript's metadata properties (description, LWC mode, embeddable flag). Identified by Type + SubType + Language. Note: OmniScript element/step editing is best done in the OmniScript Designer. This tool updates the container metadata only. The script will be deactivated if currently active — reactivate with sf_activate_omniscript.
Activates an OmniScript so it can be launched from FlexCards, Experience Cloud, or standalone pages. Identified by Type + SubType + Language.
Retrieves the configuration of an OmniScript including its elements, activation status, and LWC settings. Identified by Type + SubType + Language.
Creates a DataRaptor interface for OmniStudio data transformation. DataRaptors handle Extract (read from Salesforce), Transform (convert data formats), and Load (write to Salesforce) operations. interfaceType: - Extract: reads data from Salesforce objects using SOQL-like field mappings - Transform: converts/maps data between formats (JSON path transformations) - Load: writes data to Salesforce objects Each field mapping defines: - sourceField: source JSON path or Salesforce field API name - targetField: target JSON path or Salesforce field API name - dataType: data type (Text, Number, Boolean, Date, etc.) - formula: optional transformation formula filterCriteria: SOQL WHERE clause for Extract DataRaptors (e.g. "Id = ':AccountId'")
Retrieves the configuration of a DataRaptor interface including its type, field mappings, and filter criteria.
Creates an OmniStudio Integration Procedure — a server-side process that orchestrates data integration without UI. Integration Procedures run in Apex context and can be invoked from OmniScripts, FlexCards, or APIs. Integration Procedures use the OmniScript metadata type with omniProcessType=IntegrationProcedure. The fullName is ProcedureName_SubType. Element types: - DataRaptor: call a DataRaptor for Salesforce CRUD - HTTPAction: call an external REST/SOAP API - Response: return data to the caller - Loop: iterate over a collection - Conditional: branch based on conditions - SetValues: set variables - ExceptionBlock: handle errors - Matrix: call a Calculation Matrix - OmniScript: call a nested OmniScript - Aggregate: combine multiple data sources Set isActive: true to activate immediately after creation.
Updates an existing Integration Procedure's metadata (description, active status). Identified by procedureName + subType (fullName = procedureName_subType). For element/step changes, use the OmniStudio Integration Procedure Designer. Set isActive: false to deactivate, then make changes, then sf_activate_integration_procedure.
Retrieves the configuration of an Integration Procedure including its elements and activation status. Identified by procedureName + subType.
Activates an Integration Procedure so it can be invoked from OmniScripts, FlexCards, and APIs. Identified by procedureName + subType.
Creates a Calculation Matrix for rule-based lookups and calculations. Matrices map input combinations to output values — useful for pricing, eligibility, scoring, and decision tables. inputVariables: list of input variable names (columns used for lookups) outputVariables: list of output variable names (columns returned) rows: array of { inputs: {var: value}, outputs: {var: value} } defining the lookup table Example: a pricing matrix with inputs [ProductType, Region] and outputs [Price, Discount].
Creates a Calculation Procedure that orchestrates multi-step calculations using Calculation Matrices, formulas, and logic steps. steps array — each step has: - name: step identifier - type: MatrixLookup (call a matrix), Formula (expression), Condition (branch), Assignment (set variable) - matrixName: required for MatrixLookup steps - expression: required for Formula/Condition steps - inputMap: maps procedure variables to step inputs - outputMap: maps step outputs back to procedure variables Use Calculation Procedures to build complex pricing engines, eligibility calculators, or multi-factor scoring systems.
Exports an OmniStudio component's metadata as a JSON string for backup, version control, or migration to another org. componentType: FlexCard, OmniScript, DataRaptor, IntegrationProcedure, CalculationMatrix, or CalculationProcedure componentName: the API name / fullName of the component to export (for OmniScript, use Type_SubType_Language format) Returns the component metadata as a JSON-serialized XML string.
Imports an OmniStudio component into the org from previously exported JSON (from sf_export_omnistudio_component). Optionally renames the component on import. componentType: FlexCard, OmniScript, DataRaptor, IntegrationProcedure, CalculationMatrix, or CalculationProcedure exportedJson: the JSON string returned by sf_export_omnistudio_component newComponentName: optional new name/fullName for the imported component (useful when migrating to a different name)
Creates an OmniStudio Document Generation configuration (OmniDocumentGenerationConfig metadata type) that links a document template to a data source for automated document creation. templateName: unique API name for the document generation config label: display label objectApiName: the Salesforce object this template generates documents for templateType: Word, PDF, or Excel (default: Word) dataSourceType: DataRaptor or IntegrationProcedure (default: DataRaptor) dataSourceName: API name of the DataRaptor or Integration Procedure to use for data description: optional description
Creates an OmniChannel Service Channel that connects work items from a Salesforce object to the OmniChannel routing engine. channelType options: Case, Chat, Messaging, Voice, Email, SocialPost, Custom relatedObjectApiName: the Salesforce object this channel routes (e.g. "Case", "LiveChatTranscript", "MessagingSession"). Required for Custom type. capacity: maximum number of simultaneous work items an agent can handle on this channel (default 1). Service Channels are referenced by Routing Configurations and Presence Configurations.
Creates a Routing Configuration that defines how work items are assigned to agents. routingModel options: - LeastActive: routes to the agent with the fewest active work items - MostAvailable: routes to the agent with the most available capacity - ExternalRouting: custom routing via Apex or external system capacity: agent capacity consumed per work item (1–100) priority: routing priority (lower number = higher priority, range 1–10) unitType: Percentage or Throughput (how capacity is measured) pushTimeout: seconds before a declined/unanswered item is re-queued (optional) After creating, link it to a queue with sf_create_queue_routing_config.
Associates a Routing Configuration with an existing Queue, enabling OmniChannel routing for that queue. After creating a Routing Configuration (sf_create_routing_configuration), use this tool to link it to the Queue that holds the work items. Work items assigned to the queue will then be routed to agents using the specified routing model. queueDeveloperName: the API name of the Queue (DeveloperName, not label) routingConfigName: the API name of the Routing Configuration to link
Creates a Presence Configuration (PresenceUserConfig) that controls which Service Channels agents can handle and their total work capacity. capacity: total capacity units available to agents with this configuration serviceChannels: list of Service Channel API names the agents can work on allowAgentsToChangeStatus: whether agents can manually change their presence status Assign this configuration to agents via their Profile or Permission Set.
Creates a Presence Status that agents can set to indicate their availability. statusType: - Online: agent is available for all assigned channels - Busy: agent is limited to specific channels - Offline: agent receives no work items serviceChannels: for Busy status, list which channels remain active. After creating, assign the status to profiles/permission sets with sf_assign_presence_status.
Grants access to a Presence Status for the specified Profiles and/or Permission Sets. Agents can only select presence statuses that are assigned to their profile or permission set. profiles: list of Profile names (e.g. ["Standard User", "Service Agent"]) permissionSets: list of Permission Set API names Either profiles or permissionSets must be provided (or both).
Creates a Skill that can be assigned to service agents. Skills are used for: - OmniChannel skill-based routing (route work to agents with required skills) - Field Service Lightning (assign skills to resources, skills to work types) After creating a skill, assign it to agents with sf_assign_skill_to_agent.
Assigns a Skill to a Salesforce user (service agent) with a skill level rating. Creates a ServiceResource for the user if one does not already exist, then creates a ServiceResourceSkill record. skillName: the API name (DeveloperName) of the skill to assign username: the Salesforce username (e.g. [email protected]) or user ID skillLevel: proficiency level from 0 to 10 (default 5) ServiceResource is the Field Service / OmniChannel representation of a user as a workable resource.
Creates a Service Territory for Field Service Lightning. Territories define the geographic areas or organizational divisions where field service resources operate. isActive: set true to make the territory immediately available for scheduling operatingHoursName: API name of an existing OperatingHours record to set business hours Address fields (street, city, state, country, postalCode): optional location for the territory center
Creates a Work Type that defines a category of field service job. Work Types set default durations, block times, and skill requirements for work orders. estimatedDuration: expected time to complete the work durationType: Minutes, Hours, or Days blockTimeBeforeWork: travel/prep time before the appointment blockTimeAfterWork: cleanup/travel time after the appointment skillRequirements: array of { skillName, skillLevel } — skills required on the resource to perform this work type
Creates a Messaging Channel for Salesforce digital engagement (SMS, WhatsApp, Facebook Messenger, Apple Messages for Business, etc.). channelType options: SMS, WhatsApp, Facebook, AppleBusinessChat, Line, GoogleBusinessMessages, EinsteinBotChannel, WebChat phoneNumber: E.164 format phone number for SMS/WhatsApp channels (e.g. +15551234567) pageId: Facebook Page ID or equivalent external platform identifier routingType: Queue (route to a queue) or Bot (route to an Einstein Bot first) queueName: required when routingType=Queue botName: required when routingType=Bot (bot handles initial messages) After creating, configure the channel with sf_create_embedded_service to add it to a site.
Creates a Live Chat button (LiveChatButton) that can be embedded on websites to start chat sessions with agents. routingType: Choice (skills-based) or Queue (queue-based routing) queueName: the Queue to route chats to (for Queue routing) botName: an Einstein Bot to handle chats initially (optional) windowLanguage: display language for the chat window (e.g. "en_US", "fr", "de") inviteRenderer: name of a custom Visualforce page for chat invitations customAgentName: agent display name shown to website visitors optionsHasTimeoutAlert: show alert if no agent available within timeout period After creating, embed the chat button on a site with sf_create_embedded_service.
Creates an Embedded Service deployment (EmbeddedServiceConfig) that bundles a chat button or messaging channel into a web snippet for embedding on websites or Experience Cloud sites. channelType: Chat (uses a LiveChatButton) or Messaging (uses a MessagingChannel) chatButtonName: required for Chat type — the LiveChatButton API name messagingChannelName: required for Messaging type — the MessagingChannel API name site: the Experience Cloud site or Salesforce Site API name to associate with Branding: - primaryColor: main brand color (hex, e.g. "#0070D2") - secondaryColor: secondary/header color - fontName: web font name (e.g. "Salesforce Sans") After creation, get the deployment code snippet from Setup → Embedded Service Deployments.
Configures an Einstein Bot to transfer conversations to a human agent queue when escalation conditions are met. Updates the BotVersion with a Transfer dialog. botName: the Bot API name (DeveloperName) transferToQueueName: the Queue API name to transfer escalated conversations to transferMessage: message shown to the customer during transfer (default: "Connecting you to an agent...") escalationConditions: array of { trigger, action } pairs. Triggers: agentRequested, noResponse, fallback. Actions: TransferToQueue. This tool finds the latest BotVersion for the specified bot and adds the transfer dialog. The bot must already exist (created via Setup or sf_create_agent).
Queries the SetupAuditTrail object to see who made what configuration changes to the org, and when. Covers the last 6 months of setup activity. Returns records with: date, username, section, action, display (human-readable description) section filter examples: 'Custom Fields', 'Profiles', 'Flows', 'Apex Classes', 'Permission Sets', 'Connected Apps', 'Users' Useful for: - Security audits (who changed profiles or permissions) - Debugging unexpected configuration changes - Compliance reporting on org configuration changes
Queries LoginHistory to see user login activity — who logged in, from where, and whether they succeeded. Returns records with: loginTime, username, sourceIp, browser, platform, status, loginType status values: 'Success', 'Failed', 'No Password', 'Blocked', 'No Cookie' loginType values: 'Application', 'API', 'SAML', 'OAuth', 'LightningLogin', 'Chatter' Useful for: - Security monitoring (failed logins, unusual IP addresses) - Compliance auditing (who accessed the org and when) - Investigating suspicious account activity Note: LoginHistory covers the past 6 months.
Queries EventLogFile for detailed activity logs. Event logs capture granular org activity for security monitoring and performance analysis. Common eventType values: - Login — login attempts and results - API — SOAP/REST API calls - Report — report executions - Flow — Flow runs and executions - ApexExecution — Apex code executions - LightningPageView — Lightning page views - RestApi — REST API requests - VisualforceRequest — Visualforce page requests - URI — general HTTP requests - LightningError — Lightning component errors Returns parsed CSV log entries (up to 20 rows per log file, up to 3 files per call). Requires Event Monitoring add-on OR Agentforce debug logs to be enabled.
Queries the {Object}History object to retrieve a field-level change history for a specific record. Shows what changed, when, the old and new values, and who made the change. Returns records with: date, field, oldValue, newValue, changedBy objectApiName: the SObject with history tracking enabled, e.g. 'Account', 'Opportunity', 'Case' recordId: the specific record to retrieve history for Note: Field history tracking must be enabled for the object and for each field you want to track (Setup → Object Manager → {Object} → Fields & Relationships → Field History Tracking). History is retained for up to 18 months.
Creates an Einstein Prediction Builder prediction definition (MLPredictionDefinition metadata type). Predictions analyze historical Salesforce data to score or classify records automatically. predictionType: - BinaryClassification: predict a yes/no outcome (e.g. Will this opportunity close? Is this lead likely to convert?) - Regression: predict a numeric value (e.g. Expected revenue, likelihood score) targetField: the field the prediction is based on (e.g. 'IsWon' for BinaryClassification on Opportunity) pushbackField: an existing custom field to write the prediction score to automatically IMPORTANT: Einstein Prediction Builder requires an Einstein Analytics license or the Einstein Platform add-on. If the org lacks this license, the metadata deployment will succeed but the prediction cannot be trained or activated. This tool creates the definition — training happens in Setup → Einstein → Prediction Builder. The prediction is created in Draft status. Activate it from Setup after training is complete.
Creates a Next Best Action (NBA) recommendation strategy (RecommendationStrategy metadata type). NBA strategies surface contextual recommendations to agents and customers on record pages, communities, and chatbots. A strategy defines: - contextObjectApiName: the record type that provides context (e.g. 'Account', 'Case', 'Opportunity') - recommendations: a list of actions the agent can offer, each with Accept/Decline buttons and an optional Flow to execute on acceptance NBA strategies can be displayed via: - Einstein Next Best Action component on a Lightning Record Page - OmniScripts and FlexCards - Service Console After creating, add the "Einstein Next Best Action" Lightning component to a record page and configure it to use this strategy.
Creates a classic Einstein Bot (Bot + BotVersion metadata types) with one or more conversation dialogs. Classic Einstein Bots handle chat and messaging channels via rule-based and ML-powered conversation flows. Note: For AI-first agents using large language models, use sf_create_agent (Agentforce/Einstein Service Agent) instead. Classic Einstein Bots are best suited for: - Structured FAQ automation - Simple data collection workflows - Channels that don't support Agentforce (SMS, WhatsApp via classic routing) Each dialog defines: - name/label: the dialog identifier - utterances: training phrases that trigger this dialog - messages: bot responses shown to the user - type: Main (user-facing), System (internal), Rule (condition-based) The bot is created with an ML domain for intent classification. After creation: 1. Train the bot in Setup → Einstein Bots → {BotName} → Train 2. Activate the bot 3. Connect it to a messaging channel or chat button
Creates a new UserRole in the Salesforce Role Hierarchy. Roles control record visibility — users in higher roles can see records owned by users in lower roles (depending on OWD). Optionally set a parentRoleName to place this role beneath an existing role. roleName: API name for the role (no spaces, used as DeveloperName) label: display name shown in Setup parentRoleName: API name of the parent role (omit for a top-level role) description: optional description
Resets a Salesforce user's password by username or user ID. Sends a password-reset email to the user's email address. Use when a user is locked out or needs to set a new password. username or userId: identify the user (at least one required) sendEmail: set false to reset without sending an email (default: true)
Freezes or unfreezes a Salesforce user account. A frozen user cannot log in but the license is retained (unlike deactivation). Useful for temporarily blocking access without losing data ownership. username or userId: identify the user freeze: true to freeze, false to unfreeze
Creates a Territory in Enterprise Territory Management (ETM). Territories define logical sales regions or account groupings. Requires ETM to be enabled in the org. territoryName: API name (DeveloperName) of the territory label: display name territoryType: DeveloperName of the Territory2Type (e.g. 'Geographic', 'Named_Account') parentTerritoryName: optional parent territory DeveloperName for hierarchical nesting description: optional description
Assigns a user to an Enterprise Territory Management territory via the UserTerritory2Association SObject. Users assigned to a territory get visibility into accounts in that territory. username or userId: identify the user territoryName: DeveloperName of the Territory2 to assign roleInTerritory: optional role — 'Salesperson', 'Manager', or 'BusinessUser'
Configures a Collaborative Forecasting hierarchy entry by assigning a user as a forecast manager for another user. Forecast managers can view and adjust forecasts for their reports. managerUsername: username of the forecast manager reporteeUsername: username of the user being managed forecastingType: the forecasting type DeveloperName (e.g. 'OpportunityRevenue')
Creates or updates a SearchLayout for a Salesforce object, defining which fields appear in search results, lookup dialogs, and lookup filter fields. Use to customize what columns users see when they search for records or open a lookup dialog. objectName: the API name of the object, e.g. 'Account' or 'Invoice__c' searchResultsAdditionalFields: field API names to show as columns in global search results lookupDialogsAdditionalFields: field API names to show in lookup dialog results lookupFilterFields: field API names used as filterable columns in lookups
Assigns an existing page layout to a specific record type on an object by updating the Profile metadata. Controls which page layout users see when viewing records of a given record type. objectName: the API name of the object recordTypeName: developer name of the record type layoutName: full name of the page layout, e.g. 'Account Layout' profileNames: optional list of profile names to update (defaults to Admin profile)
Creates a Custom Web Tab (URL-based tab) that opens an external URL or web page within the Salesforce UI. Different from sf_create_tab which creates object-based tabs. Use when you need a navigation item that points to an external website, an internal Visualforce page by URL, or a custom web app. fullName: API name for the tab (no spaces, e.g. 'My_Web_Tab') label: display label shown in the tab bar url: the URL the tab points to, e.g. 'https://example.com' description: optional description hasSidebar: whether to show the Salesforce sidebar alongside the tab content
Retrieves current API and governor limit usage for the org via the Salesforce Limits REST API. Returns all limits with their current usage and maximum allowed values. Useful for: - Checking API call usage before running bulk operations - Monitoring storage (data/file) usage - Checking concurrent Apex job limits - Reviewing email delivery limits - Auditing active sessions Returns an array of { name, remaining, max, percentUsed } sorted by percent used (most consumed first).
Retrieves Flow interview fault records from the FlowRecordRelation and FlowInterview objects. Shows flows that have errored in runtime with their fault message and the record that triggered the error. flowApiName: filter to a specific flow API name (optional — returns errors for all flows if omitted) lookbackHours: how many hours back to search (default: 24, max: 168) limit: maximum records to return (default: 50) Returns: flow name, start time, error message, and related record ID for each fault.
Retrieves Apex test results from the most recent test runs via the Tooling API. Returns pass/fail status, error messages, stack traces, and code coverage for each test method. className: filter to a specific test class name (optional) outcome: filter by outcome — 'Pass', 'Fail', 'Skip', or omit for all limit: maximum results to return (default: 100) Returns: class name, method name, outcome, run time (ms), error message, and stack trace for failures.
Retrieves the history of recent metadata deployments using the Tooling API DeployRequest object. Shows deployment status, component counts, test results, and error messages. limit: number of recent deployments to return (default: 20, max: 200) status: filter by status — 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Pending', or omit for all Returns: deploy ID, status, start time, end time, component totals, test totals, and any errors.
Turns on Apex debug logging for a user by creating a DebugLevel and TraceFlag via the Tooling API. Required before sf_get_debug_logs will return anything new — Salesforce does not log activity unless a trace flag is active for that user. username: username of the user to trace, e.g. '[email protected]' durationMinutes: how long tracing stays active (default 30, max 1440) debugLevel: Apex code log granularity — FINEST (most verbose, recommended for debugging) down to ERROR After enabling, have the user (or an automated process) perform the action you want to debug, then call sf_get_debug_logs to list the resulting logs and sf_get_debug_log_body to read one.
Turns Apex debug logging back off by deleting active TraceFlag records via the Tooling API. The counterpart to sf_enable_debug_logs. username: stop tracing for this user. Omit to disable ALL active trace flags in the org. includeExpired: also clean up already-expired trace flags (off by default — expired flags are already inert and sweeping them makes the count look alarming for nothing). Trace flags set by sf_enable_debug_logs expire on their own, so this is for stopping early — typically once you have captured the log you needed, to avoid filling the org's log allocation. Logs already captured are retained by Salesforce for 24 hours and stay readable via sf_get_debug_logs afterwards.
Lists recent Apex debug logs (ApexLog records) via the Tooling API. Use sf_enable_debug_logs first if no logs are showing up — Salesforce only logs activity for users with an active trace flag. username: filter to logs generated by this username (optional) operation: filter by operation substring, e.g. 'execute_anonymous_apex' (optional) limit: maximum log entries to return (default 10, max 100) Returns log metadata (ID, start time, duration, status, operation) but not the log content — pass a logId to sf_get_debug_log_body to read the full log.
Retrieves the full text content of a single Apex debug log by ID. Get the logId from sf_get_debug_logs first. Logs are retained by Salesforce for 24 hours only.
Creates a Letterhead that provides a consistent visual wrapper for HTML email templates. Letterheads define header, body, and footer colors and can be referenced by email templates to ensure brand consistency across automated emails. fullName: letterhead API name name: display name backgroundColor: page background color hex, e.g. '#FFFFFF' bodyColor: body area background color hex headerColor: header section background color hex description: optional description
Creates a Custom Notification Type for sending in-app and mobile push notifications. Custom notification types can be triggered from Flows, Apex, or Process Builder. Users receive notifications in the Salesforce Bell icon (desktop) and on the Salesforce mobile app. fullName: notification type API name masterLabel: display label customNotifTypeName: developer name for the notification type description: optional description
Creates a Salesforce scratch org using the SF CLI. Scratch orgs are temporary, configurable environments for development and testing. Requires a Dev Hub org to be authorized. definitionFile: path to project-scratch-def.json (optional, defaults to CLI default) alias: alias for the scratch org duration: number of days before expiry (1–30) devHubAlias: Dev Hub org alias
Deletes a Salesforce scratch org by alias. This permanently removes the org and all its data. Use when finished with development or testing to free up scratch org allocations. alias: alias of the scratch org to delete noPrompt: skip the confirmation prompt (default: true)
Creates a second-generation managed or unlocked package using the SF CLI. Packages bundle metadata for distribution. Managed packages support namespacing and AppExchange listing; unlocked packages support source-tracking without namespacing. name: package name packageType: Managed or Unlocked path: source path for the package, e.g. 'force-app' description: optional description noNamespace: create without a namespace (Unlocked packages only)
Creates a new version of an existing second-generation package. Each version captures the current state of the package source. Package versions can be promoted and installed in target orgs. packageId: Package ID (0Ho...) or package alias installationKey: optional key to protect the version codeVersion: version number, e.g. '1.0.0.NEXT' wait: minutes to wait for version creation to complete
Installs a package version into a target org using the SF CLI. Supports both managed and unlocked packages. Requires the package version ID (04t...) or an alias. packageId: package version ID (04t...) or alias targetOrg: target org alias (defaults to SF_ALIAS env var) installationKey: installation key if the package version is protected wait: minutes to wait for installation to complete
Uninstalls a second-generation package from a target org using the SF CLI. Removes all metadata delivered by the package. Use before reinstalling a broken package, or to clean up a package no longer needed. packageId: package version ID (04t...) or alias to uninstall targetOrg: target org alias (defaults to SF_ALIAS env var) wait: minutes to wait for uninstall to complete
Creates a work item in Salesforce DevOps Center. Work items represent units of work (features, bug fixes, etc.) that move through pipeline stages from development to production. name: work item name/title description: optional description pipelineStageId: optional pipeline stage ID to assign to assignedToId: optional user ID to assign the work item to
Promotes a DevOps Center work item to the next pipeline stage. Moving work items through the pipeline represents the progression of changes from development environments toward production. workItemId: the DevOps Center work item record ID
Retrieves Apex code coverage statistics from the org using the Tooling API. Shows which classes meet or fail the 75% coverage threshold required for deployment. Use after running Apex tests to assess coverage. className: optional filter to show only classes matching this name minCoverage: optional threshold — only return classes below this coverage percentage
Checks a DevOps Center work item for merge conflicts. Returns the work item details and any associated merge conflict records. Use before promoting a work item to identify conflicts that need resolution. workItemId: DevOps Center work item ID
Marks a merge conflict in DevOps Center as resolved with a specified resolution strategy. Use after manually resolving conflicts in the source control system. conflictId: merge conflict record ID resolution: resolution strategy — 'ours' (keep our changes), 'theirs' (accept incoming), or 'manual' (already resolved)
Checks out a DevOps Center work item, moving it to 'In Progress' status. This signals that a developer is actively working on the changes for this work item. workItemId: DevOps Center work item ID to check out
Commits changes for a DevOps Center work item by creating a commit record associated with the work item. Records the commit message for audit tracking. workItemId: DevOps Center work item ID message: commit message describing the changes
Creates a pull request record for a DevOps Center work item. Pull requests represent code review requests before merging changes to a target branch or pipeline stage. workItemId: DevOps Center work item ID title: pull request title description: optional pull request description
Lists all DevOps Center projects in the org. Returns project names, IDs, and associated pipeline information. Use to discover project IDs needed for other DevOps Center operations.
Lists DevOps Center work items, optionally filtered by project or pipeline stage. Use to get an overview of work in progress. projectId: optional filter by DevOps Center project ID stageId: optional filter by pipeline stage ID limit: maximum records to return (default: 20)
Retrieves the commit and deployment status for a DevOps Center work item. Shows recent commits and their deployment outcomes. workItemId: DevOps Center work item ID
Promotes a DevOps Center work item to a specific pipeline stage by ID. Use to move work items forward in the pipeline when you know the exact target stage. workItemId: DevOps Center work item ID targetStageId: ID of the target pipeline stage
Creates a Salesforce Product2 record. Products represent items or services that can be added to Opportunities and Quotes via Opportunity Line Items. Use with sf_create_price_book to set pricing. name: product name productCode: optional SKU or product code description: optional description isActive: whether the product is available for use (default: true) family: product family/category, e.g. 'Hardware' quantityUnitOfMeasure: unit of measure, e.g. 'Each', 'Hour'
Creates a Pricebook2 record and optionally adds products with pricing via PricebookEntry records. Price books define the prices for your products. Each org has one standard price book; additional custom price books can be used for different customer segments or regions. name: price book name isActive: whether the price book is active isStandard: true only for the standard price book currencyIsoCode: ISO currency code (e.g. 'USD') products: optional array of {productId, unitPrice, useStandardPrice?} to add to the price book
Creates an Entitlement Process (SLA policy) that defines the time-based steps and milestones required to resolve cases. Entitlement processes automate service level agreement (SLA) enforcement. fullName: entitlement process API name name: display name businessHoursName: optional business hours to apply entryStartDateField: field that starts the SLA clock milestones: array of milestone definitions to include
Creates a Milestone Type that can be referenced in Entitlement Processes to define SLA checkpoints. Milestones represent required steps (e.g., 'First Response', 'Resolution') with time-based targets. fullName: milestone type API name name: display name description: optional description recurrenceType: how the milestone repeats — recursIndependently, recursChained, or noRecurrence
Creates a Visualforce page in the Salesforce org via the Metadata API. Provide the page API name, label, and Visualforce markup content (must include an <apex:page> tag). Optionally specify a standard controller, extensions, and whether to show the header/sidebar. The page is deployed immediately and accessible at /apex/PageName.
Creates a reusable Visualforce component (ApexComponent) in the Salesforce org via the Metadata API. Provide the component API name, label, and Visualforce markup (must include an <apex:component> tag). Components can be included in Visualforce pages using <c:ComponentName/>.
Creates a Visualforce email template in the Salesforce org. Provide the template name, subject, recipient type (Contact, Lead, or User), related entity type, and the HTML body with Visualforce markup. A plain-text body is also required for email clients that don't support HTML.
Overview
What is Salesforce Metadata MCP?
Salesforce Metadata MCP is the most comprehensive Model Context Protocol server for Salesforce, providing 212 tools to build, configure, and automate Salesforce orgs directly from MCP clients like Claude.
How to use Salesforce Metadata MCP?
Install via npx -y salesforce-metadata-mcp or npm install -g salesforce-metadata-mcp. Add it to your MCP client configuration (e.g., claude_desktop_config.json) with the server command and required environment variables SF_INSTANCE_URL and SF_ACCESS_TOKEN (or other authentication methods).
Key features of Salesforce Metadata MCP
- 212 tools covering the full Salesforce metadata API
- Objects, fields, automation, security, and UI creation
- Apex and LWC deployment and testing
- Agentforce agent, action, and topic creation
- External integrations like Connected Apps and named credentials
- Change set creation and metadata deployment/retrieval
Use cases of Salesforce Metadata MCP
- Build a complete custom object with fields, validation rules, and page layouts
- Deploy Apex classes, triggers, and test classes to an org
- Create record-triggered flows with email alerts and follow-up tasks
- Set up an Agentforce agent with actions and topics wired together
- Manage deployment via outbound change sets and the Metadata API
FAQ from Salesforce Metadata MCP
How do I authenticate to my Salesforce org?
Set the SF_INSTANCE_URL (always required) and one of: SF_ACCESS_TOKEN for static tokens, SF_CLIENT_ID/SF_CLIENT_SECRET/SF_REFRESH_TOKEN for OAuth, or SF_ALIAS for Salesforce CLI authentication. See SETUP.md for details.
What transports and protocols are supported?
The server supports both stdio (default) and http transports, selectable via the TRANSPORT environment variable. The HTTP server port defaults to 3000 and can be changed with PORT.
What type of tools does the server include?
It includes tools for custom objects/fields, flows and approval processes, security (permission sets, roles, queues), Apex and LWC development, Experience Cloud sites, Agentforce agents, external integrations, and change set management.
Can I use it to deploy changes to production?
Yes, the server includes deployment tools like sf_deploy_metadata (with testLevel support), sf_check_deploy_status, and sf_retrieve_metadata, as well as sf_create_outbound_change_set and sf_add_to_change_set.
What dependencies are required to run it?
No external Salesforce CLI or SDK is required; the server runs on Node.js and connects directly to the Salesforce REST and Metadata APIs using the provided authentication credentials.
Frequently asked questions
How do I authenticate to my Salesforce org?
Set the `SF_INSTANCE_URL` (always required) and one of: `SF_ACCESS_TOKEN` for static tokens, `SF_CLIENT_ID`/`SF_CLIENT_SECRET`/`SF_REFRESH_TOKEN` for OAuth, or `SF_ALIAS` for Salesforce CLI authentication. See [SETUP.md](SETUP.md) for details.
What transports and protocols are supported?
The server supports both `stdio` (default) and `http` transports, selectable via the `TRANSPORT` environment variable. The HTTP server port defaults to 3000 and can be changed with `PORT`.
What type of tools does the server include?
It includes tools for custom objects/fields, flows and approval processes, security (permission sets, roles, queues), Apex and LWC development, Experience Cloud sites, Agentforce agents, external integrations, and change set management.
Can I use it to deploy changes to production?
Yes, the server includes deployment tools like `sf_deploy_metadata` (with testLevel support), `sf_check_deploy_status`, and `sf_retrieve_metadata`, as well as `sf_create_outbound_change_set` and `sf_add_to_change_set`.
What dependencies are required to run it?
No external Salesforce CLI or SDK is required; the server runs on Node.js and connects directly to the Salesforce REST and Metadata APIs using the provided authentication credentials.
Basic information
More Data & Analytics MCP servers

SportsTrackLive
STL SolutionsSportsTrackLive is a remote MCP server available at https://mcp.sportstracklive.com. SportsTrackLive is a Live Tracking solution and let you record, share and relive your Tracks! SportsTrackLive provide a real-time tra

Minds: Synthetic Market Research Panels
MindsMinds is a synthetic market research platform. This MCP server lets ChatGPT, Claude, and Cursor run customer research end to end without leaving the assistant. Describe an audience in a brief ("German Gen Z grocery shopp

Bounce Watch - Company Signal Intelligence
bouncewatchBounce Watch tells you what just changed at a company, and when. Who raised money. Who hired a senior person. Who opened an office, won a customer, or announced a partnership. Every event carries its own date, so you ca

Opinly
Track competitors, rankings, and how AI answers rank you — then write and publish the fix.

LeadMarina
LeadMarinaVerified local-business leads: search any niche in any city, query your lead library, and export to Close, GoHighLevel, Google Sheets, or emailed files — every email SMTP-checked, every phone verified with line type and
Comments