Socket
Book a DemoInstallSign in
Socket

ai-agent-slack-mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-agent-slack-mcp-server

MCP server for Slack integration (messaging, channels, users, files)

1.0.0
latest
npmnpm
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

Slack MCP Server

A Model Context Protocol (MCP) server that provides Slack integration capabilities, including messaging, channel management, user management, and file uploads.

Features

  • Send Messages: Send messages to Slack channels or users (with confirmation)
  • Get Channels: List channels in the workspace
  • Get Messages: Retrieve message history from channels
  • Get Users: List users in the workspace
  • Upload Files: Upload files to Slack channels (with confirmation)
  • OAuth Integration: Seamless authentication via AI Agent CLI

Tools

slack_send_message

Send a message to a Slack channel or user.

Parameters:

  • channel (required): Channel ID or name (e.g., "#general" or "C1234567890")
  • text (required): Message text to send
  • confirm (required): Must be true to confirm sending the message
  • user_id (optional): User ID for authentication (defaults to "default")
  • thread_ts (optional): Thread timestamp to reply to a specific message

slack_get_channels

Get a list of channels in the Slack workspace.

Parameters:

  • user_id (optional): User ID for authentication (defaults to "default")
  • types (optional): Channel types to include (default: "public_channel")

slack_get_messages

Get messages from a Slack channel.

Parameters:

  • channel (required): Channel ID or name
  • user_id (optional): User ID for authentication (defaults to "default")
  • limit (optional): Number of messages to retrieve (default: 10, max: 100)
  • oldest (optional): Start timestamp for message range
  • latest (optional): End timestamp for message range

slack_get_users

Get a list of users in the Slack workspace.

Parameters:

  • user_id (optional): User ID for authentication (defaults to "default")

slack_upload_file

Upload a file to Slack channels.

Parameters:

  • channels (required): Comma-separated list of channel IDs
  • file_path (required): Path to the file to upload
  • confirm (required): Must be true to confirm uploading the file
  • user_id (optional): User ID for authentication (defaults to "default")
  • title (optional): Title of the file
  • initial_comment (optional): Initial comment with the file

slack_authenticate

Check authentication status or get authentication instructions.

Parameters:

  • user_id (optional): User ID to check (defaults to "default")

Installation

npm install
npm run build

Usage with AI Agent CLI

  • Set up OAuth credentials (obtain from Slack App configuration):

    export SLACK_CLIENT_ID="your-slack-client-id"
    export SLACK_CLIENT_SECRET="your-slack-client-secret"
    
  • Authenticate with Slack:

    ai-agent auth login slack
    
  • Add to AI Agent CLI configuration (~/.agent-fleet/config.json):

    {
      "mcpServers": [{
        "name": "slack",
        "url": "node /path/to/slack-mcp-server/dist/server.js",
        "oauth": {
          "service": "slack",
          "userId": "default"
        }
      }]
    }
    
  • Use with an agent:

    ai-agent chat --agent slack-assistant
    

OAuth Setup

To use this MCP server, you need to create a Slack App and configure OAuth:

  • Go to api.slack.com/apps

  • Create a new app

  • Configure OAuth & Permissions with these scopes:

    • channels:read
    • channels:history
    • chat:write
    • files:read
    • files:write
    • users:read
    • team:read
    • groups:read
    • groups:history
    • im:read
    • im:history
    • mpim:read
    • mpim:history
  • Set redirect URL to: http://localhost:3000/oauth/callback

  • Copy the Client ID and Client Secret to your environment variables

Security Features

  • Confirmation Required: Destructive operations (sending messages, uploading files) require explicit confirmation
  • OAuth Integration: Secure token management via AI Agent CLI
  • User Isolation: Support for multiple authenticated users
  • Environment Variable Injection: Tokens provided securely by the AI Agent CLI

Development

# Run in development mode
npm run dev

# Build
npm run build

# Type check
npm run typecheck

# Lint
npm run lint

# Format
npm run format

Architecture

  • /src/auth - OAuth2 authentication management
  • /src/handlers - Slack API interaction handlers
  • /src/types - TypeScript type definitions
  • /src/server.ts - Main MCP server implementation

Error Handling

The server provides comprehensive error handling with helpful messages:

  • Authentication errors include instructions to use ai-agent auth login slack
  • Missing parameters return clear validation messages
  • API errors from Slack are properly formatted and returned
  • File operations validate file existence before attempting upload

Integration with AI Agent CLI

This MCP server is designed to work seamlessly with the AI Agent CLI's OAuth system:

  • OAuth flow is handled by the CLI (which can open browsers)
  • Tokens are injected via environment variables
  • Multiple users are supported
  • Automatic token refresh (when supported by Slack)
  • Consistent error handling across all tools

Keywords

mcp

FAQs

Package last updated on 13 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.