npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

salesforce-cli-mcp

v0.1.7

Published

Salesforce MCP Server wrapping CLI commands

Readme

Salesforce CLI MCP

This MCP server provides Claude with the ability to interact with Salesforce orgs using the Salesforce CLI. The server wraps the sf CLI commands and exposes them through the Model Context Protocol (MCP).

Because it wraps the sf CLI it will have access to your orgs. Models may require some guidance to not provide target orgs if you intend to use the default org of your sf CLI.

Features

  • Authentication: Log in to Salesforce orgs using JWT or access token
  • Org Management: List and display authenticated orgs
  • Metadata Deployment: Validate and deploy metadata to orgs
  • Metadata Retrieval: Retrieve metadata from orgs
  • Project Generation: Create new Salesforce projects and components
  • Apex Execution: Run anonymous Apex code and manage debug logs
  • Schema Generation: Generate metadata for custom objects, fields, platform events, and tabs

Installation

Prerequisites

  • Node.js 18.0.0 or later
  • Salesforce CLI installed and available in your PATH

Installation Options

NPM Package

npm install -g salesforce-cli-mcp

Docker Image

# Build the Docker image
docker build -t mcp/server-salesforce .

# Run the Docker container
docker run -i --rm -v ${HOME}/.sf:/root/.sf mcp/server-salesforce

Build from Source

# Clone the repository
git clone https://github.com/winter-08/salesforce-cli-mcp.git
cd salesforce-cli-mcp

# Install dependencies
npm install

# Build the TypeScript code
npm run build

Adding to Claude

With Claude CLI

You can add the Salesforce MCP server to Claude using the CLI:

# With default working directory
claude mcp add salesforce -- npx -y salesforce-cli-mcp

# With custom working directory
claude mcp add salesforce -- npx -y salesforce-cli-mcp --working-dir /path/to/salesforce/project

With Claude Desktop

Add the following configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "salesforce": {
      "command": "npx",
      "args": [
        "-y",
        "salesforce-cli-mcp",
        "--working-dir",
        "/path/to/salesforce/project",
      ]
    }
  }
}

Verifying Installation

To verify that the Salesforce MCP server is properly registered:

# List all registered MCP servers
claude mcp list

Command Line Options

| Option | Short | Description | |--------|-------|-------------| | --working-dir | -w | Sets the working directory for Salesforce CLI command execution |

Available Tools

Authentication

  • login_jwt: Authenticate to a Salesforce org using JWT
  • login_access_token: Authenticate to a Salesforce org using an access token

Org Management

  • list_orgs: List all authenticated Salesforce orgs
  • display_org: Display information about an authenticated Salesforce org

Metadata Deployment

  • deploy_command: Unified command for deploying or validating metadata (recommended)
  • deploy_validate: Validates a deployment without actually deploying components (legacy)

Metadata Retrieval

  • retrieve_metadata: Retrieves metadata from an org to local directory
  • retrieve_start: Starts an asynchronous retrieve operation

Project Generation

  • project_generate: Generate a new Salesforce project

Apex Execution and Logs

  • apex_run: Execute anonymous Apex code
  • apex_get_log: Get Apex debug logs
  • apex_list_log: List Apex debug logs
  • apex_run_test: Invoke Apex tests in an org
  • apex_get_test: Display test results for a specific asynchronous test run

Schema Generation

  • schema_generate_sobject: Generate metadata source files for a new custom object
  • schema_generate_platformevent: Generate metadata source files for a new platform event
  • schema_generate_field: Generate metadata source files for a new custom field
  • schema_generate_picklist_field: Generate metadata source files for a new custom picklist field
  • schema_generate_relationship_field: Generate metadata source files for a new relationship field (lookup or master-detail)
  • schema_generate_tab: Generate metadata source files for a new custom tab

Templates Generation

  • apex_generate_class: Generate a new Apex class
  • apex_generate_trigger: Generate a new Apex trigger
  • lightning_generate_component: Generate a new Lightning component (Aura or LWC)
  • lightning_generate_app: Generate a new Lightning application
  • lightning_generate_event: Generate a new Lightning event
  • lightning_generate_interface: Generate a new Lightning interface
  • lightning_generate_test: Generate a new Lightning test

Requirements

  • Node.js 18+
  • Salesforce CLI (sf) installed and in your PATH
  • Appropriate Salesforce permissions for the operations you want to perform