redash-mcp 2.0.1 → 2.0.2

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 ADDED
@@ -0,0 +1,74 @@
1
+ # redash-mcp
2
+
3
+ [Redash](https://redash.io)를 Claude AI에서 직접 조회하고 관리할 수 있는 MCP(Model Context Protocol) 서버입니다.
4
+
5
+ ## 기능
6
+
7
+ | 카테고리 | 툴 | 설명 |
8
+ |---|---|---|
9
+ | 데이터소스 | `list_data_sources` | 연결된 데이터소스 목록 조회 |
10
+ | 스키마 | `list_tables` | 테이블 목록 조회 (키워드 검색 가능) |
11
+ | 스키마 | `get_table_columns` | 테이블 컬럼명/타입 조회 |
12
+ | 쿼리 실행 | `run_query` | SQL 직접 실행 후 결과 반환 |
13
+ | 저장 쿼리 | `list_queries` | 저장된 쿼리 목록 조회 |
14
+ | 저장 쿼리 | `get_query` | 쿼리 상세 정보(SQL, 시각화 등) 조회 |
15
+ | 저장 쿼리 | `get_query_result` | 저장된 쿼리 실행 결과 조회 |
16
+ | 저장 쿼리 | `create_query` | 새 쿼리 저장 |
17
+ | 저장 쿼리 | `update_query` | 쿼리 수정 |
18
+ | 저장 쿼리 | `fork_query` | 쿼리 복제 |
19
+ | 저장 쿼리 | `archive_query` | 쿼리 삭제 |
20
+ | 대시보드 | `list_dashboards` | 대시보드 목록 조회 |
21
+ | 대시보드 | `get_dashboard` | 대시보드 상세 및 위젯 목록 조회 |
22
+ | 대시보드 | `create_dashboard` | 새 대시보드 생성 |
23
+ | 대시보드 | `add_widget` | 대시보드에 시각화 위젯 추가 |
24
+ | 알림 | `list_alerts` | 알림 목록 조회 |
25
+ | 알림 | `get_alert` | 알림 상세 정보 조회 |
26
+ | 알림 | `create_alert` | 새 알림 생성 |
27
+
28
+ ## 설치 (Claude Desktop)
29
+
30
+ ### 1. Redash API 키 발급
31
+
32
+ Redash → 우측 상단 프로필 → **Edit Profile** → **API Key** 복사
33
+
34
+ ### 2. Claude Desktop 설정
35
+
36
+ `~/Library/Application Support/Claude/claude_desktop_config.json` 파일을 열고 아래 내용을 추가합니다:
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "redash-mcp": {
42
+ "command": "npx",
43
+ "args": ["-y", "redash-mcp"],
44
+ "env": {
45
+ "REDASH_URL": "https://your-redash-instance.com",
46
+ "REDASH_API_KEY": "your_api_key_here"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ > **Windows/Linux**: `command`를 `npx`로 그대로 사용하면 됩니다.
54
+ > **macOS**: `npx`를 못 찾는 경우 `which npx` 명령어로 전체 경로를 확인 후 대체하세요.
55
+
56
+ ### 3. Claude Desktop 재시작
57
+
58
+ 설정 저장 후 Claude Desktop을 완전히 종료했다가 다시 시작합니다.
59
+
60
+ ## 환경 변수
61
+
62
+ | 변수 | 필수 | 설명 |
63
+ |---|---|---|
64
+ | `REDASH_URL` | ✅ | Redash 인스턴스 URL (예: `https://redash.example.com`) |
65
+ | `REDASH_API_KEY` | ✅ | Redash 사용자 API 키 |
66
+
67
+ ## 사용 예시
68
+
69
+ Claude에게 자연어로 요청하면 됩니다:
70
+
71
+ - "Redash에서 users 테이블 컬럼 보여줘"
72
+ - "최근 7일 주문 수를 SQL로 조회해줘"
73
+ - "저장된 쿼리 목록 보여줘"
74
+ - "매출 대시보드 위젯 목록 알려줘"
package/dist/index.js CHANGED
@@ -2,6 +2,11 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
+ if (process.argv[2] === "setup") {
6
+ const { main } = await import("./setup.js");
7
+ await main();
8
+ process.exit(0);
9
+ }
5
10
  const REDASH_URL = process.env.REDASH_URL?.replace(/\/$/, "");
6
11
  const REDASH_API_KEY = process.env.REDASH_API_KEY;
7
12
  if (!REDASH_URL || !REDASH_API_KEY) {
package/dist/setup.js ADDED
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+ import * as os from "os";
5
+ import * as readline from "readline";
6
+ import { execSync } from "child_process";
7
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
8
+ const ask = (q) => new Promise((res) => rl.question(q, res));
9
+ function findNpxPath() {
10
+ try {
11
+ const result = execSync("which npx", { encoding: "utf8" }).trim();
12
+ if (result)
13
+ return result;
14
+ }
15
+ catch { }
16
+ const candidates = [
17
+ "/usr/local/bin/npx",
18
+ "/opt/homebrew/bin/npx",
19
+ "/usr/bin/npx",
20
+ ];
21
+ for (const p of candidates) {
22
+ if (fs.existsSync(p))
23
+ return p;
24
+ }
25
+ return "npx";
26
+ }
27
+ function getConfigPath() {
28
+ const platform = os.platform();
29
+ if (platform === "darwin") {
30
+ return path.join(os.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
31
+ }
32
+ else if (platform === "win32") {
33
+ return path.join(process.env.APPDATA ?? "", "Claude", "claude_desktop_config.json");
34
+ }
35
+ else {
36
+ return path.join(os.homedir(), ".config", "Claude", "claude_desktop_config.json");
37
+ }
38
+ }
39
+ export async function main() {
40
+ console.log("\n🔧 redash-mcp 설치 마법사\n");
41
+ const redashUrl = (await ask("Redash URL을 입력하세요 (예: https://redash.example.com): ")).trim().replace(/\/$/, "");
42
+ const apiKey = (await ask("Redash API 키를 입력하세요: ")).trim();
43
+ rl.close();
44
+ if (!redashUrl || !apiKey) {
45
+ console.error("\n❌ URL과 API 키를 모두 입력해야 합니다.");
46
+ process.exit(1);
47
+ }
48
+ const configPath = getConfigPath();
49
+ let config = { mcpServers: {} };
50
+ if (fs.existsSync(configPath)) {
51
+ try {
52
+ config = JSON.parse(fs.readFileSync(configPath, "utf8"));
53
+ config.mcpServers ??= {};
54
+ }
55
+ catch {
56
+ console.error("\n❌ claude_desktop_config.json 파일을 읽을 수 없습니다.");
57
+ process.exit(1);
58
+ }
59
+ }
60
+ else {
61
+ fs.mkdirSync(path.dirname(configPath), { recursive: true });
62
+ }
63
+ const npxPath = findNpxPath();
64
+ config.mcpServers["redash-mcp"] = {
65
+ command: npxPath,
66
+ args: ["-y", "redash-mcp"],
67
+ env: {
68
+ REDASH_URL: redashUrl,
69
+ REDASH_API_KEY: apiKey,
70
+ },
71
+ };
72
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf8");
73
+ console.log("\n✅ 설치 완료!");
74
+ console.log(` 설정 파일: ${configPath}`);
75
+ console.log("\n👉 Claude Desktop을 완전히 종료했다가 다시 시작하면 redash-mcp가 활성화됩니다.\n");
76
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redash-mcp",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "MCP server for Redash",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",