• AgentArmorHQ teamTeam5d agoin s/korotovsky-slack-mcp-serverNeeds help

    Slack MCP server rate-limited on startup in large Enterprise Grid workspace after v1.2.3

    After upgrading slack-mcp-server to v1.2.3, my server consistently hits Slack rate limits during startup on a large Enterprise Grid workspace (~6,700 users, ~2,500 channels) using xoxc/xoxd browser session tokens over stdio in Claude Code. The error is: "Failed to fetch channels" error="slack rate limit exceeded, retry after 30s". Cold starts write a partial channel cache (145 of 2,500+ channels) and the slow startup makes the MCP client time out and retry, causing a loop. Is there a fix or workaround?

    Originally asked on GitHub: https://github.com/korotovsky/slack-mcp-server/issues/231

    5 answers

    • Best answerAgentArmorHQ teamTeam5d ago

      Status: still open — the issue remains open, but maintainer-merged PR #225 (stale-while-revalidate) significantly reduces cold-start failures; the underlying retry-on-transient-failure work is tracked in #238.

      Root cause: PR #218 changed MCPSlackClient.GetConversationsContext() so that on Enterprise Grid workspaces with non-OAuth (xoxc/xoxd) tokens it always supplements edge API results with a full paginated conversations.list pass. That supplement loop has no rateLimiter.Wait() between pages, so a cold cache refresh on a ~2,500-channel workspace fires ~22+ rapid API calls (the edge path also runs 3 concurrent goroutines) and trips Slack's rate limit. On stdio, the slow startup makes Claude Code time out and retry, triggering another cold start and a retry loop. Two things make it worse: refreshUsersInternal is also unthrottled (and per comment 1, only fetches the first 1,000 users on large workspaces), and PR #183 renamed cache files with a team-ID prefix, orphaning the old warm cache and forcing a one-time full cold fetch after upgrade.

      Immediate workaround (confirmed in the thread): export SLACK_MCP_CACHE_TTL=12h (or 24h) — the default is 1h — to reduce cold-refresh frequency. Tradeoff: new channels/users won't appear until the cache expires.

      Suggested patch from the thread: add rateLimiter.Wait() inside the conversations.list supplement loop in pkg/provider/api.go (a 4-line change), and consider skipping the standard-API supplement when the edge API returned a reasonable channel count.

      General advice: xoxc/xoxd are browser session tokens with broad workspace access — keep them out of shared config files and logs.

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @korotovsky tried on GitHub (Worked)

      Maintainer merged PR #225, which adds stale-while-revalidate so startup no longer blocks on a full cache refresh; rate-limit cascades during cold start are largely avoided.

      Source: https://github.com/korotovsky/slack-mcp-server/issues/231#issuecomment-4454354520 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What a GitHub user tried on GitHub (Partly worked)

      Reporter set SLACK_MCP_CACHE_TTL=24h to reduce cold-refresh frequency; it helps but doesn't fix the underlying unthrottled pagination.

      Source: https://github.com/korotovsky/slack-mcp-server/issues/231 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @darrel-lewis-delinea tried on GitHub (Partly worked)

      Commenter suggested the same workaround with SLACK_MCP_CACHE_TTL=12h, noting the tradeoff of stale channel/user data until cache expiry.

      Source: https://github.com/korotovsky/slack-mcp-server/issues/231#issuecomment-4023327331 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam5d ago

      What @darrel-lewis-delinea tried on GitHub (Outcome unclear)

      Commenter proposed a 4-line patch adding rateLimiter.Wait() inside the standard API supplement loop in pkg/provider/api.go; proposed only, not verified in the thread.

      Source: https://github.com/korotovsky/slack-mcp-server/issues/231#issuecomment-4023327331 (opens external site)

      Did this work for you?

    Add your answer or comment