@ignission/slack-task-mcp 0.2.2 → 0.2.4

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/README.md CHANGED
@@ -193,7 +193,7 @@ https://xxx.slack.com/archives/C12345678/p1234567890123456
193
193
  | **Claude Agent SDK** | 依頼分析・返信添削の AI 処理 |
194
194
  | **Slack Web API** | Slack連携(User Token使用) |
195
195
  | **Zod** | スキーマバリデーション |
196
- | **Cloudflare Workers** | OAuth認証サーバー |
196
+ | **Cloudflare Workers** | OAuth認証(トークン交換) |
197
197
 
198
198
  ---
199
199
 
@@ -201,19 +201,19 @@ https://xxx.slack.com/archives/C12345678/p1234567890123456
201
201
 
202
202
  ```
203
203
  slack-task-mcp/
204
- ├── packages/
205
- │ ├── core/ # MCPサーバー本体
206
- │ └── src/
207
- ├── index.js # サーバーエントリポイント
208
- ├── cli.js # CLIコマンド
209
- ├── auth.js # OAuth認証
210
- └── agents/ # Agent SDK エージェント
211
- ├── index.js # 共通設定
212
- ├── analyze.js # 依頼分析
213
- └── draft-reply.js # 返信添削
214
- │ └── oauth-worker/ # Cloudflare Workers (OAuth)
215
- └── src/index.js
216
- ├── pnpm-workspace.yaml
204
+ ├── src/
205
+ │ ├── index.js # MCPサーバーエントリポイント
206
+ ├── cli.js # CLIコマンド
207
+ │ ├── auth.js # OAuth認証(ハイブリッド方式)
208
+ │ ├── credentials.js # 認証情報管理
209
+ │ ├── paths.js # パス管理(XDG準拠)
210
+ │ └── agents/ # Agent SDK エージェント
211
+ ├── index.js # 共通設定
212
+ ├── analyze.js # 依頼分析
213
+ └── draft-reply.js # 返信添削
214
+ ├── worker/ # Cloudflare Workers(トークン交換)
215
+ ├── index.js
216
+ │ └── wrangler.toml
217
217
  └── package.json
218
218
  ```
219
219
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ignission/slack-task-mcp",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "MCP Server for Slack task management with Claude Code",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
- "slack-task-mcp": "./src/cli.js"
8
+ "slack-task-mcp": "src/cli.js"
9
9
  },
10
10
  "files": [
11
11
  "src"
@@ -77,6 +77,7 @@ export async function getCredentialsByDomain(teamDomain) {
77
77
 
78
78
  try {
79
79
  const files = await fs.readdir(dir);
80
+ const allCreds = [];
80
81
 
81
82
  for (const file of files) {
82
83
  if (!file.endsWith(".json")) continue;
@@ -85,7 +86,9 @@ export async function getCredentialsByDomain(teamDomain) {
85
86
  const filePath = path.join(dir, file);
86
87
  const data = await fs.readFile(filePath, "utf-8");
87
88
  const creds = JSON.parse(data);
89
+ allCreds.push(creds);
88
90
 
91
+ // 完全一致
89
92
  if (creds.team_domain === teamDomain) {
90
93
  return creds;
91
94
  }
@@ -94,6 +97,18 @@ export async function getCredentialsByDomain(teamDomain) {
94
97
  }
95
98
  }
96
99
 
100
+ // 部分一致(URLドメインがOAuthドメインを含む、またはその逆)
101
+ for (const creds of allCreds) {
102
+ if (teamDomain.includes(creds.team_domain) || creds.team_domain.includes(teamDomain)) {
103
+ return creds;
104
+ }
105
+ }
106
+
107
+ // 1つしかない場合はそれを使用
108
+ if (allCreds.length === 1) {
109
+ return allCreds[0];
110
+ }
111
+
97
112
  return null;
98
113
  } catch {
99
114
  return null;