fix: all oauth bugs fixed, manually tested#2
Closed
aron-muon wants to merge 31 commits intomoloco:multi-user-supportfrom
Closed
fix: all oauth bugs fixed, manually tested#2aron-muon wants to merge 31 commits intomoloco:multi-user-supportfrom
aron-muon wants to merge 31 commits intomoloco:multi-user-supportfrom
Conversation
…it-for-cache fix: wait for cache to be ready before serving stdio requests
feat(docker): Set mcp-server as ENTRYPOINT for improved usability
ci: add Dependabot for Go modules and GitHub Actions
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/checkout` from 4 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v6) Updates `actions/setup-go` from 5 to 6 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-go dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps the go-dependencies group with 11 updates: | Package | From | To | | --- | --- | --- | | [github.com/mark3labs/mcp-go](https://github.com/mark3labs/mcp-go) | `0.40.0` | `0.43.2` | | [github.com/openai/openai-go](https://github.com/openai/openai-go) | `1.11.0` | `1.12.0` | | [github.com/refraction-networking/utls](https://github.com/refraction-networking/utls) | `1.8.0` | `1.8.2` | | [github.com/rusq/slackauth](https://github.com/rusq/slackauth) | `0.6.1` | `0.7.1` | | [github.com/rusq/slackdump/v3](https://github.com/rusq/slackdump) | `3.1.6` | `3.1.11` | | [github.com/stretchr/testify](https://github.com/stretchr/testify) | `1.10.0` | `1.11.1` | | [go.uber.org/zap](https://github.com/uber-go/zap) | `1.27.0` | `1.27.1` | | [golang.ngrok.com/ngrok/v2](https://github.com/ngrok/ngrok-go) | `2.0.0` | `2.1.1` | | [golang.org/x/net](https://github.com/golang/net) | `0.40.0` | `0.47.0` | | [golang.org/x/sync](https://github.com/golang/sync) | `0.14.0` | `0.18.0` | | [golang.org/x/time](https://github.com/golang/time) | `0.12.0` | `0.14.0` | Updates `github.com/mark3labs/mcp-go` from 0.40.0 to 0.43.2 - [Release notes](https://github.com/mark3labs/mcp-go/releases) - [Commits](mark3labs/mcp-go@v0.40.0...v0.43.2) Updates `github.com/openai/openai-go` from 1.11.0 to 1.12.0 - [Release notes](https://github.com/openai/openai-go/releases) - [Changelog](https://github.com/openai/openai-go/blob/main/CHANGELOG.md) - [Commits](openai/openai-go@v1.11.0...v1.12.0) Updates `github.com/refraction-networking/utls` from 1.8.0 to 1.8.2 - [Release notes](https://github.com/refraction-networking/utls/releases) - [Commits](refraction-networking/utls@v1.8.0...v1.8.2) Updates `github.com/rusq/slackauth` from 0.6.1 to 0.7.1 - [Commits](rusq/slackauth@v0.6.1...v0.7.1) Updates `github.com/rusq/slackdump/v3` from 3.1.6 to 3.1.11 - [Release notes](https://github.com/rusq/slackdump/releases) - [Commits](rusq/slackdump@v3.1.6...v3.1.11) Updates `github.com/stretchr/testify` from 1.10.0 to 1.11.1 - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](stretchr/testify@v1.10.0...v1.11.1) Updates `go.uber.org/zap` from 1.27.0 to 1.27.1 - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](uber-go/zap@v1.27.0...v1.27.1) Updates `golang.ngrok.com/ngrok/v2` from 2.0.0 to 2.1.1 - [Release notes](https://github.com/ngrok/ngrok-go/releases) - [Changelog](https://github.com/ngrok/ngrok-go/blob/main/CHANGELOG.md) - [Commits](ngrok/ngrok-go@v2.0.0...v2.1.1) Updates `golang.org/x/net` from 0.40.0 to 0.47.0 - [Commits](golang/net@v0.40.0...v0.47.0) Updates `golang.org/x/sync` from 0.14.0 to 0.18.0 - [Commits](golang/sync@v0.14.0...v0.18.0) Updates `golang.org/x/time` from 0.12.0 to 0.14.0 - [Commits](golang/time@v0.12.0...v0.14.0) --- updated-dependencies: - dependency-name: github.com/mark3labs/mcp-go dependency-version: 0.43.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/openai/openai-go dependency-version: 1.12.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/refraction-networking/utls dependency-version: 1.8.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/rusq/slackauth dependency-version: 0.7.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: github.com/rusq/slackdump/v3 dependency-version: 3.1.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: github.com/stretchr/testify dependency-version: 1.11.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: go.uber.org/zap dependency-version: 1.27.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-dependencies - dependency-name: golang.ngrok.com/ngrok/v2 dependency-version: 2.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/net dependency-version: 0.47.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/sync dependency-version: 0.18.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: golang.org/x/time dependency-version: 0.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
ci: add Trivy scan for Go dependencies
…es/go-dependencies-f6cb5527c4 deps(go): bump the go-dependencies group with 11 updates
…ctions/github-actions-3a1c37d3b7 deps(gha): bump the github-actions group with 2 updates
Multi user support
Author
|
Closed for korotovsky#166 instead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
External OAuth Token Support
Summary
This PR adds support for external OAuth token providers, enabling the Slack MCP server to work with bearer tokens that weren't initiated by the application itself. This is useful for integrating with external identity providers or using pre-existing Slack tokens.
Changes
1. Workspace URL Capture and Usage
Problem: External tokens validated successfully via
auth.testbut subsequent API calls failed withinvalid_authbecause the Slack client was pointing to the wrong API endpoint (defaulthttps://slack.com/api/instead of the workspace-specific URL like GovSlack or Enterprise Grid).Solution:
URLfield toTokenInfostruct (pkg/oauth/types.go)ValidateTokento capture the workspace URL fromauth.testresponse (pkg/oauth/manager.go)URLfield toUserContext(pkg/server/auth/context.go)pkg/server/auth/oauth_middleware.go)slack.OptionAPIURL()when creating Slack clients (pkg/handler/channels.go,pkg/handler/conversations.go)2. User Name Resolution in OAuth Mode
Problem: Messages displayed user IDs instead of usernames/display names in OAuth mode because the
usersMapwas always empty.Solution:
fetchUsersForMessages()helper function to fetch user info from Slack APIconvertMessagesFromHistoryandconvertMessagesFromSearchto accept context and Slack client parameters3. Channel Name to ID Resolution
Problem: Users couldn't use channel names like
#general- they had to know the internal channel ID. In OAuth mode, this was especially problematic as the channel cache wasn't available.Solution:
resolveChannelName()helper function that:#prefix@prefix for DM lookupsparseParamsToolConversationsto accept context and Slack clientparseParamsToolSearchto resolve names forfilter_users_fromandfilter_in_channelparameters4. DM Channel Display Improvements
Problem: DM channels showed
#instead of the username, and member counts were 0.Solution:
channelsHandlerOAuthto detect DM channels (IsIMflag)GetUserInfoAPI to display@usernameformatGetUsersInConversationfor group DMs (MPIMs) to get actual member count5. Search Results Channel Display
Problem: Search results showed channel IDs like
#U1234567for DMs instead of usernames.Solution:
convertMessagesFromSearchto detect DM channel IDs (starting with 'D')@usernameformat6. Slack Mention Text Processing
Problem: User mentions in message text showed concatenated text like
U1UEU5QF0Ava Koppwithout proper formatting.Solution:
filterSpecialChars()for Slack mention formats:<@U1234567>→@U1234567<@U1234567|displayname>→@displayname<#C1234567>→#C1234567<#C1234567|channel-name>→#channel-name7. Defensive Programming
Problem: Nil pointer dereference when using channel names in OAuth mode because
apiProviderwas nil.Solution:
apiProviderin OAuth modeFiles Modified
pkg/oauth/types.go- Added URL field to TokenInfopkg/oauth/manager.go- Capture URL from auth.test responsepkg/server/auth/context.go- Added URL field to UserContextpkg/server/auth/oauth_middleware.go- Pass URL to user contextpkg/handler/channels.go- Use API URL, DM display improvementspkg/handler/conversations.go- User/channel resolution, name lookupspkg/text/text_processor.go- Slack mention formattingTesting
Breaking Changes
None. All changes are backward compatible with existing token flow.