redash-mcp 2.0.2 → 2.0.3
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/.claude/settings.local.json +11 -3
- package/README.md +36 -7
- package/dist/setup.js +56 -13
- package/package.json +1 -1
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
+
"Bash(git clone:*)",
|
|
4
5
|
"Bash(npm:*)",
|
|
5
|
-
"Bash(
|
|
6
|
-
"mcp__plugin_oh-my-claudecode_t__state_list_active",
|
|
7
|
-
"mcp__plugin_oh-my-claudecode_t__state_clear"
|
|
6
|
+
"Bash(git push:*)"
|
|
8
7
|
]
|
|
8
|
+
},
|
|
9
|
+
"enabledMcpjsonServers": [
|
|
10
|
+
"context7",
|
|
11
|
+
"filesystem",
|
|
12
|
+
"github"
|
|
13
|
+
],
|
|
14
|
+
"sandbox": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"autoAllowBashIfSandboxed": true
|
|
9
17
|
}
|
|
10
18
|
}
|
package/README.md
CHANGED
|
@@ -25,13 +25,23 @@
|
|
|
25
25
|
| 알림 | `get_alert` | 알림 상세 정보 조회 |
|
|
26
26
|
| 알림 | `create_alert` | 새 알림 생성 |
|
|
27
27
|
|
|
28
|
-
## 설치
|
|
28
|
+
## 설치
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### 자동 설치 (권장)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx redash-mcp setup
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
설치 마법사가 실행되며 Claude Desktop, Claude Code(CLI), 또는 둘 다 선택하여 설정할 수 있습니다.
|
|
37
|
+
|
|
38
|
+
### 수동 설치
|
|
39
|
+
|
|
40
|
+
#### 1. Redash API 키 발급
|
|
31
41
|
|
|
32
42
|
Redash → 우측 상단 프로필 → **Edit Profile** → **API Key** 복사
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
#### 2-A. Claude Desktop 설정
|
|
35
45
|
|
|
36
46
|
`~/Library/Application Support/Claude/claude_desktop_config.json` 파일을 열고 아래 내용을 추가합니다:
|
|
37
47
|
|
|
@@ -50,12 +60,31 @@ Redash → 우측 상단 프로필 → **Edit Profile** → **API Key** 복사
|
|
|
50
60
|
}
|
|
51
61
|
```
|
|
52
62
|
|
|
53
|
-
|
|
54
|
-
> **macOS**: `npx`를 못 찾는 경우 `which npx` 명령어로 전체 경로를 확인 후 대체하세요.
|
|
63
|
+
설정 저장 후 Claude Desktop을 완전히 종료했다가 다시 시작합니다.
|
|
55
64
|
|
|
56
|
-
|
|
65
|
+
#### 2-B. Claude Code (CLI) 설정
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
`~/.claude/settings.json` 파일을 열고 아래 내용을 추가합니다:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"redash-mcp": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["-y", "redash-mcp"],
|
|
75
|
+
"env": {
|
|
76
|
+
"REDASH_URL": "https://your-redash-instance.com",
|
|
77
|
+
"REDASH_API_KEY": "your_api_key_here"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
새 Claude Code 세션에서 바로 사용할 수 있습니다.
|
|
85
|
+
|
|
86
|
+
> **Windows/Linux**: `command`를 `npx`로 그대로 사용하면 됩니다.
|
|
87
|
+
> **macOS**: `npx`를 못 찾는 경우 `which npx` 명령어로 전체 경로를 확인 후 대체하세요.
|
|
59
88
|
|
|
60
89
|
## 환경 변수
|
|
61
90
|
|
package/dist/setup.js
CHANGED
|
@@ -24,7 +24,7 @@ function findNpxPath() {
|
|
|
24
24
|
}
|
|
25
25
|
return "npx";
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function getDesktopConfigPath() {
|
|
28
28
|
const platform = os.platform();
|
|
29
29
|
if (platform === "darwin") {
|
|
30
30
|
return path.join(os.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
@@ -36,8 +36,16 @@ function getConfigPath() {
|
|
|
36
36
|
return path.join(os.homedir(), ".config", "Claude", "claude_desktop_config.json");
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
function getClaudeCodeConfigPath() {
|
|
40
|
+
return path.join(os.homedir(), ".claude", "settings.json");
|
|
41
|
+
}
|
|
39
42
|
export async function main() {
|
|
40
43
|
console.log("\n🔧 redash-mcp 설치 마법사\n");
|
|
44
|
+
console.log("설치 대상을 선택하세요:");
|
|
45
|
+
console.log(" 1) Claude Desktop");
|
|
46
|
+
console.log(" 2) Claude Code (CLI)");
|
|
47
|
+
console.log(" 3) 둘 다");
|
|
48
|
+
const target = (await ask("\n선택 (1/2/3) [1]: ")).trim() || "1";
|
|
41
49
|
const redashUrl = (await ask("Redash URL을 입력하세요 (예: https://redash.example.com): ")).trim().replace(/\/$/, "");
|
|
42
50
|
const apiKey = (await ask("Redash API 키를 입력하세요: ")).trim();
|
|
43
51
|
rl.close();
|
|
@@ -45,7 +53,28 @@ export async function main() {
|
|
|
45
53
|
console.error("\n❌ URL과 API 키를 모두 입력해야 합니다.");
|
|
46
54
|
process.exit(1);
|
|
47
55
|
}
|
|
48
|
-
const
|
|
56
|
+
const npxPath = findNpxPath();
|
|
57
|
+
const mcpEntry = {
|
|
58
|
+
command: npxPath,
|
|
59
|
+
args: ["-y", "redash-mcp"],
|
|
60
|
+
env: {
|
|
61
|
+
REDASH_URL: redashUrl,
|
|
62
|
+
REDASH_API_KEY: apiKey,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
if (target === "1" || target === "3") {
|
|
66
|
+
setupDesktop(mcpEntry);
|
|
67
|
+
}
|
|
68
|
+
if (target === "2" || target === "3") {
|
|
69
|
+
setupClaudeCode(mcpEntry);
|
|
70
|
+
}
|
|
71
|
+
if (!["1", "2", "3"].includes(target)) {
|
|
72
|
+
console.error("\n❌ 잘못된 선택입니다. 1, 2, 3 중 하나를 입력하세요.");
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function setupDesktop(mcpEntry) {
|
|
77
|
+
const configPath = getDesktopConfigPath();
|
|
49
78
|
let config = { mcpServers: {} };
|
|
50
79
|
if (fs.existsSync(configPath)) {
|
|
51
80
|
try {
|
|
@@ -60,17 +89,31 @@ export async function main() {
|
|
|
60
89
|
else {
|
|
61
90
|
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
62
91
|
}
|
|
63
|
-
|
|
64
|
-
config
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
92
|
+
config.mcpServers["redash-mcp"] = mcpEntry;
|
|
93
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf8");
|
|
94
|
+
console.log("\n✅ Claude Desktop 설정 완료!");
|
|
95
|
+
console.log(` 설정 파일: ${configPath}`);
|
|
96
|
+
console.log(" 👉 Claude Desktop을 재시작하면 활성화됩니다.");
|
|
97
|
+
}
|
|
98
|
+
function setupClaudeCode(mcpEntry) {
|
|
99
|
+
const configPath = getClaudeCodeConfigPath();
|
|
100
|
+
let config = {};
|
|
101
|
+
if (fs.existsSync(configPath)) {
|
|
102
|
+
try {
|
|
103
|
+
config = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
console.error("\n❌ Claude Code settings.json 파일을 읽을 수 없습니다.");
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
112
|
+
}
|
|
113
|
+
config.mcpServers ??= {};
|
|
114
|
+
config.mcpServers["redash-mcp"] = mcpEntry;
|
|
72
115
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf8");
|
|
73
|
-
console.log("\n✅
|
|
116
|
+
console.log("\n✅ Claude Code (CLI) 설정 완료!");
|
|
74
117
|
console.log(` 설정 파일: ${configPath}`);
|
|
75
|
-
console.log("
|
|
118
|
+
console.log(" 👉 새 Claude Code 세션에서 바로 사용할 수 있습니다.");
|
|
76
119
|
}
|