Cover image
Try Now
2025-03-30

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

Salesforce MCP Sample Integration

This project provides a basic example of integrating with Salesforce using the Model Context Protocol (MCP). It allows interaction with Salesforce features like sending emails and deploying Apex code through MCP tools.

Prerequisites

  • Node.js and npm (or yarn) installed.
  • A Salesforce org where you can create a Connected App.

Setup

  1. Install Dependencies:

    npm install
    # or
    yarn install
    
  2. Configure Salesforce Credentials:

    • You MUST create a credentials.js file inside a utils folder (./utils/credentials.js).
    • This file needs to export a function getSalesforceCredentials() which returns your Salesforce connection details necessary for JWT Bearer Flow authentication.
    • Important: Ensure you have a Connected App configured in Salesforce for JWT authentication, allowing the appropriate scopes and pre-authorizing the relevant user profile.

    utils/credentials.js Example:

    import fs from 'fs';
    import path from 'path';
    // You might load these from environment variables, a config file, etc.
    
    export function getSalesforceCredentials() {
        // --- IMPLEMENT YOUR LOGIC HERE to securely load credentials ---
        const loginUrl = "YOUR_SALESFORCE_LOGIN_URL"; // e.g., https://login.salesforce.com or https://yourdomain.my.salesforce.com
        const username = "YOUR_SALESFORCE_USERNAME";
        const clientId = "YOUR_CONNECTED_APP_CONSUMER_KEY";
        // Load your private key used to sign the JWT assertion
        // Ensure the key is formatted correctly, including BEGIN/END lines.
        const privateKey = fs.readFileSync(path.resolve(__dirname, 'path/to/your/server.key'), 'utf8'); 
        // Example: const privateKey = process.env.SF_PRIVATE_KEY;
    
        if (!loginUrl || !username || !clientId || !privateKey) {
             throw new Error("Missing required Salesforce credentials in utils/credentials.js");
        }
    
        return {
            loginUrl,
            username,
            clientId,
            privateKey
        };
    }
    
  3. Configuration File:

    • The repository includes a sample claude_desktop_config.json file that can be used as a template for configuring your MCP server.
    • Update the paths and credentials in this file according to your environment setup.

Running the Server

node server.js

Demo

https://github.com/user-attachments/assets/08c8015a-bc57-4c5e-9f3d-4a9d9d310f4c

Video in higher quality.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • jae-jae
  • MCP server for fetch web page content using Playwright headless browser.

  • HiveNexus
  • An AI chat bot for small and medium-sized teams, supporting models such as Deepseek, Open AI, Claude, and Gemini. 专为中小团队设计的 AI 聊天应用,支持 Deepseek、Open AI、Claude、Gemini 等模型。

  • ravitemer
  • A powerful Neovim plugin for managing MCP (Model Context Protocol) servers

  • patruff
  • Bridge between Ollama and MCP servers, enabling local LLMs to use Model Context Protocol tools

    Reviews

    2 (1)
    Avatar
    user_3gJgMCRw
    2025-04-17

    I have been using the mcp-salesforce-example by lciesielski, and it's an exemplary project for anyone working with Salesforce integration. It offers clear, concise examples, making it an excellent resource for both beginners and experienced developers. The repository is well-maintained, with comprehensive documentation that simplifies the implementation process. Highly recommended!