<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sudhakar </title>
    <description>The latest articles on DEV Community by Sudhakar  (@sudhakar6).</description>
    <link>https://dev.to/sudhakar6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F157020%2Fb99aced6-d299-457a-84c8-709fc22e6f9f.jpeg</url>
      <title>DEV Community: Sudhakar </title>
      <link>https://dev.to/sudhakar6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sudhakar6"/>
    <language>en</language>
    <item>
      <title>The 'Disconnected' Dilemma: A Mac User's Journey to Connecting the Gemini CLI and Salesforce MCP server</title>
      <dc:creator>Sudhakar </dc:creator>
      <pubDate>Mon, 27 Oct 2025 04:59:10 +0000</pubDate>
      <link>https://dev.to/sudhakar6/the-disconnected-dilemma-a-mac-users-journey-to-connecting-the-gemini-cli-and-salesforce-mcp-2ack</link>
      <guid>https://dev.to/sudhakar6/the-disconnected-dilemma-a-mac-users-journey-to-connecting-the-gemini-cli-and-salesforce-mcp-2ack</guid>
      <description>&lt;h1&gt;
  
  
  🧩 The "Disconnected" Dilemma: A Mac User’s Journey to Connecting the Gemini CLI and Salesforce
&lt;/h1&gt;

&lt;p&gt;Connecting the &lt;strong&gt;Gemini CLI&lt;/strong&gt; to &lt;strong&gt;Salesforce&lt;/strong&gt; felt like unlocking a superpower — using natural language to query orgs, analyze code, and deploy metadata, all from the terminal.&lt;/p&gt;

&lt;p&gt;But what I thought would be a 10-minute setup turned into a multi-step troubleshooting puzzle.&lt;br&gt;&lt;br&gt;
The main villain?&lt;br&gt;&lt;br&gt;
🔴 &lt;strong&gt;salesforce - Disconnected&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the story of that journey, the problems I faced on &lt;strong&gt;Mac (Apple Silicon)&lt;/strong&gt;, and the “Aha!” moment that finally fixed it.&lt;br&gt;&lt;br&gt;
If you’re seeing that same red dot, this guide is for you.&lt;/p&gt;


&lt;h2&gt;
  
  
  🎯 The Goal &amp;amp; The Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The Goal:&lt;/strong&gt; Configure the Gemini CLI to use the Salesforce MCP Server.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;The Machine:&lt;/strong&gt; A Mac with Apple Silicon (M1/M2/M3).&lt;/p&gt;
&lt;h3&gt;
  
  
  🧰 The Key Software
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemini CLI&lt;/strong&gt; – The AI agent.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Salesforce CLI (&lt;code&gt;sf&lt;/code&gt;)&lt;/strong&gt; – Installed and authorized with a default org.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm / npx&lt;/strong&gt; – Used to run the MCP server package.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🧪 The Troubleshooting Timeline
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Phase 1: The “By the Book” Attempt (And the First Failure)
&lt;/h3&gt;

&lt;p&gt;I started by following the developer documentation. It suggested using the Salesforce CLI directly to start the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My &lt;code&gt;~/.gemini/settings.json&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"salesforce"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"force"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mcp:server:start"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Result:&lt;/strong&gt;&lt;br&gt;
I launched Gemini and ran:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
/mcp list&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
✗ salesforce: ... - Disconnected&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The command seemed logical but clearly wasn’t establishing the persistent connection Gemini needed.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 2: Finding the Right Package (And a New Mystery)
&lt;/h3&gt;

