Tutorials

Create custom MCP server for Salesforce - without code

H

Hoshang Mehta

Create custom MCP server for Salesforce - without code

Salesforce is the single source of truth for your sales pipeline. It holds your accounts, opportunities, contacts, and forecasts. But when you want to build an AI agent that can answer "What's the status of the Acme Corp deal?" or "Show me all opportunities closing this quarter," you face a dilemma.

The Salesforce API is notoriously complex. SOQL queries, OAuth flows, API limits, and nested object relationships make it a nightmare to integrate. Most teams end up building brittle middleware just to expose a few simple queries.

Pylar changes the game.

Pylar syncs your Salesforce data to a SQL-queryable warehouse and lets you build MCP (Model Context Protocol) tools with natural language prompts—no code, no SOQL, no headaches.

Why Pylar for Salesforce?

  • Escape SOQL Hell: Write standard SQL instead of learning Salesforce's proprietary query language.
  • No API Limits: Query your synced data as much as you want without hitting Salesforce's strict API rate limits.
  • Cross-Platform Joins: Combine Salesforce opportunities with Stripe revenue or Snowflake usage data in a single view.

Step-by-Step Walkthrough

Step 1: Connect Salesforce to Pylar

  1. In Pylar, go to Connections -> Salesforce.
  2. Click "Connect" and authorize Pylar via OAuth (Salesforce login).
  3. Pylar will begin syncing your Salesforce objects (Accounts, Opportunities, Contacts, Leads, etc.) to its warehouse.

Salesforce OAuth connection

You'll receive an email notification when the initial sync completes.

Step 2: Create a Sandboxed View

Let's say you want an agent to help your sales team track deal progress.

In Pylar's SQL IDE, create a view:

-- view: pipeline_summary
SELECT 
  o.name as opportunity_name,
  o.stagename,
  o.amount,
  o.closedate,
  o.probability,
  a.name as account_name,
  c.name as contact_name,
  c.email as contact_email
FROM salesforce.opportunities o
JOIN salesforce.accounts a ON o.accountid = a.id
LEFT JOIN salesforce.contacts c ON o.contactid = c.id
WHERE o.isclosed = false
  AND o.amount > 10000

Creating a sandboxed view in SQL IDE

This view gives the agent a clean, filtered view of your active pipeline without exposing closed deals or small opportunities.

Step 3: Auto-Build the MCP Tool

  1. Select your view (pipeline_summary) in the right sidebar.
  2. Click "Create MCP Tool" and choose "Create with AI".
  3. Type a prompt: "Create a tool that searches for opportunities by account name or stage."
  4. Pylar generates the tool configuration:
    • Name: search_opportunities
    • Description: "Searches active opportunities by account name or deal stage."
    • Parameters: account_name (string), stage (string)

Auto-generating MCP tool from view

Step 4: Publish & Connect

  1. Click "Publish" in the right sidebar.
  2. Click "Generate Token".
  3. Copy your MCP HTTP Stream URL (https://mcp.publish.pylar.ai/mcp) and Authorization Bearer Token.

Publishing MCP server

Connect to Custom GPT: You can now create a custom GPT that acts as a "Sales Assistant."

  1. In OpenAI's GPT Builder, add an Action.
  2. Use the MCP HTTP Stream URL and Bearer Token from Pylar.
  3. Now your GPT can answer: "What deals are in the negotiation stage?"

Advanced Use Cases for Salesforce Agents

1. Revenue Operations Dashboard

Goal: Give RevOps leaders instant answers about pipeline health without building a BI tool.

  • View: Aggregate opportunities by owner, stage, and quarter.
  • Tool Prompt: "Create a tool that calculates total pipeline value by sales rep and quarter."
  • User Query: "What's Sarah's Q1 pipeline looking like?"

2. Account Health Monitor

Goal: Alert customer success teams when a high-value account shows warning signs.

  • View: Join accounts with opportunities and cases (support tickets).
  • Tool Prompt: "Create a tool that checks if an account has open support cases and declining opportunity value."
  • User Query: "Is the Acme Corp account at risk?"

Conclusion

Salesforce is the world's leading CRM, but giving AI agents access to it has always been challenging—requiring complex API integrations, authentication handling, and constant worry about API limits. With Pylar, you can unlock the power of your Salesforce data for AI agents in under 2 minutes—no coding required.

By connecting Pylar to your Salesforce org, creating sandboxed views that protect sensitive sales data, and auto-generating MCP tools with natural language, you transform your CRM into an AI-ready data source while maintaining complete security and governance.

Whether you're building a sales pipeline assistant, an account health monitor, or any other Salesforce-powered AI application, Pylar gives you the governance layer you need. Your views act as security boundaries, and since your data is synced to Pylar's warehouse, you can run unlimited queries without hitting Salesforce API limits.

Unlock the power of your Salesforce data without the complexity. Start building AI agents that understand your sales pipeline today.

Start building your Salesforce MCP server for free at pylar.ai.