How to create Custom MCP Server and Integrate with Claude | No Login Needed!

Picture this: your retail website testing team is doing their daily rounds and discovers that the navigation menu has stopped working. Clicks go nowhere. Dropdowns don't drop. The whole thing is broken.

What happens next? In most orgs, the tester opens a browser tab, navigates to Salesforce, logs in, finds the right queue, and manually fills out a case form. By the time the case is raised, ten minutes have passed and the tester's flow is completely broken.

There's a better way. Let's build a custom Salesforce MCP server and wire it up to Claude so that raising a case becomes a single conversational message — no Salesforce login required.


The old workflow — and why it hurt

Before

Tester finds a bug → opens Salesforce → logs in → navigates to case creation → fills subject, description, priority manually → assigns to Website Errors Queue → saves → back to testing.

After (with MCP)

Tester finds a bug → opens Claude → describes the issue in natural language → Claude creates the Salesforce case automatically, pre-filled and assigned correctly. Done.


The architecture at a glance

Here's what we're building: a Salesforce autolaunched flow that accepts inputs and creates a Case, a Salesforce MCP server that exposes that flow as a callable tool, and a custom connector in Claude that ties everything together.


Part 1 — Build the autolaunched flow

Salesforce Flow

Head to Setup → Process Automation → Flows and create a new Autolaunched Flow. This is the engine that will actually create the Salesforce case when Claude calls the MCP server. Here's exactly how the flow is structured:

The complete autolaunched flow — happy path on the left, fault handling on the right
Start
Get Records (Record Type & Queue)
Create Records (Case)
Decision (Check CaseId)
Fault → Assign Error Message
  1. 1
    Create three input variablesSubject (Text), Description (Text), and Priority (Text). Mark all three as "Available for Input" so the MCP server can pass values into them at runtime.
  2. 2
    Get Record Type — add a Get Records element. Object: RecordType. Filter: Name = "Case" and SobjectType = "Case". Store the Id in a variable like CaseRecordTypeId.
  3. 3
    Get Queue — add another Get Records element. Object: Group. Filter: Name = "Website Errors Queue" and Type = "Queue". Store the Id in QueueId.
  4. 4
    Create Help Request — add a Create Records element and map the fields: Subject → {!Subject}, Description → {!Description}, Priority → {!Priority}, Origin → "Website" (hardcoded), Status → "New", OwnerId → {!QueueId}, RecordTypeId → {!CaseRecordTypeId}.
  5. 5
    Add a Fault path on the Create Records element — the fault connects to an Assign Error Message assignment element, then to an End. This ensures Claude gets a meaningful error back if case creation fails rather than a silent timeout.
  6. 6
    Check if CaseId is Null — a Decision element after the create step verifies the record was successfully created. Route to a success path if the CaseId is populated, or handle gracefully if not.
  7. 7
    Save and activate the flow. Give it a meaningful API name like Log_Case_for_Website_Errors — you'll see this name again when adding it to the MCP server.
Why the fault path matters: Without it, if case creation fails (wrong record type, missing field, permission issue), the flow silently errors. With the Assign Error Message element on the fault path, Claude can surface that message back to the tester — making debugging dramatically faster.

Part 2 — Create the Salesforce MCP server

MCP Server Setup
  1. 8
    Go to Setup → MCP Servers and click "Create Salesforce MCP Server". Give it a label (e.g., Website Error Case Logger), an API name, and a short description — Claude uses this to understand when to invoke the server.
  2. 9
    On the MCP server record, click "Add Server Assets" → "Add Tools". In the popup, switch the filter to Flows, search for your autolaunched flow, and click "Add Tool".
  3. 10
    Navigate to the Tools tab on the MCP server record. Your flow will be listed as a tool with Subject, Description, and Priority automatically mapped as input parameters from the flow's input variables.
  4. 11
    Activate the MCP server using the toggle on the record. The server is not callable until it's active.
What's happening under the hood: Salesforce introspects your flow's input variables and auto-generates a JSON schema for the tool. When Claude calls the tool, it passes a JSON payload matching that schema, Salesforce runs your flow with those values, and the case gets created. No custom Apex required.

Part 3 — Create the external client app

Before Claude can talk to the MCP server, you need an External Client App in Salesforce to handle OAuth authentication. The detailed walkthrough — including OAuth scopes, callback URLs, and where to find your consumer key and secret — is covered step by step in this video. Follow it to generate your Auth Key and Auth Secret.


Part 4 — Connect the MCP server to Claude

Claude Connector
  1. 12
    In Claude, go to Settings → Connectors → Add Custom Connector.
  2. 13
    Fill in the Connector Name (e.g., My Salesforce Org), paste the MCP Server URL from your Salesforce Setup page, then enter your Auth Key and Auth Secret from the External Client App.
  3. 14
    Click Connect. Claude will verify the credentials and the connector will show a green connected status. Your Salesforce MCP server is now a live tool Claude can invoke.

Part 5 — Seeing it in action

Here's the moment it all comes together. A tester types one natural sentence into Claude. No Salesforce tab, no case form, no queue navigation. Watch what happens:

Real conversation in Claude — from user message to Salesforce case in seconds

Notice a few things happening in that conversation that make this truly powerful:

  • 1
    Claude searches available tools first. The "Searched available tools" indicator shows Claude automatically discovered the connected Salesforce MCP server and identified it as the right tool for this request — without being told.
  • 2
    Claude asks exactly the right clarifying questions. Instead of guessing, it surfaces the two things the flow actually needs beyond what was provided — a detailed description of the issue and the priority level. Nothing more, nothing less.
  • 3
    Claude calls the flow by name. The "Log Case for Website Errors" indicator confirms Claude invoked your exact MCP tool — your autolaunched flow ran in Salesforce at that moment.
  • 4
    A complete, well-written case is created. Subject, description, and priority are all populated — with Claude composing the description from the tester's conversational answer, not just copy-pasting it.
The tester never left their browser tab. No Salesforce login. No queue navigation. No form fields. The entire interaction took under 30 seconds and resulted in a properly structured, correctly assigned case in the right org.

Why this matters

This isn't just about saving a few clicks — it's about removing an entire context switch from a tester's workflow. When testers don't have to leave their environment to report bugs, they report more bugs, more accurately, with better descriptions (because Claude helps them articulate what they found).

The same pattern works far beyond website bug logging. Any autolaunched flow — lead creation, approval submissions, record updates — can be exposed as an MCP tool and handled conversationally through Claude. Salesforce MCP servers make the whole platform accessible through natural language.

Questions? Find me on sfdcgirl.com — always happy to geek out about Salesforce automation.

Post a Comment

0 Comments