&lt;p&gt;After more research, I found that the standard way to run the server is by using the dedicated npm package &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/salesforce"&gt;@salesforce&lt;/a&gt;/mcp&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My &lt;code&gt;~/.gemini/settings.json&lt;/code&gt; (Attempt 2):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;json&lt;br&gt;
{&lt;br&gt;
  "mcpServers": {&lt;br&gt;
    "salesforce": {&lt;br&gt;
      "command": "npx",&lt;br&gt;
      "args": [&lt;br&gt;
        "-y",&lt;br&gt;
        "@salesforce/mcp@latest",&lt;br&gt;
        "--orgs",&lt;br&gt;
        "DEFAULT_TARGET_ORG",&lt;br&gt;
        "--toolsets",&lt;br&gt;
        "orgs,metadata,code-analysis"&lt;br&gt;
      ]&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Result:&lt;/strong&gt;&lt;br&gt;
After restarting Gemini and running &lt;code&gt;/mcp list&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
✗ salesforce: npx -y @salesforce/mcp ... - Disconnected&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This was frustrating. The command was correct, the package official, and the org authorized. So why was it still disconnecting?&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 3: The “Aha!” Moment (Testing the Command Directly)
&lt;/h3&gt;

&lt;p&gt;We realized we were assuming the command itself was failing.&lt;br&gt;
But what if &lt;strong&gt;Gemini&lt;/strong&gt; was the one failing to connect?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Test:&lt;/strong&gt;&lt;br&gt;
Run the command directly in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
npx -y @salesforce/mcp@latest --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,code-analysis&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Result:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
Salesforce MCP Server v0.23.4 running on stdio&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;✅ The server worked perfectly.&lt;br&gt;
The Salesforce CLI authorization and &lt;code&gt;npx&lt;/code&gt; command were fine.&lt;br&gt;
The issue wasn’t Salesforce — it was how Gemini was spawning the process.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 4: The Mac Silicon Clue (Environment Mismatch)
&lt;/h3&gt;

&lt;p&gt;Here’s where the Apple Silicon clue came in.&lt;/p&gt;

&lt;p&gt;When Gemini (a Node.js app) spawns a child process (like &lt;code&gt;npx&lt;/code&gt;), it doesn’t always inherit the full &lt;code&gt;$PATH&lt;/code&gt; from your interactive shell (like &lt;code&gt;.zshrc&lt;/code&gt;).&lt;br&gt;
This happens frequently when using version managers like &lt;strong&gt;nvm&lt;/strong&gt; or &lt;strong&gt;fnm&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Gemini was trying to run &lt;code&gt;npx&lt;/code&gt;, but its isolated environment couldn’t find the command.&lt;br&gt;
The process exited instantly, and Gemini reported &lt;strong&gt;Disconnected&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 5: The Fix (Absolute Path to the Rescue)
&lt;/h3&gt;

&lt;p&gt;If the &lt;code&gt;$PATH&lt;/code&gt; is unreliable, don’t rely on it.&lt;br&gt;
Tell Gemini exactly where &lt;code&gt;npx&lt;/code&gt; lives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Find the Path&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
which npx&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example output:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
/usr/local/bin/npx&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Yours might differ, such as &lt;code&gt;/Users/&amp;lt;your-name&amp;gt;/.nvm/versions/node/v20.x.x/bin/npx&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Update &lt;code&gt;settings.json&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Final, working version:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;json&lt;br&gt;
{&lt;br&gt;
  "mcpServers": {&lt;br&gt;
    "salesforce": {&lt;br&gt;
      "command": "/usr/local/bin/npx",&lt;br&gt;
      "args": [&lt;br&gt;
        "-y",&lt;br&gt;
        "@salesforce/mcp",&lt;br&gt;
        "--orgs",&lt;br&gt;
        "DEFAULT_TARGET_ORG",&lt;br&gt;
        "--toolsets",&lt;br&gt;
        "orgs,metadata,code-analysis",&lt;br&gt;
        "--tools",&lt;br&gt;
        "deploy_metadata,retrieve_metadata"&lt;br&gt;
      ]&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 6: Success!
&lt;/h3&gt;

&lt;p&gt;After saving the file and relaunching Gemini, I ran:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
/mcp list&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
✓ salesforce: /usr/local/bin/npx -y @salesforce/mcp ... (stdio) - Connected&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It finally connected 🎉&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Now What? How to Use Your Connected Server
&lt;/h2&gt;

&lt;p&gt;Getting &lt;strong&gt;Connected&lt;/strong&gt; is just the first step.&lt;br&gt;
Next, you need to use the available tools through natural language.&lt;/p&gt;

&lt;p&gt;You don’t explicitly tell Gemini which tool to use — it infers that based on your prompt.&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 How to Prompt Gemini
&lt;/h3&gt;

&lt;p&gt;Use descriptive keywords that align with the tools (&lt;code&gt;deploy_metadata&lt;/code&gt;, &lt;code&gt;retrieve_metadata&lt;/code&gt;, &lt;code&gt;code-analysis&lt;/code&gt;, etc.).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieve metadata:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“Please retrieve the metadata for the Account object from my default Salesforce org.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Deploy metadata:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“Take the file &lt;code&gt;src/classes/MyNewClass.cls&lt;/code&gt; and deploy it to Salesforce.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Code analysis:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“Analyze the Apex class &lt;code&gt;MyController.cls&lt;/code&gt; for any security vulnerabilities or performance issues.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each time, Gemini asks for confirmation and shows the exact command it plans to execute — proof that the MCP server is being used.&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 Appendix: Installation &amp;amp; Useful Links
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧩 1. Running via npx (Standard Method)
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
npx -y @salesforce/mcp@latest --orgs DEFAULT_TARGET_ORG --toolsets orgs,metadata,data,users&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br&gt;
Downloads and runs the latest MCP package, then removes it.&lt;br&gt;
Perfect for testing.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧰 2. Installing Globally (Optional Troubleshooting Step)
&lt;/h3&gt;

&lt;p&gt;If &lt;code&gt;npx&lt;/code&gt; is unreliable, you can install globally:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
npm install -g @salesforce/mcp&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This ensures a stable global package version.&lt;br&gt;
Not required for most users, but helpful if &lt;code&gt;npx&lt;/code&gt; caching fails.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Related Documentation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;📘 &lt;a href="https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_mcp.htm" rel="noopener noreferrer"&gt;Salesforce DX MCP Server and Tools (Beta)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;a href="https://github.com/salesforcecli/mcp?tab=readme-ov-file" rel="noopener noreferrer"&gt;Salesforce MCP Server GitHub Repository&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Key Lessons for Future Users
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"Disconnected" = "Instant Exit"&lt;/strong&gt; → The server process likely failed to start.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Commands Directly&lt;/strong&gt; → Always run the &lt;code&gt;command&lt;/code&gt; + &lt;code&gt;args&lt;/code&gt; outside Gemini first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mac/Linux Users (especially with nvm/fnm):&lt;/strong&gt;
Use the &lt;strong&gt;absolute path&lt;/strong&gt; to &lt;code&gt;npx&lt;/code&gt; or other executables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows Users:&lt;/strong&gt;
Use &lt;code&gt;"cmd"&lt;/code&gt; with &lt;code&gt;"/c"&lt;/code&gt; in &lt;code&gt;settings.json&lt;/code&gt;, e.g.:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;json&lt;br&gt;
  "command": "cmd",&lt;br&gt;
  "args": ["/c", "npx", ...]&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;🏁 &lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
The “Disconnected” message wasn’t a bug — it was a clue.&lt;br&gt;
Understanding how Gemini spawns its processes revealed the real issue: environment inheritance.&lt;br&gt;
With the absolute path fix, the Gemini–Salesforce bridge now runs perfectly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;




</description>
      <category>salesforce</category>
      <category>gemini</category>
      <category>cli</category>
      <category>macos</category>
    </item>
    <item>
      <title>Salesforce MCP Server for Gemini CLI (Mac, Linux, Windows)</title>
      <dc:creator>Sudhakar </dc:creator>
      <pubDate>Mon, 27 Oct 2025 04:52:37 +0000</pubDate>
      <link>https://dev.to/sudhakar6/salesforce-mcp-server-for-gemini-cli-mac-linux-windows-3cjm</link>
      <guid>https://dev.to/sudhakar6/salesforce-mcp-server-for-gemini-cli-mac-linux-windows-3cjm</guid>
      <description>&lt;h1&gt;
  
  
  ⚙️ Configuring the Salesforce MCP Server for Gemini CLI
&lt;/h1&gt;

&lt;h3&gt;
  
  
  🧭 Hands-On Guide for macOS, Linux, and Windows
&lt;/h3&gt;

&lt;p&gt;Connecting the &lt;strong&gt;Gemini CLI&lt;/strong&gt; to the &lt;strong&gt;Salesforce MCP Server&lt;/strong&gt; unlocks a powerful workflow — allowing you to query orgs, analyze code, and deploy metadata using natural language.&lt;/p&gt;

&lt;p&gt;However, many users — especially on &lt;strong&gt;macOS with Apple Silicon&lt;/strong&gt; — immediately encounter a frustrating&lt;br&gt;&lt;br&gt;
🔴 &lt;strong&gt;salesforce - Disconnected&lt;/strong&gt; error.&lt;/p&gt;

&lt;p&gt;This guide walks you through the correct, stable configuration to get you up and running.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Root cause: usually an environment &lt;code&gt;$PATH&lt;/code&gt; issue.&lt;br&gt;&lt;br&gt;
The fix: explicitly define the full command path Gemini should run.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  📑 Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
Prerequisites
&lt;/li&gt;
&lt;li&gt;
Step 1: Find Your &lt;code&gt;settings.json&lt;/code&gt; File
&lt;/li&gt;
&lt;li&gt;
Step 2: Get the Server Command (The Gotcha &amp;amp; Fix)

&lt;ul&gt;
&lt;li&gt;
macOS &amp;amp; Linux Users
&lt;/li&gt;
&lt;li&gt;
Windows Users
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Step 3: Configure Your &lt;code&gt;settings.json&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
macOS / Linux Configuration
&lt;/li&gt;
&lt;li&gt;
Windows Configuration
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
Step 4: Verify the Connection
&lt;/li&gt;
&lt;li&gt;
Step 5: Use the Connected Server
&lt;/li&gt;
&lt;li&gt;Appendix: Installation &amp;amp; Useful Links&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  🧰 Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you begin, ensure you have the following installed and configured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemini CLI&lt;/strong&gt; – Google’s AI agent for your terminal
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Salesforce CLI (&lt;code&gt;sf&lt;/code&gt;)&lt;/strong&gt; – The standard Salesforce command-line tool
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js / npm / npx&lt;/strong&gt; – The Node.js runtime and package manager
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authorized Salesforce Org&lt;/strong&gt; – You must have an org authorized and set as default in Salesforce CLI
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Authorize an org:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sf org login web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;Or set an existing org as default:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
sf config set target-org &amp;lt;your-org-alias&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🏠 Step 1: Find Your &lt;code&gt;settings.json&lt;/code&gt; File
&lt;/h2&gt;

&lt;p&gt;Gemini CLI uses a configuration file named &lt;code&gt;settings.json&lt;/code&gt;, located in your home directory.&lt;br&gt;
This file tells Gemini how to start the Salesforce server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
~/.gemini/settings.json&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If this file or directory doesn’t exist, create them manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 Step 2: Get the Server Command (The Gotcha &amp;amp; Fix)
&lt;/h2&gt;

&lt;p&gt;When Gemini starts an MCP server, it launches a &lt;strong&gt;child process&lt;/strong&gt;.&lt;br&gt;
This process might &lt;strong&gt;not inherit your shell’s full &lt;code&gt;$PATH&lt;/code&gt;&lt;/strong&gt;, especially on macOS/Linux when using Node version managers like &lt;strong&gt;nvm&lt;/strong&gt; or &lt;strong&gt;fnm&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If your &lt;code&gt;settings.json&lt;/code&gt; command is simply &lt;code&gt;"npx"&lt;/code&gt;, Gemini won’t find it — causing the &lt;strong&gt;Disconnected&lt;/strong&gt; error.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Fix:&lt;/strong&gt; provide the &lt;strong&gt;absolute path&lt;/strong&gt; to your &lt;code&gt;npx&lt;/code&gt; executable.&lt;/p&gt;




&lt;h3&gt;
  
  
  For macOS &amp;amp; Linux Users
&lt;/h3&gt;

&lt;p&gt;Run this command &lt;strong&gt;outside Gemini&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
which npx&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example outputs:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
/usr/local/bin/npx&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
/Users/your-name/.nvm/versions/node/v20.x.x/bin/npx&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Use this exact path in your configuration.&lt;/p&gt;




&lt;h3&gt;
  
  
  For Windows Users
&lt;/h3&gt;

&lt;p&gt;On Windows, &lt;code&gt;npx&lt;/code&gt; must be invoked through the command interpreter.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;"cmd"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First argument:&lt;/strong&gt; &lt;code&gt;"/c"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧾 Step 3: Configure Your &lt;code&gt;settings.json&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Open the file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
~/.gemini/settings.json&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then add the &lt;code&gt;mcpServers&lt;/code&gt; block according to your OS.&lt;/p&gt;




&lt;h3&gt;
  
  
  💻 Final Configuration for macOS / Linux
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;json&lt;br&gt;
{&lt;br&gt;
  "mcpServers": {&lt;br&gt;
    "salesforce": {&lt;br&gt;
      "command": "/usr/local/bin/npx",&lt;br&gt;
      "args": [&lt;br&gt;
        "-y",&lt;br&gt;
        "@salesforce/mcp@latest",&lt;br&gt;
        "--orgs",&lt;br&gt;
        "DEFAULT_TARGET_ORG",&lt;br&gt;
        "--toolsets",&lt;br&gt;
        "orgs,metadata,code-analysis",&lt;br&gt;
        "--tools",&lt;br&gt;
        "deploy_metadata,retrieve_metadata"&lt;br&gt;
      ]&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Replace &lt;code&gt;"DEFAULT_TARGET_ORG"&lt;/code&gt; with your Salesforce org alias (e.g., &lt;code&gt;"my-sandbox-alias"&lt;/code&gt;).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🪟 Final Configuration for Windows
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;json&lt;br&gt;
{&lt;br&gt;
  "mcpServers": {&lt;br&gt;
    "salesforce": {&lt;br&gt;
      "command": "cmd",&lt;br&gt;
      "args": [&lt;br&gt;
        "/c",&lt;br&gt;
        "npx",&lt;br&gt;
        "-y",&lt;br&gt;
        "@salesforce/mcp@latest",&lt;br&gt;
        "--orgs",&lt;br&gt;
        "DEFAULT_TARGET_ORG",&lt;br&gt;
        "--toolsets",&lt;br&gt;
        "orgs,metadata,code-analysis",&lt;br&gt;
        "--tools",&lt;br&gt;
        "deploy_metadata,retrieve_metadata"&lt;br&gt;
      ]&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Step 4: Verify the Connection
&lt;/h2&gt;

&lt;p&gt;Save your configuration and restart Gemini CLI.&lt;br&gt;
Then run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
/mcp list&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Expected output:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
✓ salesforce: /usr/local/bin/npx -y @salesforce/mcp ... (stdio) - Connected&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Step 5: How to Use Your Connected Server
&lt;/h2&gt;

&lt;p&gt;You don’t need to explicitly tell Gemini to “use the Salesforce server.”&lt;br&gt;
Just write prompts describing what you want done — Gemini automatically routes them to the right MCP tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Prompts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Retrieve Metadata&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Please retrieve the metadata for the Account object from my default Salesforce org.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Deploy Metadata&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Take the file &lt;code&gt;src/classes/MyNewClass.cls&lt;/code&gt; and deploy it to Salesforce.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Code Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Analyze the Apex class &lt;code&gt;MyController.cls&lt;/code&gt; for any security vulnerabilities or performance issues.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;💬 When you run such prompts, Gemini will &lt;strong&gt;ask for confirmation&lt;/strong&gt; before executing — confirming your MCP server is working correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  📚 Appendix: Installation &amp;amp; Useful Links
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How to Install the Salesforce MCP Server
&lt;/h3&gt;

&lt;p&gt;The setup uses &lt;code&gt;npx&lt;/code&gt; to dynamically fetch and run the MCP package.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Standard method:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
npx -y @salesforce/mcp ...&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloads the latest &lt;code&gt;@salesforce/mcp&lt;/code&gt; package&lt;/li&gt;
&lt;li&gt;Runs it with your arguments (&lt;code&gt;--orgs&lt;/code&gt;, &lt;code&gt;--toolsets&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Removes it after execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Optional (for troubleshooting):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
npm install -g @salesforce/mcp&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Installing globally may help if &lt;code&gt;npx&lt;/code&gt; fails to find or cache the package properly.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Official Documentation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🧭 &lt;a href="https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_mcp.htm" rel="noopener noreferrer"&gt;Salesforce DX MCP Server and Tools (Beta)&lt;/a&gt;&lt;br&gt;
Official developer guide describing MCP server functionality and tools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💻 &lt;a href="https://github.com/salesforcecli/mcp?tab=readme-ov-file" rel="noopener noreferrer"&gt;Salesforce MCP Server GitHub Repository&lt;/a&gt;&lt;br&gt;
Source code and community issue tracker.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;🏁 &lt;strong&gt;You’re all set!&lt;/strong&gt;&lt;br&gt;
Your Gemini CLI is now successfully connected to the Salesforce MCP Server — ready to analyze, query, and deploy with AI assistance.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>salesforce</category>
      <category>gemini</category>
      <category>cli</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Syncing two Git Repos (By using below commands you can move contents of one git repo to another without losing history and tags)</title>
      <dc:creator>Sudhakar </dc:creator>
      <pubDate>Sat, 10 Aug 2019 17:32:04 +0000</pubDate>
      <link>https://dev.to/sudhakar6/syncing-two-git-repos-1lhh</link>
      <guid>https://dev.to/sudhakar6/syncing-two-git-repos-1lhh</guid>
      <description>&lt;p&gt;&lt;strong&gt;Cloning SourceRepo and Pushing that to TargetRepo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git clone --mirror SourceRepoURL&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The above git clone command will create a directory in your local machine with the name of your repo.&lt;/p&gt;

&lt;p&gt;Change to that directory and add a remote to the target repo.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cd SourceRepo&lt;br&gt;
git remote add NEW-REMOTE TargetRepoURL&lt;/em&gt;&lt;br&gt;
It creates a connection with TargetRepo.&lt;br&gt;
Here'NEW-REMOTE' is just a name, you can give your own Name. Remember that name to sync these two repos.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git push NEW-REMOTE --mirror&lt;/em&gt;&lt;br&gt;
It will push all folders and history of Source repo to Target Repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syncing Those two Repos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After cloning source and pushing to target if you make any more  changes to source simply use below two commands from the same directory to sync.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git fetch origin&lt;/em&gt;&lt;br&gt;
To pull SourceRepo changes&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git push NEW-REMOTE --all&lt;/em&gt;&lt;br&gt;
To push(sync) SourceRepo changes to TargetRepo.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
  </channel>
</rss>
