[BUG] --callback-port not respected — OAuth listener not started when using /mcp authentication flow.

Resolved 💬 2 comments Opened Jun 2, 2026 by dmerrett-platinum7 Closed Jul 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I am trying to connect Salesforce's hosted MCP Servers to Claude code. I have created an External Client App in Salesforce with the appropriate settings and a callback URL of http://localhost:8080/callback. The MCP config in Claude was created with claude mcp add --transport http sfdc-sobject-reads --client-id XXXXXXXXX --callback-port 8080 https://api.salesforce.com/platform/mcp/v1/platform/sobject-reads where XXXXXXX is the client id from Salesforce.

When I try and authenticate, the browser opens the Salesforce auth URL, I login, Chrome gets redirected to localhost:8080/callback?code=... but gets "connection refused" because Claude Code isn't listening.

I have spent over an hour with Claude code itself trying to sort it out and it finally said it was a bug and gave me this text to submit...

What Should Happen?

The Claude MCP authentication should listen on the port defined.

Error Messages/Logs

Nothing as such, the browser just says localhost refused to connect.

Steps to Reproduce

  1. Sign up for a Salesforce dev org. https://www.salesforce.com/products/free-trial/developer/
  2. Follow the instructions in this documentation. https://developer.salesforce.com/docs/platform/hosted-mcp-servers/guide/setup-overview.html, except use http://localhost:8080/callback for the Callback URL.
  3. Activate sobject-reads in the Setup area as per the documentation
  4. Use the command in the bug text to create an MCP server connection
  5. Inside Claude Code, use /mcp and you will see the Salesforce MCP server needs authentication, try and authenticate, the screen pops on your browser (make sure you are still logged into Salesforce for automatic authentication).
  6. Boom...

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.161 (Claude Code)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

I am using Linux Mint and the standard terminal package. It is fully updated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