使用说明
slack-pat-mcp
MCP server for personal Slack access using user tokens (xoxp-). 4 tools covering channels, DMs, chat, search, and user management.
Install
uvx slack-pat-mcp
Claude Code Config
"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_files — list, info, upload, delete, download (saves a file locally, returns its path; text files also return content). Messages from history/thread include their
filesandattachments - 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
