Skip to content

Exercise 2 - Connecting Agentforce Coworker to a MCP Server (Optional) ​

Agentforce Coworker can work as a "super agent": it answers a question by delegating to the right specialist agent behind the scenes. This walkthrough shows how to extend Coworker beyond Salesforce data by connecting it to any external MCP server. You register the server, wrap its tools in an Agentforce Employee Agent, and give users access. Coworker can then find that agent and delegate tasks to it automatically. In the example, a "Medical Agent" connected to the PubCrawl MCP server lets a pharma rep ask Coworker about the latest published research. The same pattern works for any system with an MCP server, from public data sources to an internal ERP, with no custom code.

Step 1: Register a new MCP Server ​

  1. In Setup, go to MCP Servers. Toggle to the External Servers tab -- no external MCP Servers should be registered yet.
    Image

  2. Click Add MCP Server, then Register External MCP Server. Enter the following values:

FieldValue
MCP Server NamePubCrawl
DescriptionMCP Server to provide access to biomedical literature and drug data sources
Server URLhttps://pubcrawl-production-feb9.up.railway.app/mcp
Authentication MethodNo Authentication (Note: Authentication Method defaults to OAuth 2.0. Click the drop down to change to No Authentication.)

Image

  1. Click the Create and Continue button.

  2. Select all of PubCrawl’s 14 MCP tools by clicking the Select All button.

Image

  1. Click Allow and Continue.

  2. Admins are automatically assigned access, so on the Grant Access to Users screen, click Next.
    Image

  3. On the Apply Policies screen, click Save.

  4. You should now have a registered MCP server!

Image
Make the article links clickable: PubCrawl's answers link to doi.org and PubMed, and Agentforce shows links to sites your org doesn't trust as URL_Redacted. In Setup, go to Trusted URLs and click New Trusted URL. Enter DOI as the API Name and doi.org as the URL, leave the other settings as they are, and click Save. Go back to Trusted URLs and do the same for PubMed, with *.ncbi.nlm.nih.gov as the URL.

Image

Step 2: Create a new Employee Agent ​

  1. Use the App Launcher to navigate to the Agentforce Studio. It shows up under both Apps and Items. Choose the one under Apps.

Image

  1. Click New Agent. This launches a new browser tab.

  2. In the new browser tab, where it says “What do you want your agent to do?”, wait a few seconds for the templates to show up.

  3. Scroll down to find the Agentforce Employee Agent. (This is shown in the middle column in the screenshot below, but it may appear elsewhere as well.) Click Select.

Image

  1. Enter PubCrawl Employee Assistant as the Agent Name. Click tab to auto-populate the Developer Name.

Image

  1. Click Let’s Go.

Image

  1. Click on Agent Settings and replace the description with: Search peer-reviewed medical literature, clinical trials, patents, pharma articles, and pharmaceutical drug labeling across PubMed & PubMed Central, Europe PMC, ClinicalTrials.gov, Drug Labeling (US FDA & UK eMC).

    Save. (upper right part of window)

Image

  1. Delete the existing Subagents, General FAQ, Off Topic and Ambiguous Question. For each one, hover over it, click the three dots that appear, click Delete, and then click Yes, Delete. Leave Agent Router in place. Deleted subagents stay crossed out until you save.

Image

  1. Then hover over Subagents, click the + and select New Subagent. You’ll see a new window named Add Subagent.

    Subagent Name: PubCrawl Scan
    Description: Search peer-reviewed medical literature, clinical trials, patents, pharma articles, and pharmaceutical drug labeling across PubMed & PubMed Central, Europe PMC, ClinicalTrials.gov, Drug Labeling (US FDA & UK eMC).

    Note: This description is really important, because it is what Coworker is going to use to delegate a user utterance to this subagent!
    Image

  2. Click Create and Open.

  3. Hover over the new PubCrawl Scan subagent. Click + (Add or Create Action) and select Add from Asset Library. Search for the PubCrawl tools.
    Image

  4. Select each of PubCrawl’s 14 tools and click Add to Agent. (Note: There is no Select All button.)

Image

  1. Save.

  2. Click ►Preview to run a test. (A Refresh Builder banner may appear. If so, click Refresh Builder to refresh.)

  3. Enter an utterance, e.g.:

What articles about CAR-T Therapy were published in 2016?

Image

  1. Click Commit Version to activate the agent. Commit.

  2. Activate the agent. Click Activate to confirm. Click Done.

Step 3: Give the user access to the new agent ​

  1. In Setup, go to Profiles.

  2. Drill into the System Administrator profile (or whatever profile your user has).

    (Note: The System Administrator profile may not be on page 1. Use the S letter filter above the list to find it.)
    Image

  3. Drill into the Agent Access section.
    Image

  4. Click Edit. Select the checkbox next to PubCrawl Employee Assistant. Save. Click Ok.
    Image

Step 4: Confirm that the agent is visible to your user ​

  1. Select App Launcher and navigate to the Sales app.

Image

  1. Click on the Agentforce icon Image and select the PubCrawl Employee Assistant agent. The panel opens on Search Agent, so click the agent name at the top of the panel, choose PubCrawl Employee Assistant, and click Select.

    (Note: The first time you open the Agentforce panel, an “Agentforce Learns from Your Conversations” dialog appears, pre-checked. Clicking Got It turns memory on for the user.)

Image

  1. Test the agent with a sample utterance, e.g.:
What articles about CAR-T Therapy were published in 2016?

Image

Step 5: Use Coworker with MCP connection enabled! ​

  1. In the Home tab, click on the Ask button.

  2. Type in a question, e.g.:

What articles about CAR-T Therapy were published in 2016?

Agentforce Coworker will delegate to the PubCrawl Employee Assistant, which uses the PubCrawl MCP to answer the question!

Watch for Agent Delegation while Coworker hands off the question. The answer can take anywhere from a few seconds to a few minutes. PubCrawl is a third-party server, so if you get an error or no answer, wait a moment and ask again.

Image
Or for something more interesting, find a lead record (e.g. Katherine Slayden) and Log a Call with a comment such as: Working on a new drug for CAR-T, currently in clinical trials.
Trying to improve outcomes in patients with the CD20 and CD22 biomarkers.
Reminder: research clinical research history for CAR-T CD20/CD22 before next mtg

Then go to Coworker and type (or whatever lead you used):

Brief me for my upcoming meeting with Katherine Slayden

If Coworker offers to research CAR-T CD20/CD22, reply Yes, and it delegates to the PubCrawl Employee Assistant for a research brief and talking points. If the brief doesn't mention the call you logged, try: Pull up the recent activity on Katherine Slayden and research it.
Image

Released under the MIT License.