Skip to content

Conversation

@themaainuser
Copy link

Slack MCP Toolkit Implementation

Summary

Successfully implemented a complete Slack MCP (Model Context Protocol) toolkit for toolkit.dev with 5 core tools for interacting with Slack workspaces.

What Was Implemented

Tools Created

  1. list-channels - List all channels in a Slack workspace

    • Supports filtering by channel type (public, private, DMs)
    • Returns channel metadata including member count, topic, and purpose
  2. send-message - Send messages to Slack channels

    • Supports threaded replies via thread_ts parameter
    • Returns message timestamp and confirmation
  3. search-messages - Search for messages across the workspace

    • Supports sorting by relevance or timestamp
    • Returns message content, author, channel, and permalink
  4. get-user-info - Get authenticated user information

    • Returns user profile, email, admin status
    • Includes display name and status information
  5. list-workspaces - Get current workspace information

    • Returns team name, domain, and metadata
    • Includes workspace icon information

Files Created

Core Configuration

  • base.ts - Base toolkit configuration with tool registry
  • server.ts - Server-side toolkit with authentication
  • client.tsx - Client-side toolkit configuration
  • wrapper.tsx - OAuth authentication wrapper

Tool Implementations (5 tools × 3 files each = 15 files)

Each tool has:

  • base.ts - Zod schema definitions for input/output
  • server.ts - Server-side implementation using Slack Web API
  • client.tsx - React component for rendering results

Integration Files

  • tools/index.ts - Tool enum and exports
  • tools/client.ts - Client-side tool exports
  • tools/server.ts - Server-side tool exports

Modified Files

  • shared.ts - Added Slack to toolkit enum and type mappings
  • client.ts - Registered Slack client toolkit
  • server.ts - Registered Slack server toolkit

Technical Details

Dependencies Installed

  • @slack/web-api - Official Slack Web API client

Authentication

The toolkit uses OAuth 2.0 with the following scopes:

  • channels:read - Read channel information
  • channels:write - Manage channels (future use)
  • chat:write - Send messages
  • search:read - Search messages
  • users:read - Read user information
  • team:read - Read workspace information

TypeScript Compilation

All Slack toolkit files pass TypeScript compilation with no errors

1. Slack OAuth App

  1. Go to https://api.slack.com/apps
  2. Click "Create New App" → "From scratch"
  3. Name your app (e.g., "Toolkit.dev")
  4. Select a workspace for development
  5. Navigate to "OAuth & Permissions"
  6. Add the following scopes:
    • channels:read
    • channels:write
    • chat:write
    • search:read
    • users:read
    • team:read
  7. Set the Redirect URL to your app's callback URL (e.g., http://www.toolkit.dev/api/auth/callback/slack)
  8. Copy the Client ID and Client Secret

2. Configure Environment Variables

Add to your .env.local file:

AUTH_SLACK_ID=your_client_id_here
AUTH_SLACK_SECRET=your_client_secret_here

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.

1 participant