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

@maheidem/pi-slack

v0.2.1

Published

Pi extension: Slack with a consistent, scriptable control-panel UX.

Readme

pi-slack

Pi extension for Slack, backed by the official Slack MCP server. After a one-time browser login it registers the server's 27 tools verbatim as slack_* Pi tools, plus five extension-owned companion tools backed by the Slack Web API (same token) for what the MCP catalog lacks: unread state, mark-read, message edit/delete, and name→ID resolution. A scriptable control panel (/slack) covers status, settings, and session management.

Two surfaces, one login

  1. MCP surface (27 tools)https://mcp.slack.com/mcp, registered verbatim from the server's tools/list (names, descriptions, schemas).
  2. Web API surface (5 companion tools) — direct https://slack.com/api/* calls with the same user token, added by the extension itself (v0.2.1): Slack's hosted MCP catalog has no read-state, message-edit, or message-delete tool, and the granted OAuth scopes already cover those Web API methods. All companion calls go through the same queue/refresh/retry discipline as MCP calls.

Install

pi install npm:@maheidem/[email protected]
# then /reload in any running session

Requires a Pi settings entry (packages) pointing at the installed package — pi install handles that.

Login

/slack login

Opens the Slack browser OAuth flow (PKCE, user token). A localhost callback on port 3118 (configurable) completes it; no code is pasted by hand. When the browser can't open, /slack login prints the authorize URL for manual use.

Tokens are user tokens (xoxe.xoxp-…) with a lifetime of roughly 12 hours; the extension refreshes them proactively before expiry and reactively (single refresh + retry) if the server rejects one mid-session. When the refresh itself fails, the state becomes degraded and tools stop with a clear "run /slack login again" message.

/slack logout [--yes] drops the local tokens and clears the cached tool catalog (the confirmation is required in non-TUI mode via --yes).

Config

Everything lives in ~/.pi/agent/slack.json (created on first load, mode 0600 — it holds OAuth tokens). Override the location with the PI_SLACK_CONFIG environment variable.

  • serverUrl — default https://mcp.slack.com/mcp
  • clientId — shipped default; change only if you register your own Slack app
  • redirectPort — localhost OAuth callback port (default 3118)
  • loginTimeoutMs, requestTimeoutMs, maxResultChars, queueLimit
  • enabledTools — empty = all 27 catalog tools; a comma list restricts registration (the 5 companion tools are never gated by it)

Inspect with /slack config get (values via /slack config set <field> <value>), or /slack doctor for full diagnostics.

Usage

/slack                    control panel (TUI) / status (print mode)
/slack status             connection + queue + catalog status
/slack login              browser OAuth flow
/slack logout [--yes]     drop tokens (confirm in TUI)
/slack test               initialize handshake + tools/list probe
/slack doctor             diagnostics incl. quarantine + version
/slack tools list         cached catalog tool names
/slack tools refresh      re-fetch tools/list now
/slack unread             unread summary (Web API scan)
/slack config get|set|reset
/slack paths              config file location
/slack help

The 27 tools

slack_add_list_record, slack_add_reaction, slack_complete_file_upload, slack_create_canvas, slack_create_conversation, slack_create_list, slack_get_file_upload_url, slack_get_reactions, slack_list_channel_members, slack_list_user_channels, slack_read_canvas, slack_read_channel, slack_read_file, slack_read_list, slack_read_thread, slack_read_user_profile, slack_schedule_message, slack_search_channels, slack_search_emojis, slack_search_public, slack_search_public_and_private, slack_search_users, slack_send_message, slack_send_message_draft, slack_update_canvas, slack_update_list, slack_update_list_record

Names are registered verbatim as the server reports them; a stale cached catalog is refreshed in the background at session start.

The 5 companion tools (extension-provided, Slack Web API)

slack_unread_summary — unread counts per conversation (DMs, group DMs, public/private channels), excluding your own messages; bounded scan (20 s deadline, 300 conversations). slack_mark_read — move a conversation's read position (ts defaults to its latest message). slack_edit_message / slack_delete_message — edit/delete your own messages (Slack enforces this for user tokens). slack_resolve_channel — resolve a channel name or query to channel IDs (top 5 ranked matches) before sending.

Companion tools register/unregister with the same lifecycle as catalog tools: logged-out sessions expose zero slack_* tools total.

Sending messages

slack_send_message requires a channel_id (e.g. C0123456789), not a channel name. Resolve names first:

  • slack_search_channels (public) / slack_search_public_and_private
  • slack_list_user_channels for the channels you're already in

Attachments use the slack_get_file_upload_url → upload → slack_complete_file_upload pair.

Development

npm test          # offline: fake MCP server on 127.0.0.1
npm run typecheck

Source of truth: extensions/ (adapter index.ts, application.ts, config.ts, domain/, vendored ui/). Tests in tests/ include the frozen 27-name parity set and a tarball-integrity gate for the files allowlist.