Skip to main content
Glama

Salesforce MCP Server

by matsjfunke

Salesforce MCP Server

A Model Context Protocol (MCP) server for Salesforce integration with Bearer token forwarding.

How it Works

This MCP server demonstrates the OAuth Bearer token forwarding pattern:

  1. Langdock authenticates with Salesforce using your External Client App OAuth configuration
  2. Langdock receives a Bearer token from Salesforce
  3. Langdock forwards this Bearer token to your MCP server in the Authorization header
  4. Your MCP server extracts this token and uses it to make authenticated API calls to Salesforce

The server stores the Bearer token per session, allowing it to maintain authenticated connections to Salesforce throughout the MCP session lifecycle.

Installation / Setup

pnpm i

Environment Setup

Create a .env file in the root directory with your Salesforce configuration:

# Copy from .env.example SALESFORCE_INSTANCE_URL=https://your-instance.my.salesforce.com

The server uses the Salesforce instance URL from the SALESFORCE_INSTANCE_URL environment variable.

Configuration

The server requires:

  • Bearer token in the Authorization header (format: Bearer YOUR_TOKEN)
  • Salesforce instance URL via SALESFORCE_INSTANCE_URL environment variable (see Environment Setup above)

Salesforce setup

  1. Enable API Access, go to:  Setup → Profiles → [Your Profile] → System Permissionsa. Make sure API Enabled is checked. Without this, no external app can reach Salesforce.
  2. Add a Connected App. You need to go to Setup → Apps → App Manager (https://your-instance.develop.lightning.force.com/lightning/setup/NavigationMenus/home).a. Create a new Connected Appb. Name your appc. Enable OAuth Settingsd. Set the callbackk url from /mcp on langdocke. Add scopes like: full, refresh_token, apif. Save your Consumer Key and Consumer Secret

Connecting with Langdock

Start the server

pnpm dev # runs on port 3333

Tunnel using ngrok

ngrok http 3333

Configure MCP client in Langdock

MCP Client configuration

Then create and test the connection

MCP Client configuration

Tool Call

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables authenticated interaction with Salesforce through OAuth Bearer token forwarding. Allows users to make API calls to Salesforce instances while maintaining secure session-based authentication throughout the MCP lifecycle.

  1. How it Works
    1. Installation / Setup
      1. Environment Setup
      2. Configuration
      3. Salesforce setup
    2. Connecting with Langdock
      1. Start the server
      2. Tunnel using ngrok
      3. Configure MCP client in Langdock

    Related MCP Servers

    • -
      security
      F
      license
      -
      quality
      Run your own MCP server for over 2,500 apps and APIs. * Run your own MCP server for over 2,500 APIs * Manage servers for your users, in your own app. * Connect accounts, configure params, and make API requests, all via tools * Fully-managed OAuth and credential storage )
      Last updated -
      198
      10,139
      • Linux
      • Apple
    • -
      security
      F
      license
      -
      quality
      A MCP server that requires user authentication via Auth0, allowing it to call protected APIs on behalf of authenticated users.
      Last updated -
    • -
      security
      F
      license
      -
      quality
      This MCP server provides tools to interact with the Salesforce Agentforce API, allowing authentication, session creation, and message exchange with Salesforce agents.
      Last updated -
      11
    • -
      security
      A
      license
      -
      quality
      A reference implementation for creating an MCP server supporting Streamable HTTP & SSE Transports with OAuth authorization, allowing developers to build OAuth-authorized MCP servers with minimal configuration.
      Last updated -
      85
      MIT License

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/matsjfunke/salesforce-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server