Slack MCP: CLI login fails — redirect_uri mismatch (localhost:8787)

Hey, thanks for the detailed report.

This is a known issue with the CLI’s OAuth flow for Slack MCP. The CLI and IDE use different callback mechanisms for OAuth, and the one the CLI uses isn’t currently compatible with Slack’s OAuth configuration. That’s why the same setup works in the IDE but fails with agent mcp login slack. Our team is aware and working on it.

Workaround: You can use a stdio-based Slack MCP server with a Bot Token, which bypasses the OAuth flow entirely and works reliably in the CLI:

  1. Create a Slack App at api.slack.com/apps with a Bot Token (xoxb-...)

  2. Grant the needed OAuth scopes (channels:history, channels:read, chat:write, reactions:write, users:read, users.profile:read)

  3. Install the app to your workspace and save the Bot Token

  4. Update your mcp.json:

{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_TOKEN": "xoxb-your-token",
"SLACK_TEAM_ID": "your-team-id"
}
}
}
}

Stdio-based MCP servers don’t require OAuth and work reliably from the CLI. A few related threads with more context:

For reference: CLI MCP docs

Let me know if you have any questions about setting up the stdio option.