Skip to content

Conversation

@mwhite42
Copy link

@mwhite42 mwhite42 commented Nov 5, 2025

Summary

This PR adds comprehensive Slack Canvas support and enhanced search features for daily activity summaries.

New Features

🎨 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
    • Uses url_private_download with OAuth token for content access

📊 Daily Summary Features (2 enhancements)

  1. filter_mentions_user parameter for conversations_search_messages

    • Find messages that mention specific users
    • Supports @me to find your own mentions
    • Perfect for end-of-day activity summaries
  2. users_conversations tool (new)

    • Lists all conversations (channels, DMs, group DMs) user is a member of
    • Returns conversation metadata (type, member count, topics)
    • Provides complete workspace context at a glance

Technical Implementation

  • Added GetFileInfoContext to SlackAPI interface for canvas metadata
  • Added Token() method to expose OAuth token for authenticated downloads
  • Implemented downloadCanvasContent helper for secure file downloads
  • Enhanced search query builder with mentions filter (to: operator)
  • New Conversation struct for structured conversation data

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 6 new features
  • Added canvas scopes to docs/01-authentication-setup.md
  • Updated .gitignore to exclude build artifacts

Use Cases Enabled

Canvas Management:

  • Create meeting notes, documentation, project trackers as canvases
  • Programmatically update canvases with new information
  • Read canvas content for AI analysis and summarization

Daily Summaries:

  • Find all messages mentioning you today: filter_mentions_user: "@me" + filter_date_on: "today"
  • Get complete list of your active conversations with users_conversations
  • Track your sent messages: filter_users_from: "@username" + filter_date_on: "today"

Testing

  • ✅ Built successfully on darwin/arm64
  • ✅ All new tools tested with MCP inspector
  • ✅ Canvas create/edit/read workflow verified
  • ✅ Search with mentions filter tested
  • ✅ No credentials or personal information in code

Breaking Changes

None - all changes are additive.


🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

@korotovsky
Copy link
Owner

Hi @mwhite42, thank you for the implementation. One question from my side: I guess the xoxc / xoxd (web) impl. is not there due to its complexity?

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",
Copy link
Owner

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!
Copy link
Owner

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]>
@mwhite42
Copy link
Author

mwhite42 commented Nov 7, 2025

Thanks for the thorough review! I've addressed all three comments:

  1. Daily summary features extracted - Created separate draft PR [DRAFT/OPTIONAL] Add daily summary features #125 for filter_mentions_user and users_conversations. Feel free to close it if these don't fit the project direction!

  2. "NEW!" markers removed - Cleaned up all documentation

  3. xoxc/xoxd support added - Canvas reading now works with both authentication modes! The downloadCanvasContent function now uses the authenticated HTTP client with cookies for xoxc/xoxd tokens, and Bearer auth for xoxp tokens.

Force-pushed to clean up the PR - it now contains only Canvas features with full dual-auth support.

@korotovsky
Copy link
Owner

I believe for the sake of simplicity both adapters (xoxc / xoxd and xoxp) must take as an input markdown and create Canvas from it, this would be the most simplest interface from LLM/user perspective how we might interact with this tool, however I'm not sure this would be so easy to implement this like this easily for xoxc / xoxd as Canvas that is being sent to server is actually a blob, I suggest to investigate deeper this topic, not sure if LLM/vibe-coding can help here.

urisland added a commit to urisland/slack-mcp-server that referenced this pull request Jan 20, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants