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:
-
Create a Slack App at api.slack.com/apps with a Bot Token (
xoxb-...) -
Grant the needed OAuth scopes (
channels:history,channels:read,chat:write,reactions:write,users:read,users.profile:read) -
Install the app to your workspace and save the Bot Token
-
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:
-
Cursor CLI MCP Callback Port (staff confirmed this is a CLI-side bug)
-
Headless CLI agent has no access to Slack MCP Tools (same workaround suggested)
For reference: CLI MCP docs
Let me know if you have any questions about setting up the stdio option.