feat: add slack_add_reaction and slack_remove_reaction tools#47
feat: add slack_add_reaction and slack_remove_reaction tools#47abid-mahdi wants to merge 2 commits into
Conversation
Closes slackapi#31. Adds a lightweight local MCP server (src/reactions.ts) that wraps reactions.add / reactions.remove from the Slack Web API. The remote MCP server at mcp.slack.com does not expose reaction tools; this server runs as a local subprocess alongside the remote one. Tools: slack_add_reaction, slack_remove_reaction Params: channel_id, message_ts, emoji_name Scope required: reactions:write Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the contribution! Before we can merge this, we need @abid-mahdi to sign the Salesforce Inc. Contributor License Agreement. |
Refactors src/reactions.ts to export TOOLS, handleToolCall, and createServer so they can be unit-tested without starting the server. Startup code (env validation + server.connect) is guarded behind an import.meta.url check and only runs when the file is executed directly. Adds tests/reactions.test.ts: 14 tests covering tool definitions, slack_add_reaction, slack_remove_reaction, and unknown tool handling. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f26fa6c to
853b4f1
Compare
|
Question for maintainers The Claude Code install section shows this {
"mcpServers": {
"slack": { ... }
}
}But this PR adds a The gap: a user who follows the Claude Code install steps ( Left this out of the PR since the reactions server is opt-in and you may prefer to keep the install section scoped to the core |
Summary
Closes #31.
The remote MCP server at
mcp.slack.comdoesn't expose emoji reaction tools. This PR adds a minimal local MCP server (src/reactions.ts) that fills the gap by callingreactions.addandreactions.removefrom the Slack Web API directly.Design decisions
@slack/web-apinot@slack/bolt— no Socket Mode or event handling needed; only outbound HTTP calls to the Slack APIslack-reactionsentry in.mcp.jsonalongside the existingslackremote server; users can enable it independentlychannel_id,message_ts,emoji_namematches the names proposed in Add emoji reaction support (reactions.add / reactions.remove) #31 and is consistent with thechannel_idconvention used in the remote server's toolsNew tools
slack_add_reactionchannel_id,message_ts,emoji_namereactions.addslack_remove_reactionchannel_id,message_ts,emoji_namereactions.removeemoji_nameis without colons — e.g.thumbsup,white_check_mark,eyes.Required Slack app scope
reactions:write— add to an existing app's bot token scopes, or create a new app.Files changed
src/reactions.ts— standalone MCP server (new)package.json— minimal deps:@modelcontextprotocol/sdk,@slack/web-api,tsx(new).mcp.json—slack-reactionsserver entryREADME.md— setup instructionsCLAUDE.md— tool referenceskills/slack-messaging/SKILL.md— updated to referenceslack_add_reactioninstead of the "can't add reactions" caveatRelationship to PR #23
PR #23 adds a much larger feature (Socket Mode bridge for real-time Claude ↔ Slack messaging) and includes a
reacttool as part of that. This PR is intentionally minimal — just the two reaction tools, no event handling, no gating, no Socket Mode required.Test plan
npm installsucceedsSLACK_BOT_TOKEN=xoxb-... npx tsx src/reactions.tsstarts without errorsslack_add_reactionadds a reaction visible in Slackslack_remove_reactionremoves it🤖 Generated with Claude Code