@databrainhq/mcp-server 0.2.17 → 0.3.0-rc.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/.claude-plugin/marketplace.json +21 -0
- package/.claude-plugin/plugin.json +13 -0
- package/.mcp.json +11 -0
- package/README.md +19 -0
- package/dist/apps/server.d.ts +323 -0
- package/dist/apps/server.js +9 -0
- package/dist/apps/server.js.map +1 -0
- package/dist/apps/stdio.d.ts +2 -0
- package/dist/apps/stdio.js +14 -0
- package/dist/apps/stdio.js.map +1 -0
- package/dist/chunk-3AFT7S6E.js +10454 -0
- package/dist/chunk-3AFT7S6E.js.map +1 -0
- package/dist/chunk-4OFVDEFU.js +75 -0
- package/dist/chunk-4OFVDEFU.js.map +1 -0
- package/dist/chunk-CX3CS62P.js +102 -0
- package/dist/chunk-CX3CS62P.js.map +1 -0
- package/dist/chunk-SG7F7PRY.js +314 -0
- package/dist/chunk-SG7F7PRY.js.map +1 -0
- package/dist/index.js +57 -9785
- package/dist/index.js.map +1 -1
- package/dist/main-RYW6PTR4.js +445 -0
- package/dist/main-RYW6PTR4.js.map +1 -0
- package/dist/test-only-B4EVUNFU.js +37 -0
- package/dist/test-only-B4EVUNFU.js.map +1 -0
- package/package.json +10 -3
- package/skills/author-dashboard/SKILL.md +30 -0
- package/skills/embed-dashboard/SKILL.md +23 -0
- package/skills/style-dashboard/SKILL.md +58 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "databrain",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Databrain"
|
|
5
|
+
},
|
|
6
|
+
"metadata": {
|
|
7
|
+
"description": "Agent workflows for Databrain analytics."
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "databrain",
|
|
12
|
+
"description": "Author, style, and embed Databrain dashboards from an agent conversation, and render them as interactive tiles in chat.",
|
|
13
|
+
"version": "0.2.17",
|
|
14
|
+
"source": {
|
|
15
|
+
"source": "npm",
|
|
16
|
+
"package": "@databrainhq/mcp-server",
|
|
17
|
+
"version": "0.2.17"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "databrain",
|
|
3
|
+
"version": "0.2.17",
|
|
4
|
+
"description": "Author, style, and embed Databrain dashboards from an agent conversation, and render them as interactive tiles in chat.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Databrain",
|
|
7
|
+
"url": "https://usedatabrain.com"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://usedatabrain.com",
|
|
10
|
+
"repository": "https://github.com/databrainhq/mcp-server",
|
|
11
|
+
"license": "UNLICENSED",
|
|
12
|
+
"keywords": ["analytics", "dashboard", "databrain", "embed", "mcp-apps"]
|
|
13
|
+
}
|
package/.mcp.json
ADDED
package/README.md
CHANGED
|
@@ -125,6 +125,25 @@ npx @databrainhq/mcp-server
|
|
|
125
125
|
```
|
|
126
126
|
</details>
|
|
127
127
|
|
|
128
|
+
### Interactive chart tiles (opt-in)
|
|
129
|
+
|
|
130
|
+
The installed package also exposes an MCP Apps entry for hosts that render inline app resources. Select it explicitly with:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx --yes --package @databrainhq/mcp-server databrain-mcp-chart-apps
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
In an MCP client configuration, use `npx` as the command and these arguments:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"command": "npx",
|
|
141
|
+
"args": ["--yes", "--package", "@databrainhq/mcp-server", "databrain-mcp-chart-apps"]
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This opt-in entry adds the chart and KPI app resources plus their read-only interaction tools. The default `databrain-mcp-server` entry remains unchanged for existing clients that do not render MCP Apps.
|
|
146
|
+
|
|
128
147
|
### Self-hosted Databrain
|
|
129
148
|
|
|
130
149
|
Running Databrain on your own infrastructure? Point the MCP server at your instance by setting `DATABRAIN_API_URL` alongside your token:
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const configSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
5
|
+
serviceToken: z.ZodOptional<z.ZodString>;
|
|
6
|
+
apiToken: z.ZodOptional<z.ZodString>;
|
|
7
|
+
oauth: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
9
|
+
clientId: z.ZodString;
|
|
10
|
+
clientSecret: z.ZodString;
|
|
11
|
+
resource: z.ZodEffects<z.ZodString, string, string>;
|
|
12
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
13
|
+
authMethod: z.ZodDefault<z.ZodEnum<["client_secret_basic", "client_secret_post"]>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
issuer: string;
|
|
16
|
+
clientId: string;
|
|
17
|
+
clientSecret: string;
|
|
18
|
+
resource: string;
|
|
19
|
+
authMethod: "client_secret_basic" | "client_secret_post";
|
|
20
|
+
scope?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
issuer: string;
|
|
23
|
+
clientId: string;
|
|
24
|
+
clientSecret: string;
|
|
25
|
+
resource: string;
|
|
26
|
+
scope?: string | undefined;
|
|
27
|
+
authMethod?: "client_secret_basic" | "client_secret_post" | undefined;
|
|
28
|
+
}>>;
|
|
29
|
+
apiUrl: z.ZodDefault<z.ZodString>;
|
|
30
|
+
demoDomain: z.ZodDefault<z.ZodString>;
|
|
31
|
+
posthogApiKey: z.ZodOptional<z.ZodString>;
|
|
32
|
+
posthogHost: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
apiUrl: string;
|
|
35
|
+
demoDomain: string;
|
|
36
|
+
serviceToken?: string | undefined;
|
|
37
|
+
apiToken?: string | undefined;
|
|
38
|
+
oauth?: {
|
|
39
|
+
issuer: string;
|
|
40
|
+
clientId: string;
|
|
41
|
+
clientSecret: string;
|
|
42
|
+
resource: string;
|
|
43
|
+
authMethod: "client_secret_basic" | "client_secret_post";
|
|
44
|
+
scope?: string | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
posthogApiKey?: string | undefined;
|
|
47
|
+
posthogHost?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
serviceToken?: string | undefined;
|
|
50
|
+
apiToken?: string | undefined;
|
|
51
|
+
oauth?: {
|
|
52
|
+
issuer: string;
|
|
53
|
+
clientId: string;
|
|
54
|
+
clientSecret: string;
|
|
55
|
+
resource: string;
|
|
56
|
+
scope?: string | undefined;
|
|
57
|
+
authMethod?: "client_secret_basic" | "client_secret_post" | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
apiUrl?: string | undefined;
|
|
60
|
+
demoDomain?: string | undefined;
|
|
61
|
+
posthogApiKey?: string | undefined;
|
|
62
|
+
posthogHost?: string | undefined;
|
|
63
|
+
}>, {
|
|
64
|
+
apiUrl: string;
|
|
65
|
+
demoDomain: string;
|
|
66
|
+
serviceToken?: string | undefined;
|
|
67
|
+
apiToken?: string | undefined;
|
|
68
|
+
oauth?: {
|
|
69
|
+
issuer: string;
|
|
70
|
+
clientId: string;
|
|
71
|
+
clientSecret: string;
|
|
72
|
+
resource: string;
|
|
73
|
+
authMethod: "client_secret_basic" | "client_secret_post";
|
|
74
|
+
scope?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
posthogApiKey?: string | undefined;
|
|
77
|
+
posthogHost?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
serviceToken?: string | undefined;
|
|
80
|
+
apiToken?: string | undefined;
|
|
81
|
+
oauth?: {
|
|
82
|
+
issuer: string;
|
|
83
|
+
clientId: string;
|
|
84
|
+
clientSecret: string;
|
|
85
|
+
resource: string;
|
|
86
|
+
scope?: string | undefined;
|
|
87
|
+
authMethod?: "client_secret_basic" | "client_secret_post" | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
apiUrl?: string | undefined;
|
|
90
|
+
demoDomain?: string | undefined;
|
|
91
|
+
posthogApiKey?: string | undefined;
|
|
92
|
+
posthogHost?: string | undefined;
|
|
93
|
+
}>, {
|
|
94
|
+
apiUrl: string;
|
|
95
|
+
demoDomain: string;
|
|
96
|
+
serviceToken?: string | undefined;
|
|
97
|
+
apiToken?: string | undefined;
|
|
98
|
+
oauth?: {
|
|
99
|
+
issuer: string;
|
|
100
|
+
clientId: string;
|
|
101
|
+
clientSecret: string;
|
|
102
|
+
resource: string;
|
|
103
|
+
authMethod: "client_secret_basic" | "client_secret_post";
|
|
104
|
+
scope?: string | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
posthogApiKey?: string | undefined;
|
|
107
|
+
posthogHost?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
serviceToken?: string | undefined;
|
|
110
|
+
apiToken?: string | undefined;
|
|
111
|
+
oauth?: {
|
|
112
|
+
issuer: string;
|
|
113
|
+
clientId: string;
|
|
114
|
+
clientSecret: string;
|
|
115
|
+
resource: string;
|
|
116
|
+
scope?: string | undefined;
|
|
117
|
+
authMethod?: "client_secret_basic" | "client_secret_post" | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
apiUrl?: string | undefined;
|
|
120
|
+
demoDomain?: string | undefined;
|
|
121
|
+
posthogApiKey?: string | undefined;
|
|
122
|
+
posthogHost?: string | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
type Config = z.infer<typeof configSchema>;
|
|
125
|
+
|
|
126
|
+
declare const referenceSchema: z.ZodObject<{
|
|
127
|
+
embedId: z.ZodString;
|
|
128
|
+
clientId: z.ZodString;
|
|
129
|
+
widgetId: z.ZodString;
|
|
130
|
+
}, "strict", z.ZodTypeAny, {
|
|
131
|
+
clientId: string;
|
|
132
|
+
embedId: string;
|
|
133
|
+
widgetId: string;
|
|
134
|
+
}, {
|
|
135
|
+
clientId: string;
|
|
136
|
+
embedId: string;
|
|
137
|
+
widgetId: string;
|
|
138
|
+
}>;
|
|
139
|
+
type ChartReference = z.infer<typeof referenceSchema>;
|
|
140
|
+
declare const viewSchema: z.ZodObject<{
|
|
141
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
142
|
+
dateRange: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
143
|
+
from: z.ZodString;
|
|
144
|
+
to: z.ZodString;
|
|
145
|
+
}, "strict", z.ZodTypeAny, {
|
|
146
|
+
from: string;
|
|
147
|
+
to: string;
|
|
148
|
+
}, {
|
|
149
|
+
from: string;
|
|
150
|
+
to: string;
|
|
151
|
+
}>, {
|
|
152
|
+
from: string;
|
|
153
|
+
to: string;
|
|
154
|
+
}, {
|
|
155
|
+
from: string;
|
|
156
|
+
to: string;
|
|
157
|
+
}>>;
|
|
158
|
+
drillId: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, "strict", z.ZodTypeAny, {
|
|
160
|
+
cursor?: string | undefined;
|
|
161
|
+
drillId?: string | undefined;
|
|
162
|
+
dateRange?: {
|
|
163
|
+
from: string;
|
|
164
|
+
to: string;
|
|
165
|
+
} | undefined;
|
|
166
|
+
}, {
|
|
167
|
+
cursor?: string | undefined;
|
|
168
|
+
drillId?: string | undefined;
|
|
169
|
+
dateRange?: {
|
|
170
|
+
from: string;
|
|
171
|
+
to: string;
|
|
172
|
+
} | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
declare const pageSchema: z.ZodEffects<z.ZodObject<{
|
|
175
|
+
kind: z.ZodEnum<["chart", "kpi"]>;
|
|
176
|
+
title: z.ZodString;
|
|
177
|
+
chartSpec: z.ZodObject<{
|
|
178
|
+
type: z.ZodString;
|
|
179
|
+
}, "strict", z.ZodTypeAny, {
|
|
180
|
+
type: string;
|
|
181
|
+
}, {
|
|
182
|
+
type: string;
|
|
183
|
+
}>;
|
|
184
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, "many">;
|
|
185
|
+
columns: z.ZodArray<z.ZodString, "many">;
|
|
186
|
+
svg: z.ZodOptional<z.ZodString>;
|
|
187
|
+
width: z.ZodNumber;
|
|
188
|
+
height: z.ZodNumber;
|
|
189
|
+
points: z.ZodArray<z.ZodObject<{
|
|
190
|
+
key: z.ZodString;
|
|
191
|
+
label: z.ZodString;
|
|
192
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
193
|
+
x: z.ZodNumber;
|
|
194
|
+
y: z.ZodNumber;
|
|
195
|
+
width: z.ZodNumber;
|
|
196
|
+
height: z.ZodNumber;
|
|
197
|
+
drillId: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, "strict", z.ZodTypeAny, {
|
|
199
|
+
value: string | number | boolean | null;
|
|
200
|
+
label: string;
|
|
201
|
+
key: string;
|
|
202
|
+
x: number;
|
|
203
|
+
y: number;
|
|
204
|
+
width: number;
|
|
205
|
+
height: number;
|
|
206
|
+
drillId?: string | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
value: string | number | boolean | null;
|
|
209
|
+
label: string;
|
|
210
|
+
key: string;
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
width: number;
|
|
214
|
+
height: number;
|
|
215
|
+
drillId?: string | undefined;
|
|
216
|
+
}>, "many">;
|
|
217
|
+
value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
218
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, "strict", z.ZodTypeAny, {
|
|
220
|
+
kind: "chart" | "kpi";
|
|
221
|
+
title: string;
|
|
222
|
+
columns: string[];
|
|
223
|
+
width: number;
|
|
224
|
+
height: number;
|
|
225
|
+
chartSpec: {
|
|
226
|
+
type: string;
|
|
227
|
+
};
|
|
228
|
+
rows: Record<string, string | number | boolean | null>[];
|
|
229
|
+
points: {
|
|
230
|
+
value: string | number | boolean | null;
|
|
231
|
+
label: string;
|
|
232
|
+
key: string;
|
|
233
|
+
x: number;
|
|
234
|
+
y: number;
|
|
235
|
+
width: number;
|
|
236
|
+
height: number;
|
|
237
|
+
drillId?: string | undefined;
|
|
238
|
+
}[];
|
|
239
|
+
value?: string | number | boolean | null | undefined;
|
|
240
|
+
svg?: string | undefined;
|
|
241
|
+
nextCursor?: string | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
kind: "chart" | "kpi";
|
|
244
|
+
title: string;
|
|
245
|
+
columns: string[];
|
|
246
|
+
width: number;
|
|
247
|
+
height: number;
|
|
248
|
+
chartSpec: {
|
|
249
|
+
type: string;
|
|
250
|
+
};
|
|
251
|
+
rows: Record<string, string | number | boolean | null>[];
|
|
252
|
+
points: {
|
|
253
|
+
value: string | number | boolean | null;
|
|
254
|
+
label: string;
|
|
255
|
+
key: string;
|
|
256
|
+
x: number;
|
|
257
|
+
y: number;
|
|
258
|
+
width: number;
|
|
259
|
+
height: number;
|
|
260
|
+
drillId?: string | undefined;
|
|
261
|
+
}[];
|
|
262
|
+
value?: string | number | boolean | null | undefined;
|
|
263
|
+
svg?: string | undefined;
|
|
264
|
+
nextCursor?: string | undefined;
|
|
265
|
+
}>, {
|
|
266
|
+
kind: "chart" | "kpi";
|
|
267
|
+
title: string;
|
|
268
|
+
columns: string[];
|
|
269
|
+
width: number;
|
|
270
|
+
height: number;
|
|
271
|
+
chartSpec: {
|
|
272
|
+
type: string;
|
|
273
|
+
};
|
|
274
|
+
rows: Record<string, string | number | boolean | null>[];
|
|
275
|
+
points: {
|
|
276
|
+
value: string | number | boolean | null;
|
|
277
|
+
label: string;
|
|
278
|
+
key: string;
|
|
279
|
+
x: number;
|
|
280
|
+
y: number;
|
|
281
|
+
width: number;
|
|
282
|
+
height: number;
|
|
283
|
+
drillId?: string | undefined;
|
|
284
|
+
}[];
|
|
285
|
+
value?: string | number | boolean | null | undefined;
|
|
286
|
+
svg?: string | undefined;
|
|
287
|
+
nextCursor?: string | undefined;
|
|
288
|
+
}, {
|
|
289
|
+
kind: "chart" | "kpi";
|
|
290
|
+
title: string;
|
|
291
|
+
columns: string[];
|
|
292
|
+
width: number;
|
|
293
|
+
height: number;
|
|
294
|
+
chartSpec: {
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
rows: Record<string, string | number | boolean | null>[];
|
|
298
|
+
points: {
|
|
299
|
+
value: string | number | boolean | null;
|
|
300
|
+
label: string;
|
|
301
|
+
key: string;
|
|
302
|
+
x: number;
|
|
303
|
+
y: number;
|
|
304
|
+
width: number;
|
|
305
|
+
height: number;
|
|
306
|
+
drillId?: string | undefined;
|
|
307
|
+
}[];
|
|
308
|
+
value?: string | number | boolean | null | undefined;
|
|
309
|
+
svg?: string | undefined;
|
|
310
|
+
nextCursor?: string | undefined;
|
|
311
|
+
}>;
|
|
312
|
+
type ChartPage = z.infer<typeof pageSchema>;
|
|
313
|
+
type ChartView = z.infer<typeof viewSchema>;
|
|
314
|
+
|
|
315
|
+
type ChartAction = 'render_chart' | 'refresh_widget' | 'drill_down' | 'change_date_range';
|
|
316
|
+
interface ChartBackend {
|
|
317
|
+
execute(action: ChartAction, reference: ChartReference, view: ChartView): Promise<ChartPage>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** Reviewable composition seam; hosted owners must retain their principal-bound client/policy. */
|
|
321
|
+
declare function createChartAppServer(config: Config, backend?: ChartBackend): McpServer;
|
|
322
|
+
|
|
323
|
+
export { createChartAppServer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadConfig
|
|
4
|
+
} from "../chunk-4OFVDEFU.js";
|
|
5
|
+
import {
|
|
6
|
+
createChartAppServer
|
|
7
|
+
} from "../chunk-SG7F7PRY.js";
|
|
8
|
+
import "../chunk-3AFT7S6E.js";
|
|
9
|
+
|
|
10
|
+
// src/apps/stdio.ts
|
|
11
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
+
var server = createChartAppServer(loadConfig());
|
|
13
|
+
await server.connect(new StdioServerTransport());
|
|
14
|
+
//# sourceMappingURL=stdio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/apps/stdio.ts"],"sourcesContent":["import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { loadConfig } from '../utils/config.js';\nimport { createChartAppServer } from './server.js';\n\n// Separate opt-in command until the owners integrate both shared entrypoints.\nconst server = createChartAppServer(loadConfig());\nawait server.connect(new StdioServerTransport());\n"],"mappings":";;;;;;;;;;AAAA,SAAS,4BAA4B;AAKrC,IAAM,SAAS,qBAAqB,WAAW,CAAC;AAChD,MAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;","names":[]}
|