Metadata-Version: 2.5
Name: slack-pat-mcp
Version: 0.1.9
Summary: Model Context Protocol (MCP) server for Slack using PAT (Personal Access Token)
Project-URL: Homepage, https://github.com/wise-toddler/slack-pat-mcp
Project-URL: Repository, https://github.com/wise-toddler/slack-pat-mcp
Project-URL: Issues, https://github.com/wise-toddler/slack-pat-mcp/issues
Author-email: Shivansh Singh <wiseeldrich2004@gmail.com>
License-Expression: MIT
Keywords: ai,claude,mcp,model-context-protocol,slack
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: requests>=2.28.0
Description-Content-Type: text/markdown

# slack-pat-mcp

MCP server for personal Slack access using user tokens (xoxp-). 4 tools covering channels, DMs, chat, search, and user management.

## Install

```bash
uvx slack-pat-mcp
```

## Claude Code Config

```json
"slack": {
    "command": "uvx",
    "args": ["slack-pat-mcp"],
    "env": {
        "SLACK_USER_TOKEN": "xoxp-...",
        "SLACK_TEAM_ID": "T..."
    }
}
```

## Tools

- **slack_channel** — list, list_dms, history, thread, open_dm
- **slack_chat** — post, update, delete, react_add, react_remove
- **slack_search** — search messages with Slack syntax
- **slack_users** — list, info, profile, usergroups, set_status
- **slack_drafts** — create, list, update, delete; text is Slack mrkdwn (bold/italic/strike/code, lists, quotes, code blocks, links, mentions, emoji), converted to rich_text (needs browser session keys below)

## Drafts (optional)

Slack's drafts API rejects xoxp tokens, so drafts use your browser session. In `app.slack.com` DevTools:

- `SLACK_XOXC_TOKEN` — Console: `Object.values(JSON.parse(localStorage.localConfig_v2).teams).map(t => [t.name, t.token])`
- `SLACK_D_COOKIE` — Application → Cookies → `https://app.slack.com` → `d` (copy as-is, URL-encoded)

These are unofficial and stop working when you sign out of Slack in that browser.

When set, they are also the fallback for any call where the xoxp token fails with a missing scope (e.g. `set_status` without `users.profile:write`) or an auth error (revoked/expired/unset token), so every tool keeps working on the browser session alone.

## Required Slack OAuth Scopes (User Token)

channels:read, channels:history, groups:read, groups:history, im:read, im:history, im:write, mpim:read, mpim:history, mpim:write, chat:write, reactions:read, reactions:write, search:read, users:read, users:read.email, users.profile:read, users.profile:write, usergroups:read
