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

@osiris-ai/slack-sdk

v0.1.1

Published

Osiris Slack SDK

Downloads

6

Readme

@osiris-ai/slack-sdk

OAuth 2.0 Slack authenticator for building authenticated MCPs with Slack workspace integration.

npm version License: MIT

Overview

The Slack SDK provides seamless OAuth 2.0 authentication for Slack in the Osiris ecosystem. Build powerful MCPs (Model Context Protocol) that can interact with Slack workspaces, channels, and users with enterprise-grade security and zero-configuration authentication.

Key Features:

  • 🔐 Zero-config OAuth - No client credentials or setup required
  • 🏢 Workspace Integration - Full access to Slack workspaces and teams
  • 👥 User & Bot Scopes - Support for both workspace and user permissions
  • 🔄 OAuth v2 - Latest Slack OAuth implementation
  • 🛡️ Enterprise Security - Built on Osiris Hub authentication
  • 📝 Full TypeScript - Complete type safety and IDE support

Installation

npm install @osiris-ai/slack-sdk @osiris-ai/sdk

Quick Start

Hub Authentication (Recommended)

The Slack authenticator works automatically through the Osiris Hub - no Slack OAuth app setup required.

import { createMcpServer, getAuthContext } from '@osiris-ai/sdk';
import { createSuccessResponse, createErrorResponse } from '../utils/types.js';
import { z } from 'zod';

await createMcpServer({
  name: 'slack-mcp',
  version: '1.0.0',
  auth: {
    useHub: true,
    hubConfig: {
      baseUrl: process.env.HUB_BASE_URL!,
      clientId: process.env.OAUTH_CLIENT_ID!,
      clientSecret: process.env.OAUTH_CLIENT_SECRET!,
    }
  },
  configure: (server) => {
    // Send Slack message
    server.tool(
      'send_slack_message',
      'Send a message to a Slack channel',
      {
        channel: z.string(),
        text: z.string(),
        username: z.string().optional()
      },
      async ({ channel, text, username }) => {
        try {
          const { token, context } = getAuthContext("osiris");
          if (!token || !context) {
            return createErrorResponse("User not authenticated");
          }

          const response = await fetch(`https://api.osirislabs.xyz/v1/hub/action/${context.deploymentId}/slack/chat.postMessage`, {
            method: 'POST',
            headers: {
              'Authorization': `Bearer ${token.access_token}`,
              'Content-Type': 'application/json'
            },
            body: JSON.stringify({
              channel,
              text,
              username
            })
          });

          const result = await response.json();
          return createSuccessResponse('Message sent successfully', {
            timestamp: result.ts,
            channel: result.channel
          });
        } catch (error) {
          return createErrorResponse(error);
        }
      }
    );
  }
});

Available Slack Scopes

Configure your MCP to request specific Slack permissions:

All slack scopes are supported and they all need to prefixed with slack:

Local Authentication (Advanced)

For custom authentication flows or enterprise requirements:

import { SlackAuthenticator } from '@osiris-ai/slack-sdk';
import { createMcpServer } from '@osiris-ai/sdk';

const slackAuth = new SlackAuthenticator(
  ['channels:read', 'chat:write', 'users:read'],
  {
    clientId: process.env.SLACK_CLIENT_ID!,
    clientSecret: process.env.SLACK_CLIENT_SECRET!,
    redirectUri: 'http://localhost:3000/slack/callback'
  }
);

await createMcpServer({
  name: 'slack-mcp',
  version: '1.0.0',
  auth: {
    useHub: false,
    directAuth: {
      slack: slackAuth
    }
  },
  configure: (server) => {
    // Your Slack tools here
  }
});

API Reference

SlackAuthenticator

The main authenticator class for Slack OAuth integration.

class SlackAuthenticator extends OAuthAuthenticator<SlackCallbackParams, SlackTokenResponse>

Constructor

new SlackAuthenticator(allowedScopes: string[], config: SlackAuthenticatorConfig)

Parameters:

  • allowedScopes: Array of Slack OAuth scopes your MCP requires
  • config: Slack OAuth application configuration

Methods

getAuthenticationURL(scopes: string[], options: AuthenticationURLOptions): string

Generate Slack OAuth authorization URL with user scope support.

callback(params: SlackCallbackParams): Promise<SlackTokenResponse>

Handle OAuth callback and exchange code for tokens.

getUserInfo(accessToken: string): Promise<SlackUserInfo>

Get authenticated user information.

action(params: ActionParams, accessToken: string, refreshToken?: string): Promise<ActionResponse>

Execute Slack API actions with automatic error handling.

Note: Slack OAuth v2 provides both workspace and user tokens in the response.

Getting Started

  1. Install the Osiris CLI:

    npm install -g @osiris-ai/cli
  2. Set up authentication:

    npx @osiris-ai/cli register
    npx @osiris-ai/cli connect-auth
  3. Create your Slack MCP:

    npx @osiris-ai/cli create-app my-slack-mcp
  4. Add Slack integration:

    npm install @osiris-ai/slack-sdk

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Support

License

MIT License - see LICENSE file for details.


Built with ❤️ by the Osiris Labs team.