@jtalk22/slack-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +295 -0
- package/docs/API.md +286 -0
- package/docs/SETUP.md +134 -0
- package/docs/TROUBLESHOOTING.md +216 -0
- package/docs/WEB-API.md +277 -0
- package/docs/images/demo-channel-messages.png +0 -0
- package/docs/images/demo-channels.png +0 -0
- package/docs/images/demo-main.png +0 -0
- package/docs/images/demo-messages.png +0 -0
- package/docs/images/demo-sidebar.png +0 -0
- package/lib/handlers.js +421 -0
- package/lib/slack-client.js +119 -0
- package/lib/token-store.js +184 -0
- package/lib/tools.js +191 -0
- package/package.json +70 -0
- package/public/demo.html +920 -0
- package/public/index.html +258 -0
- package/scripts/capture-screenshots.js +96 -0
- package/scripts/publish-public.sh +37 -0
- package/scripts/sync-from-onedrive.sh +33 -0
- package/scripts/sync-to-onedrive.sh +31 -0
- package/scripts/token-cli.js +157 -0
- package/src/server.js +118 -0
- package/src/web-server.js +256 -0
package/lib/tools.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tool Definitions
|
|
3
|
+
*
|
|
4
|
+
* All Slack MCP tools in one place for easy maintenance.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const TOOLS = [
|
|
8
|
+
{
|
|
9
|
+
name: "slack_health_check",
|
|
10
|
+
description: "Check if Slack tokens are valid and show authentication status",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "slack_refresh_tokens",
|
|
18
|
+
description: "Force refresh tokens by extracting from Chrome (requires Slack tab open in Chrome)",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "slack_list_conversations",
|
|
26
|
+
description: "List all DMs and channels with user names resolved",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
types: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Comma-separated types: im, mpim, public_channel, private_channel",
|
|
33
|
+
default: "im,mpim"
|
|
34
|
+
},
|
|
35
|
+
limit: {
|
|
36
|
+
type: "number",
|
|
37
|
+
description: "Maximum results (default 100)"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "slack_conversations_history",
|
|
44
|
+
description: "Get messages from a channel or DM with user names resolved",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
channel_id: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "Channel or DM ID (e.g., D063M4403MW)"
|
|
51
|
+
},
|
|
52
|
+
limit: {
|
|
53
|
+
type: "number",
|
|
54
|
+
description: "Messages to fetch (max 100, default 50)"
|
|
55
|
+
},
|
|
56
|
+
oldest: {
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "Unix timestamp - get messages after this time"
|
|
59
|
+
},
|
|
60
|
+
latest: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Unix timestamp - get messages before this time"
|
|
63
|
+
},
|
|
64
|
+
resolve_users: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
description: "Convert user IDs to names (default true)"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
required: ["channel_id"]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "slack_get_full_conversation",
|
|
74
|
+
description: "Export FULL conversation history with all messages, threads, and user names. Can save to file.",
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: "object",
|
|
77
|
+
properties: {
|
|
78
|
+
channel_id: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Channel or DM ID"
|
|
81
|
+
},
|
|
82
|
+
oldest: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "Unix timestamp start (e.g., 1733011200 = Dec 1, 2025)"
|
|
85
|
+
},
|
|
86
|
+
latest: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "Unix timestamp end"
|
|
89
|
+
},
|
|
90
|
+
max_messages: {
|
|
91
|
+
type: "number",
|
|
92
|
+
description: "Maximum messages to retrieve (default 2000, max 10000)"
|
|
93
|
+
},
|
|
94
|
+
include_threads: {
|
|
95
|
+
type: "boolean",
|
|
96
|
+
description: "Fetch thread replies (default true)"
|
|
97
|
+
},
|
|
98
|
+
output_file: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: "Save to file path (optional, relative to home directory)"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
required: ["channel_id"]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "slack_search_messages",
|
|
108
|
+
description: "Search messages across the Slack workspace",
|
|
109
|
+
inputSchema: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: {
|
|
112
|
+
query: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "Search query (supports Slack syntax like from:@user, in:#channel)"
|
|
115
|
+
},
|
|
116
|
+
count: {
|
|
117
|
+
type: "number",
|
|
118
|
+
description: "Number of results (max 100, default 20)"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
required: ["query"]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "slack_users_info",
|
|
126
|
+
description: "Get detailed information about a Slack user",
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: {
|
|
130
|
+
user_id: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "Slack user ID"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
required: ["user_id"]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "slack_send_message",
|
|
140
|
+
description: "Send a message to a channel or DM",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
channel_id: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "Channel or DM ID to send to"
|
|
147
|
+
},
|
|
148
|
+
text: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "Message text (supports Slack markdown)"
|
|
151
|
+
},
|
|
152
|
+
thread_ts: {
|
|
153
|
+
type: "string",
|
|
154
|
+
description: "Thread timestamp to reply to (optional)"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
required: ["channel_id", "text"]
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "slack_get_thread",
|
|
162
|
+
description: "Get all replies in a message thread",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
channel_id: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Channel or DM ID"
|
|
169
|
+
},
|
|
170
|
+
thread_ts: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Thread parent message timestamp"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
required: ["channel_id", "thread_ts"]
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "slack_list_users",
|
|
180
|
+
description: "List all users in the workspace",
|
|
181
|
+
inputSchema: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
limit: {
|
|
185
|
+
type: "number",
|
|
186
|
+
description: "Maximum users to return (default 100)"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jtalk22/slack-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for Slack - Access DMs, channels, and messages from Claude",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/server.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"slack-mcp-server": "./src/server.js",
|
|
9
|
+
"slack-mcp-web": "./src/web-server.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "node src/server.js",
|
|
13
|
+
"web": "node src/web-server.js",
|
|
14
|
+
"tokens:status": "node scripts/token-cli.js status",
|
|
15
|
+
"tokens:refresh": "node scripts/token-cli.js refresh",
|
|
16
|
+
"tokens:auto": "node scripts/token-cli.js auto",
|
|
17
|
+
"tokens:clear": "node scripts/token-cli.js clear"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"mcp",
|
|
21
|
+
"slack",
|
|
22
|
+
"claude",
|
|
23
|
+
"anthropic",
|
|
24
|
+
"model-context-protocol",
|
|
25
|
+
"ai",
|
|
26
|
+
"llm",
|
|
27
|
+
"chatbot",
|
|
28
|
+
"claude-desktop",
|
|
29
|
+
"claude-code",
|
|
30
|
+
"slack-api",
|
|
31
|
+
"slack-bot",
|
|
32
|
+
"dm",
|
|
33
|
+
"direct-messages",
|
|
34
|
+
"workspace",
|
|
35
|
+
"automation"
|
|
36
|
+
],
|
|
37
|
+
"funding": {
|
|
38
|
+
"type": "individual",
|
|
39
|
+
"url": "https://github.com/sponsors/jtalk22"
|
|
40
|
+
},
|
|
41
|
+
"author": "jtalk22",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/jtalk22/slack-mcp-server.git"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/jtalk22/slack-mcp-server#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/jtalk22/slack-mcp-server/issues"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18.0.0"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
56
|
+
"express": "^4.18.2"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"src/",
|
|
60
|
+
"lib/",
|
|
61
|
+
"public/",
|
|
62
|
+
"scripts/",
|
|
63
|
+
"docs/",
|
|
64
|
+
"README.md",
|
|
65
|
+
"LICENSE"
|
|
66
|
+
],
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"playwright": "^1.57.0"
|
|
69
|
+
}
|
|
70
|
+
}
|