-
Notifications
You must be signed in to change notification settings - Fork 191
Add Canvas operations and daily summary features #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi @mwhite42, thank you for the implementation. One question from my side: I guess the |
pkg/server/server.go
Outdated
| mcp.WithString("filter_users_from", | ||
| mcp.Description("Filter messages from a specific user by their ID or display name. Example: 'U1234567890' or '@username'. If not provided, all users will be searched."), | ||
| ), | ||
| mcp.WithString("filter_mentions_user", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not look like something that belongs to Canvas feature. Should we extract it to a separate PR?
README.md
Outdated
| - `filter_in_im_or_mpim` (string, optional): Filter messages in a direct message (DM) or multi-person direct message (MPIM) conversation by its ID or name. Example: `D1234567890` or `@username_dm`. If not provided, all DMs and MPIMs will be searched. | ||
| - `filter_users_with` (string, optional): Filter messages with a specific user by their ID or display name in threads and DMs. Example: `U1234567890` or `@username`. If not provided, all threads and DMs will be searched. | ||
| - `filter_users_from` (string, optional): Filter messages from a specific user by their ID or display name. Example: `U1234567890` or `@username`. If not provided, all users will be searched. | ||
| - `filter_mentions_user` (string, optional): **NEW!** Filter messages that mention a specific user. Example: `U1234567890` or `@username`. Use `@me` to find messages mentioning you. Perfect for daily summaries! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove **NEW!** - we will outline this in our release notes
Implements comprehensive Slack Canvas support with create, read, edit, and sections lookup operations. Includes full support for both OAuth (xoxp) and browser token (xoxc/xoxd) authentication modes. ## Canvas Operations (4 new tools) 1. **canvases_create** - Create canvases with markdown content - Supports full markdown formatting (headings, lists, code blocks, tables, mentions, emojis) 2. **canvases_edit** - Edit existing canvases - Operations: insert_at_start, insert_at_end, insert_before, insert_after, replace, delete - Section-based editing for precise content manipulation 3. **canvases_sections_lookup** - Find section IDs within a canvas - Enables targeted edits to specific canvas sections - Optional text filtering 4. **canvases_read** - Read full canvas content - Returns metadata (title, timestamps, URLs, permissions) - Downloads complete markdown content via authenticated HTTP request - **NEW**: Full support for both xoxp and xoxc/xoxd authentication ## Technical Implementation ### Dual Authentication Support - Added httpClient field to MCPSlackClient to store authenticated HTTP client - OAuth (xoxp): Uses Bearer token authentication in Authorization header - Browser tokens (xoxc/xoxd): Uses cookie-based authentication via HTTP client - downloadCanvasContent helper intelligently selects auth method based on token type ### API Extensions - Added Canvas methods to SlackAPI interface: - CreateCanvasContext, EditCanvasContext, LookupCanvasSectionsContext - GetFileInfoContext for canvas metadata - Added Token() and HTTPClient() methods to MCPSlackClient for auth access ### Integration Test Fixes - Fixed test setup to post messages directly via Slack API - Added comprehensive logging and cleanup - Moved setup before test cases definition ## OAuth Scopes Required New scopes needed for full functionality: - `canvases:write` - Create and edit canvases - `canvases:read` - Read canvas content - `files:read` - Access canvas content via files.info API ## Documentation Updates - Updated README.md with all 4 Canvas tools - Added canvas scopes to docs/01-authentication-setup.md - Updated .gitignore to exclude build artifacts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Thanks for the thorough review! I've addressed all three comments:
Force-pushed to clean up the PR - it now contains only Canvas features with full dual-auth support. |
|
I believe for the sake of simplicity both adapters ( |
…ures Adds: - canvases_create: Create canvases with markdown content - canvases_edit: Edit existing canvases - canvases_sections_lookup: Find section IDs within a canvas - canvases_read: Read full canvas content Also adds filter_mentions_user parameter and users_conversations tool. Original PR: korotovsky#123
Summary
This PR adds comprehensive Slack Canvas support and enhanced search features for daily activity summaries.
New Features
🎨 Canvas Operations (4 new tools)
canvases_create- Create canvases with markdown contentcanvases_edit- Edit existing canvasesinsert_at_start,insert_at_end,insert_before,insert_after,replace,deletecanvases_sections_lookup- Find section IDs within a canvascanvases_read- Read full canvas contenturl_private_downloadwith OAuth token for content access📊 Daily Summary Features (2 enhancements)
filter_mentions_userparameter forconversations_search_messages@meto find your own mentionsusers_conversationstool (new)Technical Implementation
GetFileInfoContexttoSlackAPIinterface for canvas metadataToken()method to expose OAuth token for authenticated downloadsdownloadCanvasContenthelper for secure file downloadsto:operator)Conversationstruct for structured conversation dataOAuth Scopes Required
New scopes needed for full functionality:
canvases:write- Create and edit canvasescanvases:read- Read canvas contentfiles:read- Access canvas content via files.info APIDocumentation Updates
docs/01-authentication-setup.md.gitignoreto exclude build artifactsUse Cases Enabled
Canvas Management:
Daily Summaries:
filter_mentions_user: "@me"+filter_date_on: "today"users_conversationsfilter_users_from: "@username"+filter_date_on: "today"Testing
Breaking Changes
None - all changes are additive.
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]