agentforce-mcp-server

pkurimella/agentforce-mcp-server

3.3

If you are the rightful owner of agentforce-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Agentforce MCP Server is designed to facilitate communication between Salesforce's Agentforce Service Agent and MCP-compatible clients using the Model Context Protocol.

The Agentforce MCP Server acts as a bridge between Salesforce's Agentforce Service Agent and various MCP-compatible clients. It leverages the Agentforce Agent API to manage chat sessions, allowing for seamless communication and interaction. The server exposes key functionalities as tools, enabling clients to initiate, manage, and terminate chat sessions with ease. Built on Node.js, the server requires a Salesforce Org with an active Agentforce Service Agent and a connected app configured for OAuth2 authentication. The server supports both STDIO and SSE transport methods, providing flexibility in deployment and integration with different platforms.

Features

  • Seamless integration with Salesforce's Agentforce Service Agent.
  • Exposes key functionalities as MCP tools for easy interaction.
  • Supports both STDIO and SSE transport methods.
  • Centralized error handling for meaningful error messages.
  • Compatible with various MCP clients like ChatGPT and Open Interpreter.

Usages

usage with Claude Desktop

{
  "mcpServers": {
    "agentforce": {
      "command": "node",
      "args": [
        "/path/to/directory/build/server.js",
        "SALESFORCE_ORG_DOMAIN_URL",
        "CONNECTEDAPP_CLIENT_ID",
        "CONNECTEDAPP_CLIENT_SECRET",
        "AGENT_ID"
      ]
    }
  }
}

usage with SSEServerTransport

import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
import express from "express";

const app = express();
var transport: SSEServerTransport ;

app.get("/sse", async (req, res) => {
  transport = new SSEServerTransport("/messages", res);
  await server.connect(transport);
});

app.post("/messages", async (req, res) => {
  // Note: to support multiple simultaneous connections, these messages will
  // need to be routed to a specific matching transport. (This logic isn't
  // implemented here, for simplicity.)
  await transport.handlePostMessage(req, res);
});

app.listen(PORT);

Tools

  1. start-session

    Initializes a new Agentforce chat session

  2. send-message

    Sends a message to the active session

  3. end-session

    Ends the active session