npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-agent-slack-mcp-server

v1.0.0

Published

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

Downloads

19

Readme

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

  1. 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"
  2. Authenticate with Slack:

    ai-agent auth login slack
  3. 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"
        }
      }]
    }
  4. 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:

  1. Go to api.slack.com/apps

  2. Create a new app

  3. 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
  4. Set redirect URL to: http://localhost:3000/oauth/callback

  5. 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:

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