Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Built-in Slack MCP integration requests full scope superset even when only read tools are exposed

未关闭
#4,935 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
shell

调研方向

Look for the Slack MCP server implementation in the copilot-cli codebase, likely under a directory like 'mcp' or 'servers'. Find where the OAuth authorization URL is constructed, particularly the scope parameter. The fix involves dynamically generating the scope list based on the exposed tools (slack_read_channel, slack_read_thread, slack_list_channel_members, slack_search_public) or adding a configuration option in mcp-config.json. Test by triggering the OAuth flow locally and verifying the generated URL's scope parameter.

由索引模型根据 Issue 内容生成。

描述

triage
Describe the bug

When authenticating the built-in Slack MCP server ( mcp.slack.com ) via Copilot CLI, the generated OAuth consent URL requests the full superset of Slack scopes — including write scopes ( chat:write ,  files:write ,  channels:write ,  canvases:write ,  lists:write ,  reactions:write ,  im:write ,  mpim:write ,  groups:write ) — even though the session only exposes a small set of read-only tools:

•  slack_read_channel 
•  slack_read_thread 
•  slack_list_channel_members 
•  slack_search_public 

Example generated authorize URL (redacted):

https://slack.com/oauth/v2_user/authorize?response_type=code&client_id=REDACTED&state=REDACTED&code_challenge=REDACTED&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A58672%2F&scope=canvases%3Aread+canvases%3Awrite+channels%3Ahistory+channels%3Aread+channels%3Awrite+chat%3Awrite+emoji%3Aread+files%3Aread+files%3Awrite+groups%3Ahistory+groups%3Aread+groups%3Awrite+im%3Ahistory+im%3Aread+im%3Awrite+lists%3Aread+lists%3Awrite+mpim%3Ahistory+mpim%3Aread+mpim%3Awrite+reactions%3Aread+reactions%3Awrite+search%3Aread.files+search%3Aread.im+search%3Aread.mpim+search%3Aread.private+search%3Aread.public+search%3Aread.users+users%3Aread+users%3Aread.email&resource=https%3A%2F%2Fmcp.slack.com%2F&prompt=select_account

Expected behavior

Actual behavior
Users are asked to grant far broader permissions (including message sending, file uploads, channel creation, list/canvas writes) than the tool set they can actually use, violating least-privilege expectations.

Suggested fix

• Scope the OAuth request dynamically to the active/allowed tool set, or
• Provide a config option (e.g. in  mcp-config.json ) to restrict which scopes are requested for the built-in Slack MCP connection.

Affected version

1.0.87-0

Steps to reproduce the behavior
  1. Ensure the built-in Slack MCP server ( mcp.slack.com ) is available in Copilot CLI (no custom config needed — it's a first-party integration).
  2. In an interactive Copilot CLI session, run  /mcp  (or trigger any Slack-related request) so Copilot needs to authenticate with Slack.
  3. Confirm only a subset of read tools are currently exposed for the session, e.g.  slack_read_channel ,  slack_read_thread ,  slack_list_channel_members ,  slack_search_public  (visible via the tool list /  <tools_changed_notice>  or  /mcp  output).
  4. Trigger the OAuth flow (Copilot opens/prints an authorization URL and starts a local loopback listener, e.g.  http://127.0.0.1:PORT/ ).
  5. Inspect the generated  https://slack.com/oauth/v2_user/authorize?...  URL's  scope=  query parameter.
  6. Observe: the  scope  parameter includes the full superset of Slack scopes — including write scopes ( chat:write ,  files:write ,  channels:write ,  canvases:write ,  lists:write ,  reactions:write ,  im:write ,  mpim:write ,  groups:write ) and additional read scopes ( users:read ,  users:read.email ,  emoji:read ,  search:read.private/mpim/im/files/users ) — none of which are required by the 4 tools actually exposed.
Expected behavior

The requested  scope  list should match only the tools actually enabled/exposed for the current session (or at minimum, be configurable), rather than always requesting the full write+read superset.

主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。