Skip to content

feat: add --callback-port flag to login command#170

Open
dsdshcym wants to merge 1 commit intoapify:mainfrom
dsdshcym:feat/callback-port
Open

feat: add --callback-port flag to login command#170
dsdshcym wants to merge 1 commit intoapify:mainfrom
dsdshcym:feat/callback-port

Conversation

@dsdshcym
Copy link
Copy Markdown

Summary

  • Add --callback-port <port> option to mcpc login to specify the OAuth callback port
  • Some OAuth providers (e.g., Slack MCP) register specific redirect URIs with fixed ports — the hardcoded port 8000 causes redirect_uri mismatch errors
  • When --callback-port is provided, it's used directly instead of auto-selecting from port 8000

Motivation

Slack's MCP server (mcp.slack.com/mcp) uses client ID 1601185624273.8899143856786 with a registered redirect URI on port 3118. Without this flag, mcpc login always starts the callback server on port 8000, which Slack rejects:

redirect_uri did not match any configured URIs. Passed URI: http://localhost:8000/callback

With this fix:

mcpc login mcp.slack.com/mcp --client-id "1601185624273.8899143856786" --callback-port 3118

Test plan

  • mcpc login --help shows the new --callback-port option
  • mcpc login <server> --client-id <id> --callback-port 3118 uses port 3118 for the callback
  • Without --callback-port, behavior is unchanged (auto-selects from 8000)
  • Tested successfully against Slack MCP OAuth flow

🤖 Generated with Claude Code

Some OAuth providers (e.g., Slack MCP) register specific redirect URIs
with fixed ports. The hardcoded port 8000 causes redirect_uri mismatch
errors. This flag lets users specify the expected callback port.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants