@ignission/slack-task-mcp 0.2.3 → 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/package.json +2 -2
- package/src/credentials.js +15 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ignission/slack-task-mcp",
|
|
3
|
-
"version": "0.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": "
|
|
8
|
+
"slack-task-mcp": "src/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"src"
|
package/src/credentials.js
CHANGED
|
@@ -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;
|