@lightdash-tools/mcp 0.24.0 → 0.25.0
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 +2 -2
- package/dist/auth/oauth-broker/as-metadata.d.ts +1 -0
- package/dist/auth/oauth-broker/as-metadata.js +5 -1
- package/dist/auth/oauth-broker/client-crypto.d.ts +12 -0
- package/dist/auth/oauth-broker/client-crypto.js +80 -0
- package/dist/auth/oauth-broker/client-directory.d.ts +39 -0
- package/dist/auth/oauth-broker/client-directory.js +104 -0
- package/dist/auth/oauth-broker/client-directory.test.d.ts +1 -0
- package/dist/auth/oauth-broker/client-directory.test.js +134 -0
- package/dist/auth/oauth-broker/lightdash-token.d.ts +8 -0
- package/dist/auth/oauth-broker/lightdash-token.js +72 -8
- package/dist/auth/oauth-broker/mcp-access-token.d.ts +3 -0
- package/dist/auth/oauth-broker/mcp-access-token.js +9 -1
- package/dist/auth/oauth-broker/pending-store.d.ts +16 -4
- package/dist/auth/oauth-broker/pending-store.js +40 -18
- package/dist/auth/oauth-broker/refresh-crypto.d.ts +19 -0
- package/dist/auth/oauth-broker/refresh-crypto.js +70 -0
- package/dist/auth/oauth-broker/refresh-crypto.test.d.ts +1 -0
- package/dist/auth/oauth-broker/refresh-crypto.test.js +40 -0
- package/dist/auth/oauth-broker/refresh-flow.test.d.ts +1 -0
- package/dist/auth/oauth-broker/refresh-flow.test.js +350 -0
- package/dist/auth/oauth-broker/refresh-grant.d.ts +46 -0
- package/dist/auth/oauth-broker/refresh-grant.js +288 -0
- package/dist/auth/oauth-broker/refresh-store.conformance.test.d.ts +1 -0
- package/dist/auth/oauth-broker/refresh-store.conformance.test.js +254 -0
- package/dist/auth/oauth-broker/refresh-store.d.ts +61 -0
- package/dist/auth/oauth-broker/refresh-store.js +124 -0
- package/dist/auth/oauth-broker/routes.d.ts +6 -4
- package/dist/auth/oauth-broker/routes.js +114 -51
- package/dist/auth/oauth-broker/routes.test.js +48 -0
- package/dist/auth/oauth-broker/stores/client-kv.d.ts +46 -0
- package/dist/auth/oauth-broker/stores/client-kv.js +182 -0
- package/dist/auth/oauth-broker/stores/firestore.d.ts +29 -0
- package/dist/auth/oauth-broker/stores/firestore.js +201 -0
- package/dist/auth/oauth-broker/stores/open-client-directory.d.ts +4 -0
- package/dist/auth/oauth-broker/stores/open-client-directory.js +30 -0
- package/dist/auth/oauth-broker/stores/open-refresh-store.d.ts +4 -0
- package/dist/auth/oauth-broker/stores/open-refresh-store.js +24 -0
- package/dist/auth/oauth-broker/stores/postgres.d.ts +13 -0
- package/dist/auth/oauth-broker/stores/postgres.js +193 -0
- package/dist/auth/oauth-broker/stores/redis.d.ts +25 -0
- package/dist/auth/oauth-broker/stores/redis.js +337 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.d.ts +1 -1
- package/dist/config/env.d.ts +13 -0
- package/dist/config/env.js +14 -1
- package/dist/config/load-mcp-config.d.ts +20 -0
- package/dist/config/load-mcp-config.js +53 -1
- package/dist/config/load-mcp-config.test.js +53 -0
- package/dist/config/oauth-store-key.d.ts +2 -0
- package/dist/config/oauth-store-key.js +17 -0
- package/dist/policy/content-developer.d.ts +4 -1
- package/dist/policy/content-developer.js +7 -3
- package/dist/policy/preview-ledger.d.ts +11 -1
- package/dist/policy/preview-ledger.js +29 -3
- package/dist/policy/rename-rejected.d.ts +9 -0
- package/dist/policy/rename-rejected.js +15 -0
- package/dist/profiles/content-developer/v1/index.js +6 -0
- package/dist/profiles/content-developer/v1/prompt-specs.d.ts +1 -1
- package/dist/profiles/content-developer/v1/resources/playbooks/core.md +15 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/recovery/preview-stale.md +1 -0
- package/dist/profiles/content-reader/v1/prompt-specs.d.ts +1 -1
- package/dist/server/capabilities.d.ts +1 -1
- package/dist/stdio.process.test.js +3 -1
- package/dist/tools/project/content.js +8 -1
- package/dist/tools/project/developer-content.js +1 -1
- package/dist/tools/project/developer-helpers.d.ts +1 -0
- package/dist/tools/project/developer-helpers.test.js +1 -0
- package/dist/tools/project/developer-rename.d.ts +13 -0
- package/dist/tools/project/developer-rename.js +319 -0
- package/dist/tools/project/developer-rename.test.d.ts +5 -0
- package/dist/tools/project/developer-rename.test.js +296 -0
- package/dist/tools/project/reader-content.js +10 -3
- package/dist/tools/project/rename-instruction.d.ts +58 -0
- package/dist/tools/project/rename-instruction.js +104 -0
- package/dist/tools/query/reader-tool-helpers.d.ts +1 -1
- package/dist/tools/query/reader-tool-helpers.js +4 -0
- package/dist/tools/registry.d.ts +1 -1
- package/dist/transports/streamable-http.js +33 -7
- package/package.json +13 -9
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Rename tools over a real MCP client on the content-developer profile (ADR-0036).
|
|
4
|
+
* The Lightdash client is a hand-written fake that records rename reads and writes.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const client_1 = require("@modelcontextprotocol/client");
|
|
8
|
+
const server_1 = require("@modelcontextprotocol/server");
|
|
9
|
+
const vitest_1 = require("vitest");
|
|
10
|
+
const preview_ledger_js_1 = require("../../policy/preview-ledger.js");
|
|
11
|
+
const index_js_1 = require("../../profiles/index.js");
|
|
12
|
+
const server_js_1 = require("../../server/server.js");
|
|
13
|
+
const PROJECT = '11111111-1111-4111-8111-111111111111';
|
|
14
|
+
const CHART = '22222222-2222-4222-8222-222222222222';
|
|
15
|
+
const OTHER_CHART = '44444444-4444-4444-8444-444444444444';
|
|
16
|
+
const DASHBOARD = '33333333-3333-4333-8333-333333333333';
|
|
17
|
+
const UPDATED_AT = '2026-10-01T00:00:00.000Z';
|
|
18
|
+
const FIELDS = { orders: ['orders_status'], customers: ['customers_region'] };
|
|
19
|
+
function createUpstream() {
|
|
20
|
+
return {
|
|
21
|
+
chartUpdatedAt: UPDATED_AT,
|
|
22
|
+
impactChartUuids: [CHART],
|
|
23
|
+
fieldLists: [],
|
|
24
|
+
previews: [],
|
|
25
|
+
writes: [],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function fakeLightdash(up) {
|
|
29
|
+
return {
|
|
30
|
+
v1: {
|
|
31
|
+
rename: {
|
|
32
|
+
listChartFields: async (_projectUuid, chartUuid) => {
|
|
33
|
+
up.fieldLists.push(`chart:${chartUuid}`);
|
|
34
|
+
return { fields: FIELDS };
|
|
35
|
+
},
|
|
36
|
+
listDashboardFields: async (_projectUuid, dashboardUuid) => {
|
|
37
|
+
up.fieldLists.push(`dashboard:${dashboardUuid}`);
|
|
38
|
+
return { fields: FIELDS };
|
|
39
|
+
},
|
|
40
|
+
previewRename: async (_projectUuid, body) => {
|
|
41
|
+
up.previews.push(body);
|
|
42
|
+
return {
|
|
43
|
+
alerts: [],
|
|
44
|
+
charts: up.impactChartUuids.map((uuid) => ({ name: 'Orders', uuid })),
|
|
45
|
+
dashboardSchedulers: [],
|
|
46
|
+
dashboards: [{ name: 'Sales', uuid: DASHBOARD }],
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
renameChart: async (_projectUuid, chartUuid, body) => {
|
|
50
|
+
up.writes.push({ endpoint: `rename/chart/${chartUuid}`, body });
|
|
51
|
+
return {};
|
|
52
|
+
},
|
|
53
|
+
renameDashboardFilter: async (_projectUuid, dashboardUuid, body) => {
|
|
54
|
+
up.writes.push({ endpoint: `rename/dashboard/${dashboardUuid}`, body });
|
|
55
|
+
return {};
|
|
56
|
+
},
|
|
57
|
+
renameResources: async (_projectUuid, body) => {
|
|
58
|
+
up.writes.push({ endpoint: 'rename', body });
|
|
59
|
+
return { jobId: 'job-9' };
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
v2: {
|
|
64
|
+
charts: {
|
|
65
|
+
getSavedChart: async (_projectUuid, chartUuid) => ({
|
|
66
|
+
uuid: chartUuid,
|
|
67
|
+
updatedAt: up.chartUpdatedAt,
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
dashboards: {
|
|
71
|
+
getDashboard: async (_projectUuid, dashboardUuid) => ({
|
|
72
|
+
uuid: dashboardUuid,
|
|
73
|
+
updatedAt: UPDATED_AT,
|
|
74
|
+
}),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async function connect(up) {
|
|
80
|
+
const contextProvider = {
|
|
81
|
+
getContext: async () => ({
|
|
82
|
+
lightdashClient: fakeLightdash(up),
|
|
83
|
+
auth: { mode: 'env' },
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
const server = (0, server_js_1.createLightdashMcpServer)(contextProvider, {
|
|
87
|
+
profile: (0, index_js_1.getProfile)('content-developer'),
|
|
88
|
+
});
|
|
89
|
+
const [serverTransport, clientTransport] = server_1.InMemoryTransport.createLinkedPair();
|
|
90
|
+
await server.connect(serverTransport);
|
|
91
|
+
const client = new client_1.Client({ name: 'developer-rename-test', version: '0.0.0' });
|
|
92
|
+
await client.connect(clientTransport);
|
|
93
|
+
return { server, client };
|
|
94
|
+
}
|
|
95
|
+
(0, vitest_1.describe)('content-developer rename tools', () => {
|
|
96
|
+
let up;
|
|
97
|
+
let session;
|
|
98
|
+
async function call(tool, args) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
const result = await session.client.callTool({
|
|
101
|
+
name: `lightdash_${tool}`,
|
|
102
|
+
arguments: Object.assign({ projectUuid: PROJECT }, args),
|
|
103
|
+
});
|
|
104
|
+
const structured = ((_a = result.structuredContent) !== null && _a !== void 0 ? _a : {});
|
|
105
|
+
return {
|
|
106
|
+
isError: result.isError === true,
|
|
107
|
+
data: (_b = structured.data) !== null && _b !== void 0 ? _b : {},
|
|
108
|
+
error: structured.error,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async function confirm(preview) {
|
|
112
|
+
const confirmed = await call('confirm_preview', {
|
|
113
|
+
previewToken: preview.data.previewToken,
|
|
114
|
+
resourceKind: 'rename',
|
|
115
|
+
resourceKey: preview.data.resourceKey,
|
|
116
|
+
});
|
|
117
|
+
(0, vitest_1.expect)(confirmed.data.status).toBe('validated');
|
|
118
|
+
return String(confirmed.data.previewToken);
|
|
119
|
+
}
|
|
120
|
+
const chartRename = {
|
|
121
|
+
chartUuid: CHART,
|
|
122
|
+
type: 'field',
|
|
123
|
+
from: 'customers_old',
|
|
124
|
+
to: 'customers_region',
|
|
125
|
+
};
|
|
126
|
+
const projectRename = { type: 'field', from: 'orders_old', to: 'orders_status', model: 'orders' };
|
|
127
|
+
(0, vitest_1.beforeEach)(async () => {
|
|
128
|
+
(0, preview_ledger_js_1.resetPreviewLedgerForTests)();
|
|
129
|
+
up = createUpstream();
|
|
130
|
+
session = await connect(up);
|
|
131
|
+
});
|
|
132
|
+
(0, vitest_1.afterEach)(async () => {
|
|
133
|
+
await session.client.close().catch(() => undefined);
|
|
134
|
+
await session.server.close().catch(() => undefined);
|
|
135
|
+
});
|
|
136
|
+
(0, vitest_1.it)('lists the chart dropdown, including joined tables', async () => {
|
|
137
|
+
const listed = await call('list_rename_fields', { target: 'chart', chartUuid: CHART });
|
|
138
|
+
(0, vitest_1.expect)(listed.data).toEqual({ fields: FIELDS });
|
|
139
|
+
(0, vitest_1.expect)(up.fieldLists).toEqual([`chart:${CHART}`]);
|
|
140
|
+
});
|
|
141
|
+
(0, vitest_1.it)('renames a chart field to a joined-table id after confirm, without the project preview', async () => {
|
|
142
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'chart' }, chartRename));
|
|
143
|
+
(0, vitest_1.expect)(preview.data).toMatchObject({
|
|
144
|
+
resourceKind: 'rename',
|
|
145
|
+
resourceKey: CHART,
|
|
146
|
+
status: 'draft',
|
|
147
|
+
fields: FIELDS,
|
|
148
|
+
});
|
|
149
|
+
(0, vitest_1.expect)(preview.data.previewToken).toEqual(vitest_1.expect.any(String));
|
|
150
|
+
const applied = await call('rename_chart', Object.assign({ previewToken: await confirm(preview) }, chartRename));
|
|
151
|
+
(0, vitest_1.expect)(applied.data).toEqual({ applied: true, next: 'Run validate_chart on the saved chart.' });
|
|
152
|
+
(0, vitest_1.expect)(up.writes).toEqual([
|
|
153
|
+
{
|
|
154
|
+
endpoint: `rename/chart/${CHART}`,
|
|
155
|
+
body: { type: 'field', from: 'customers_old', to: 'customers_region' },
|
|
156
|
+
},
|
|
157
|
+
]);
|
|
158
|
+
(0, vitest_1.expect)(up.previews).toEqual([]);
|
|
159
|
+
});
|
|
160
|
+
(0, vitest_1.it)('rejects a new field id outside the dropdown before minting a token', async () => {
|
|
161
|
+
var _a;
|
|
162
|
+
const preview = await call('preview_rename', Object.assign(Object.assign({ scope: 'chart' }, chartRename), { to: 'customers_missing' }));
|
|
163
|
+
(0, vitest_1.expect)((_a = preview.error) === null || _a === void 0 ? void 0 : _a.code).toBe('RENAME_FIELD_UNLISTED');
|
|
164
|
+
(0, vitest_1.expect)(preview.data.previewToken).toBeUndefined();
|
|
165
|
+
(0, vitest_1.expect)(up.fieldLists).toEqual([`chart:${CHART}`]);
|
|
166
|
+
});
|
|
167
|
+
(0, vitest_1.it)('previews a chart model rename without loading the dropdown', async () => {
|
|
168
|
+
const preview = await call('preview_rename', {
|
|
169
|
+
scope: 'chart',
|
|
170
|
+
chartUuid: CHART,
|
|
171
|
+
type: 'model',
|
|
172
|
+
from: 'orders',
|
|
173
|
+
to: 'orders_v2',
|
|
174
|
+
});
|
|
175
|
+
(0, vitest_1.expect)(preview.data).toMatchObject({ resourceKind: 'rename', status: 'draft' });
|
|
176
|
+
(0, vitest_1.expect)(preview.data).not.toHaveProperty('fields');
|
|
177
|
+
(0, vitest_1.expect)(up.fieldLists).toEqual([]);
|
|
178
|
+
});
|
|
179
|
+
(0, vitest_1.it)('rejects an empty or unchanged rename before minting a token', async () => {
|
|
180
|
+
var _a;
|
|
181
|
+
const empty = await call('preview_rename', Object.assign(Object.assign({ scope: 'chart' }, chartRename), { from: '' }));
|
|
182
|
+
(0, vitest_1.expect)(empty.isError).toBe(true);
|
|
183
|
+
(0, vitest_1.expect)(empty.data.previewToken).toBeUndefined();
|
|
184
|
+
const unchanged = await call('preview_rename', Object.assign(Object.assign({ scope: 'chart' }, chartRename), { from: 'customers_region' }));
|
|
185
|
+
(0, vitest_1.expect)((_a = unchanged.error) === null || _a === void 0 ? void 0 : _a.code).toBe('RENAME_UNCHANGED');
|
|
186
|
+
(0, vitest_1.expect)(up.fieldLists).toEqual([]);
|
|
187
|
+
});
|
|
188
|
+
(0, vitest_1.it)('requires model for a project field rename', async () => {
|
|
189
|
+
var _a;
|
|
190
|
+
const preview = await call('preview_rename', Object.assign(Object.assign({ scope: 'project' }, projectRename), { model: undefined }));
|
|
191
|
+
(0, vitest_1.expect)((_a = preview.error) === null || _a === void 0 ? void 0 : _a.code).toBe('RENAME_TARGET');
|
|
192
|
+
(0, vitest_1.expect)(up.previews).toEqual([]);
|
|
193
|
+
});
|
|
194
|
+
(0, vitest_1.it)('rejects a project field id that is not prefixed by the explore name', async () => {
|
|
195
|
+
var _a;
|
|
196
|
+
const preview = await call('preview_rename', Object.assign(Object.assign({ scope: 'project' }, projectRename), { from: 'status' }));
|
|
197
|
+
(0, vitest_1.expect)((_a = preview.error) === null || _a === void 0 ? void 0 : _a.code).toBe('RENAME_TARGET');
|
|
198
|
+
(0, vitest_1.expect)(up.previews).toEqual([]);
|
|
199
|
+
});
|
|
200
|
+
(0, vitest_1.it)('rejects a rename name that would be compiled as a pattern', async () => {
|
|
201
|
+
var _a;
|
|
202
|
+
const preview = await call('preview_rename', Object.assign(Object.assign({ scope: 'chart' }, chartRename), { from: '.*' }));
|
|
203
|
+
(0, vitest_1.expect)((_a = preview.error) === null || _a === void 0 ? void 0 : _a.code).toBe('RENAME_TARGET');
|
|
204
|
+
(0, vitest_1.expect)(up.fieldLists).toEqual([]);
|
|
205
|
+
});
|
|
206
|
+
(0, vitest_1.it)('does not post with an unconfirmed draft token', async () => {
|
|
207
|
+
var _a;
|
|
208
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'chart' }, chartRename));
|
|
209
|
+
const applied = await call('rename_chart', Object.assign({ previewToken: preview.data.previewToken }, chartRename));
|
|
210
|
+
(0, vitest_1.expect)((_a = applied.error) === null || _a === void 0 ? void 0 : _a.code).toBe('PREVIEW_NOT_VALIDATED');
|
|
211
|
+
(0, vitest_1.expect)(up.writes).toEqual([]);
|
|
212
|
+
});
|
|
213
|
+
(0, vitest_1.it)('fails closed with PREVIEW_STALE when the chart changed after preview', async () => {
|
|
214
|
+
var _a;
|
|
215
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'chart' }, chartRename));
|
|
216
|
+
const previewToken = await confirm(preview);
|
|
217
|
+
up.chartUpdatedAt = '2026-10-02T00:00:00.000Z';
|
|
218
|
+
const applied = await call('rename_chart', Object.assign({ previewToken }, chartRename));
|
|
219
|
+
(0, vitest_1.expect)((_a = applied.error) === null || _a === void 0 ? void 0 : _a.code).toBe('PREVIEW_STALE');
|
|
220
|
+
(0, vitest_1.expect)(up.writes).toEqual([]);
|
|
221
|
+
});
|
|
222
|
+
(0, vitest_1.it)('unlocks only the rename that was previewed', async () => {
|
|
223
|
+
var _a, _b;
|
|
224
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'chart' }, chartRename));
|
|
225
|
+
const previewToken = await confirm(preview);
|
|
226
|
+
const otherTarget = await call('rename_chart', Object.assign(Object.assign({ previewToken }, chartRename), { to: 'orders_status' }));
|
|
227
|
+
(0, vitest_1.expect)((_a = otherTarget.error) === null || _a === void 0 ? void 0 : _a.code).toBe('PREVIEW_STALE');
|
|
228
|
+
const otherTool = await call('rename_project', Object.assign({ previewToken }, projectRename));
|
|
229
|
+
(0, vitest_1.expect)((_b = otherTool.error) === null || _b === void 0 ? void 0 : _b.code).toBe('PREVIEW_STALE');
|
|
230
|
+
(0, vitest_1.expect)(up.writes).toEqual([]);
|
|
231
|
+
});
|
|
232
|
+
(0, vitest_1.it)('rejects dryRun on apply and does not post', async () => {
|
|
233
|
+
var _a;
|
|
234
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'chart' }, chartRename));
|
|
235
|
+
const applied = await call('rename_chart', Object.assign(Object.assign({ previewToken: await confirm(preview) }, chartRename), { dryRun: true }));
|
|
236
|
+
(0, vitest_1.expect)((_a = applied.error) === null || _a === void 0 ? void 0 : _a.code).toBe('RENAME_DRY_RUN');
|
|
237
|
+
(0, vitest_1.expect)(up.writes).toEqual([]);
|
|
238
|
+
});
|
|
239
|
+
(0, vitest_1.it)('renames a dashboard filter after confirm', async () => {
|
|
240
|
+
const rename = {
|
|
241
|
+
dashboardUuid: DASHBOARD,
|
|
242
|
+
type: 'field',
|
|
243
|
+
from: 'orders_old',
|
|
244
|
+
to: 'orders_status',
|
|
245
|
+
};
|
|
246
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'dashboard-filter' }, rename));
|
|
247
|
+
(0, vitest_1.expect)(preview.data.resourceKey).toBe(DASHBOARD);
|
|
248
|
+
const applied = await call('rename_dashboard_filter', Object.assign({ previewToken: await confirm(preview) }, rename));
|
|
249
|
+
(0, vitest_1.expect)(applied.data).toEqual({
|
|
250
|
+
applied: true,
|
|
251
|
+
next: 'Run validate_dashboard on the saved dashboard.',
|
|
252
|
+
});
|
|
253
|
+
(0, vitest_1.expect)(up.writes).toEqual([
|
|
254
|
+
{
|
|
255
|
+
endpoint: `rename/dashboard/${DASHBOARD}`,
|
|
256
|
+
body: { type: 'field', from: 'orders_old', to: 'orders_status' },
|
|
257
|
+
},
|
|
258
|
+
]);
|
|
259
|
+
(0, vitest_1.expect)(up.fieldLists).toEqual([`dashboard:${DASHBOARD}`]);
|
|
260
|
+
(0, vitest_1.expect)(up.previews).toEqual([]);
|
|
261
|
+
});
|
|
262
|
+
(0, vitest_1.it)('rechecks the project uuid lists, posts once, and returns jobId without polling', async () => {
|
|
263
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'project' }, projectRename));
|
|
264
|
+
(0, vitest_1.expect)(preview.data).toMatchObject({
|
|
265
|
+
resourceKey: 'project:field:orders:orders_old:orders_status',
|
|
266
|
+
impact: { alerts: [], charts: [CHART], dashboardSchedulers: [], dashboards: [DASHBOARD] },
|
|
267
|
+
});
|
|
268
|
+
const applied = await call('rename_project', Object.assign({ previewToken: await confirm(preview) }, projectRename));
|
|
269
|
+
(0, vitest_1.expect)(applied.data.jobId).toBe('job-9');
|
|
270
|
+
(0, vitest_1.expect)(applied.data.next).toContain('lightdash download');
|
|
271
|
+
const dryRunBody = {
|
|
272
|
+
type: 'field',
|
|
273
|
+
from: 'orders_old',
|
|
274
|
+
to: 'orders_status',
|
|
275
|
+
model: 'orders',
|
|
276
|
+
dryRun: true,
|
|
277
|
+
};
|
|
278
|
+
(0, vitest_1.expect)(up.previews).toEqual([dryRunBody, dryRunBody]);
|
|
279
|
+
(0, vitest_1.expect)(up.writes).toEqual([
|
|
280
|
+
{
|
|
281
|
+
endpoint: 'rename',
|
|
282
|
+
body: { type: 'field', from: 'old', to: 'status', model: 'orders' },
|
|
283
|
+
},
|
|
284
|
+
]);
|
|
285
|
+
});
|
|
286
|
+
(0, vitest_1.it)('returns PREVIEW_STALE and does not post when the project uuid list changed', async () => {
|
|
287
|
+
var _a;
|
|
288
|
+
const preview = await call('preview_rename', Object.assign({ scope: 'project' }, projectRename));
|
|
289
|
+
const previewToken = await confirm(preview);
|
|
290
|
+
up.impactChartUuids = [CHART, OTHER_CHART];
|
|
291
|
+
const applied = await call('rename_project', Object.assign({ previewToken }, projectRename));
|
|
292
|
+
(0, vitest_1.expect)((_a = applied.error) === null || _a === void 0 ? void 0 : _a.code).toBe('PREVIEW_STALE');
|
|
293
|
+
(0, vitest_1.expect)(up.previews).toHaveLength(2);
|
|
294
|
+
(0, vitest_1.expect)(up.writes).toEqual([]);
|
|
295
|
+
});
|
|
296
|
+
});
|
|
@@ -181,12 +181,18 @@ function toReaderDashboard(dashboard, includeTiles) {
|
|
|
181
181
|
function registerSearchContent(server, contextProvider) {
|
|
182
182
|
(0, content_reader_js_1.registerContentReaderTool)(server, 'search_content', {
|
|
183
183
|
title: 'Search content',
|
|
184
|
-
description: 'Search charts, dashboards, spaces,
|
|
184
|
+
description: 'Search charts, dashboards, spaces, data apps, and documents in the resolved project',
|
|
185
185
|
safety: content_reader_js_1.METADATA_SAFETY,
|
|
186
186
|
inputSchema: {
|
|
187
187
|
projectUuid: (0, schema_fields_js_1.projectUuidField)().optional(),
|
|
188
188
|
query: zod_1.z.string().optional(),
|
|
189
|
-
contentTypes: zod_1.z
|
|
189
|
+
contentTypes: zod_1.z
|
|
190
|
+
.array(zod_1.z.enum(['chart', 'dashboard', 'space', 'data_app', 'document']))
|
|
191
|
+
.optional(),
|
|
192
|
+
includePersonalDocuments: zod_1.z
|
|
193
|
+
.boolean()
|
|
194
|
+
.optional()
|
|
195
|
+
.describe("Include the caller's personal documents. Omitted leaves the server default"),
|
|
190
196
|
spaceUuids: zod_1.z.array(zod_1.z.string()).optional(),
|
|
191
197
|
parentSpaceUuid: zod_1.z.string().optional(),
|
|
192
198
|
sortBy: zod_1.z.enum(common_1.CONTENT_SORT_BY_COLUMNS).optional(),
|
|
@@ -204,6 +210,7 @@ function registerSearchContent(server, contextProvider) {
|
|
|
204
210
|
spaceUuids: args.spaceUuids,
|
|
205
211
|
parentSpaceUuid: args.parentSpaceUuid,
|
|
206
212
|
contentTypes: args.contentTypes,
|
|
213
|
+
includePersonalDocuments: args.includePersonalDocuments,
|
|
207
214
|
search: args.query,
|
|
208
215
|
sortBy: args.sortBy,
|
|
209
216
|
sortDirection: args.sortDirection,
|
|
@@ -228,7 +235,7 @@ function registerSearchContent(server, contextProvider) {
|
|
|
228
235
|
function registerListVerifiedContent(server, contextProvider) {
|
|
229
236
|
(0, content_reader_js_1.registerContentReaderTool)(server, 'list_verified_content', {
|
|
230
237
|
title: 'List verified content',
|
|
231
|
-
description: 'List admin-verified charts and
|
|
238
|
+
description: 'List admin-verified charts, dashboards, data apps, and documents in the resolved project (prefer these as trusted seeds)',
|
|
232
239
|
safety: content_reader_js_1.METADATA_SAFETY,
|
|
233
240
|
inputSchema: {
|
|
234
241
|
projectUuid: (0, schema_fields_js_1.projectUuidField)().optional(),
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rename instructions bound by content-developer preview tokens (ADR-0036).
|
|
3
|
+
* The server rewrites chart references. This module only checks the instruction
|
|
4
|
+
* before a token is minted or a rename is posted.
|
|
5
|
+
*/
|
|
6
|
+
import { RenameRejectedError } from '../../policy/rename-rejected.js';
|
|
7
|
+
import type { RenameImpactBaseline } from '../../policy/preview-ledger.js';
|
|
8
|
+
import type { components } from '@lightdash-tools/common';
|
|
9
|
+
export { RenameRejectedError };
|
|
10
|
+
export type RenameKind = 'field' | 'model';
|
|
11
|
+
export type ChartRenameInstruction = {
|
|
12
|
+
scope: 'chart';
|
|
13
|
+
chartUuid: string;
|
|
14
|
+
type: RenameKind;
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
};
|
|
18
|
+
export type DashboardFilterRenameInstruction = {
|
|
19
|
+
scope: 'dashboard-filter';
|
|
20
|
+
dashboardUuid: string;
|
|
21
|
+
type: RenameKind;
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
};
|
|
25
|
+
export type ProjectRenameInstruction = {
|
|
26
|
+
scope: 'project';
|
|
27
|
+
type: RenameKind;
|
|
28
|
+
from: string;
|
|
29
|
+
to: string;
|
|
30
|
+
model: string | null;
|
|
31
|
+
};
|
|
32
|
+
export type RenameInstruction = ChartRenameInstruction | DashboardFilterRenameInstruction | ProjectRenameInstruction;
|
|
33
|
+
type RenameChangeList = components['schemas']['ApiRenameResponse']['results'];
|
|
34
|
+
/**
|
|
35
|
+
* Upstream chart rename compiles `from` into a regular expression.
|
|
36
|
+
* Names stay on the identifier alphabet the CLI already allows, plus digits.
|
|
37
|
+
*/
|
|
38
|
+
export declare function assertRenameToken(value: string, label: string): void;
|
|
39
|
+
/** Reject a no-op rename before a preview token is minted. */
|
|
40
|
+
export declare function assertRenameNamesDiffer(from: string, to: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* The replacement must be an id the field dropdown returned.
|
|
43
|
+
* Joined tables are included. The missing id (`from`) often is not.
|
|
44
|
+
*/
|
|
45
|
+
export declare function assertListedFieldId(fields: Readonly<Record<string, readonly string[]>>, to: string): void;
|
|
46
|
+
/** Apply tools write. A dry run belongs on preview_rename. */
|
|
47
|
+
export declare function assertApplyIsNotDryRun(dryRun: boolean | undefined): void;
|
|
48
|
+
export declare function projectRenameResourceKey(instruction: Pick<ProjectRenameInstruction, 'from' | 'model' | 'to' | 'type'>): string;
|
|
49
|
+
/**
|
|
50
|
+
* `POST /rename/preview` with a model treats `from` and `to` as full field ids.
|
|
51
|
+
* `POST /rename` looks the field up by short name on that explore's base table.
|
|
52
|
+
* The job body is the short name. The preview body keeps the full id.
|
|
53
|
+
*/
|
|
54
|
+
export declare function projectFieldShortName(model: string, fieldId: string): string;
|
|
55
|
+
export declare function projectRenameJobBody(instruction: ProjectRenameInstruction): components['schemas']['ApiRenameBody'];
|
|
56
|
+
export declare function projectRenameBody(instruction: ProjectRenameInstruction, dryRun?: boolean): components['schemas']['ApiRenameBody'];
|
|
57
|
+
/** Stable uuid lists stored on the project rename baseline. */
|
|
58
|
+
export declare function renameImpactFromChanges(results: RenameChangeList): RenameImpactBaseline;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Rename instructions bound by content-developer preview tokens (ADR-0036).
|
|
4
|
+
* The server rewrites chart references. This module only checks the instruction
|
|
5
|
+
* before a token is minted or a rename is posted.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.RenameRejectedError = void 0;
|
|
9
|
+
exports.assertRenameToken = assertRenameToken;
|
|
10
|
+
exports.assertRenameNamesDiffer = assertRenameNamesDiffer;
|
|
11
|
+
exports.assertListedFieldId = assertListedFieldId;
|
|
12
|
+
exports.assertApplyIsNotDryRun = assertApplyIsNotDryRun;
|
|
13
|
+
exports.projectRenameResourceKey = projectRenameResourceKey;
|
|
14
|
+
exports.projectFieldShortName = projectFieldShortName;
|
|
15
|
+
exports.projectRenameJobBody = projectRenameJobBody;
|
|
16
|
+
exports.projectRenameBody = projectRenameBody;
|
|
17
|
+
exports.renameImpactFromChanges = renameImpactFromChanges;
|
|
18
|
+
const rename_rejected_js_1 = require("../../policy/rename-rejected.js");
|
|
19
|
+
Object.defineProperty(exports, "RenameRejectedError", { enumerable: true, get: function () { return rename_rejected_js_1.RenameRejectedError; } });
|
|
20
|
+
const RENAME_NAME = /^[a-z0-9_]+$/;
|
|
21
|
+
/**
|
|
22
|
+
* Upstream chart rename compiles `from` into a regular expression.
|
|
23
|
+
* Names stay on the identifier alphabet the CLI already allows, plus digits.
|
|
24
|
+
*/
|
|
25
|
+
function assertRenameToken(value, label) {
|
|
26
|
+
if (!RENAME_NAME.test(value)) {
|
|
27
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_TARGET', `${label} must contain only lowercase letters, digits, and underscores`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Reject a no-op rename before a preview token is minted. */
|
|
31
|
+
function assertRenameNamesDiffer(from, to) {
|
|
32
|
+
assertRenameToken(from, 'from');
|
|
33
|
+
assertRenameToken(to, 'to');
|
|
34
|
+
if (from === to) {
|
|
35
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_UNCHANGED', 'from and to are the same, so there is nothing to rename');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The replacement must be an id the field dropdown returned.
|
|
40
|
+
* Joined tables are included. The missing id (`from`) often is not.
|
|
41
|
+
*/
|
|
42
|
+
function assertListedFieldId(fields, to) {
|
|
43
|
+
const listed = Object.values(fields).some((ids) => ids.includes(to));
|
|
44
|
+
if (!listed) {
|
|
45
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_FIELD_UNLISTED', 'The new field id must be one returned by list_rename_fields');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Apply tools write. A dry run belongs on preview_rename. */
|
|
49
|
+
function assertApplyIsNotDryRun(dryRun) {
|
|
50
|
+
if (dryRun === true) {
|
|
51
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_DRY_RUN', 'dryRun does not apply a rename. Call preview_rename.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function projectRenameResourceKey(instruction) {
|
|
55
|
+
var _a;
|
|
56
|
+
return `project:${instruction.type}:${(_a = instruction.model) !== null && _a !== void 0 ? _a : ''}:${instruction.from}:${instruction.to}`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `POST /rename/preview` with a model treats `from` and `to` as full field ids.
|
|
60
|
+
* `POST /rename` looks the field up by short name on that explore's base table.
|
|
61
|
+
* The job body is the short name. The preview body keeps the full id.
|
|
62
|
+
*/
|
|
63
|
+
function projectFieldShortName(model, fieldId) {
|
|
64
|
+
const prefix = `${model}_`;
|
|
65
|
+
if (!fieldId.startsWith(prefix) || fieldId.length === prefix.length) {
|
|
66
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_TARGET', `A project field id must start with "${prefix}"`);
|
|
67
|
+
}
|
|
68
|
+
const shortName = fieldId.slice(prefix.length);
|
|
69
|
+
assertRenameToken(shortName, 'field name');
|
|
70
|
+
return shortName;
|
|
71
|
+
}
|
|
72
|
+
function projectRenameJobBody(instruction) {
|
|
73
|
+
if (instruction.type === 'model') {
|
|
74
|
+
return Object.assign({ type: instruction.type, from: instruction.from, to: instruction.to }, (instruction.model == null ? {} : { model: instruction.model }));
|
|
75
|
+
}
|
|
76
|
+
if (instruction.type === 'field') {
|
|
77
|
+
if (instruction.model == null) {
|
|
78
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_TARGET', 'A project field rename needs model set to the explore name, plus full field ids');
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
type: 'field',
|
|
82
|
+
model: instruction.model,
|
|
83
|
+
from: projectFieldShortName(instruction.model, instruction.from),
|
|
84
|
+
to: projectFieldShortName(instruction.model, instruction.to),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const unhandled = instruction.type;
|
|
88
|
+
throw new rename_rejected_js_1.RenameRejectedError('RENAME_TARGET', `Unknown rename type '${String(unhandled)}'`);
|
|
89
|
+
}
|
|
90
|
+
function projectRenameBody(instruction, dryRun) {
|
|
91
|
+
return Object.assign(Object.assign({ type: instruction.type, from: instruction.from, to: instruction.to }, (instruction.model == null ? {} : { model: instruction.model })), (dryRun === undefined ? {} : { dryRun }));
|
|
92
|
+
}
|
|
93
|
+
function sortedUuids(items) {
|
|
94
|
+
return items.map((item) => item.uuid).sort();
|
|
95
|
+
}
|
|
96
|
+
/** Stable uuid lists stored on the project rename baseline. */
|
|
97
|
+
function renameImpactFromChanges(results) {
|
|
98
|
+
return {
|
|
99
|
+
alerts: sortedUuids(results.alerts),
|
|
100
|
+
charts: sortedUuids(results.charts),
|
|
101
|
+
dashboardSchedulers: sortedUuids(results.dashboardSchedulers),
|
|
102
|
+
dashboards: sortedUuids(results.dashboards),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Shared error/warning helpers for pin-scoped and bounded-query MCP tools
|
|
3
3
|
* (content-reader, content-developer, data-analyst, semantic discovery).
|
|
4
4
|
*/
|
|
5
|
-
import type { NormalizedQueryResult } from './result-normalizer.js';
|
|
6
5
|
import type { ContentReaderWarning } from '../../policy/envelope.js';
|
|
7
6
|
import type { TextContent, ToolErrorExtras } from '../shared.js';
|
|
7
|
+
import type { NormalizedQueryResult } from './result-normalizer.js';
|
|
8
8
|
export declare function codedErrorResult(code: string, message: string, extras?: ToolErrorExtras): TextContent;
|
|
9
9
|
/** Map ProjectScopeError to a tool error result; rethrow anything else. */
|
|
10
10
|
export declare function projectScopeErrorResult(err: unknown): TextContent;
|
|
@@ -31,6 +31,10 @@ const BLOCKED_POLICY_CODES = new Set([
|
|
|
31
31
|
'PREVIEW_NOT_VALIDATED',
|
|
32
32
|
'PREVIEW_NOT_OWNED',
|
|
33
33
|
'CHART_SLUG_EXISTS',
|
|
34
|
+
'RENAME_DRY_RUN',
|
|
35
|
+
'RENAME_FIELD_UNLISTED',
|
|
36
|
+
'RENAME_TARGET',
|
|
37
|
+
'RENAME_UNCHANGED',
|
|
34
38
|
]);
|
|
35
39
|
function codedErrorResult(code, message, extras) {
|
|
36
40
|
const result = (0, shared_js_1.toolErrorResult)(code, message, extras);
|
package/dist/tools/registry.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Register profile-mounted ToolModules (orchestration only).
|
|
3
3
|
*/
|
|
4
|
-
import type { ToolModule } from './types.js';
|
|
5
4
|
import type { McpContextProvider } from '../server/request-context.js';
|
|
5
|
+
import type { ToolModule } from './types.js';
|
|
6
6
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
7
7
|
export type { ToolModule } from './types.js';
|
|
8
8
|
/** Register profile-mounted tool modules (deterministic order = array order). */
|
|
@@ -9,7 +9,10 @@ const audit_js_1 = require("../audit/audit.js");
|
|
|
9
9
|
const tool_audit_context_js_1 = require("../audit/tool-audit-context.js");
|
|
10
10
|
const auth_mode_js_1 = require("../auth/auth-mode.js");
|
|
11
11
|
const invoke_origins_js_1 = require("../auth/oauth-broker/invoke-origins.js");
|
|
12
|
+
const pending_store_js_1 = require("../auth/oauth-broker/pending-store.js");
|
|
12
13
|
const routes_js_1 = require("../auth/oauth-broker/routes.js");
|
|
14
|
+
const open_client_directory_js_1 = require("../auth/oauth-broker/stores/open-client-directory.js");
|
|
15
|
+
const open_refresh_store_js_1 = require("../auth/oauth-broker/stores/open-refresh-store.js");
|
|
13
16
|
const bearer_context_provider_js_1 = require("../auth/providers/bearer-context-provider.js");
|
|
14
17
|
const env_context_provider_js_1 = require("../auth/providers/env-context-provider.js");
|
|
15
18
|
const request_state_key_js_1 = require("../auth/request-state-key.js");
|
|
@@ -180,7 +183,7 @@ async function handleMcpPost(ctx) {
|
|
|
180
183
|
}, () => (0, tool_audit_context_js_1.runWithToolAuditAuthAsync)(auditAuth, () => nodeHandler(req, res, body)));
|
|
181
184
|
}
|
|
182
185
|
async function createStreamableHttpServer(config) {
|
|
183
|
-
var _a;
|
|
186
|
+
var _a, _b, _c;
|
|
184
187
|
const inputConfig = config !== null && config !== void 0 ? config : (0, load_mcp_config_js_1.loadMcpHttpConfig)();
|
|
185
188
|
(0, load_mcp_config_js_1.emitMcpHttpSecurityWarnings)(inputConfig);
|
|
186
189
|
(0, runtime_js_1.warnIgnoredCliGuardrailEnvVars)();
|
|
@@ -191,6 +194,12 @@ async function createStreamableHttpServer(config) {
|
|
|
191
194
|
(0, audit_js_1.initAuditLog)((0, runtime_js_1.getAuditLogPath)());
|
|
192
195
|
let httpConfig = inputConfig;
|
|
193
196
|
let oauthBroker;
|
|
197
|
+
const refreshStore = await (0, open_refresh_store_js_1.openRefreshStore)(inputConfig);
|
|
198
|
+
const clientDirectory = await (0, open_client_directory_js_1.openClientDirectory)(inputConfig).catch(async (error) => {
|
|
199
|
+
var _a;
|
|
200
|
+
await ((_a = refreshStore === null || refreshStore === void 0 ? void 0 : refreshStore.close) === null || _a === void 0 ? void 0 : _a.call(refreshStore).catch(() => undefined));
|
|
201
|
+
throw error;
|
|
202
|
+
});
|
|
194
203
|
const mcpHttpHandler = createProcessMcpHttpHandler();
|
|
195
204
|
const mcpNodeHandler = (0, node_1.toNodeHandler)(mcpHttpHandler, { onerror: reportMcpHttpError });
|
|
196
205
|
const server = (0, node_http_1.createServer)((req, res) => {
|
|
@@ -201,22 +210,30 @@ async function createStreamableHttpServer(config) {
|
|
|
201
210
|
}
|
|
202
211
|
});
|
|
203
212
|
});
|
|
204
|
-
|
|
213
|
+
try {
|
|
214
|
+
await listen(server, inputConfig.port, inputConfig.host);
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
await ((_a = refreshStore === null || refreshStore === void 0 ? void 0 : refreshStore.close) === null || _a === void 0 ? void 0 : _a.call(refreshStore).catch(() => undefined));
|
|
218
|
+
await ((_b = clientDirectory === null || clientDirectory === void 0 ? void 0 : clientDirectory.close) === null || _b === void 0 ? void 0 : _b.call(clientDirectory).catch(() => undefined));
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
205
221
|
const address = server.address();
|
|
206
222
|
const port = typeof address === 'object' && address !== null ? address.port : inputConfig.port;
|
|
207
223
|
httpConfig = resolveHttpConfig(inputConfig, port);
|
|
208
|
-
const baseUrl = (
|
|
224
|
+
const baseUrl = (_c = httpConfig.publicUrl) !== null && _c !== void 0 ? _c : `http://${resolveListenHost(httpConfig.host)}:${port}`;
|
|
209
225
|
if (httpConfig.authMode === auth_mode_js_1.MCP_AUTH_MODE_LIGHTDASH_OAUTH) {
|
|
210
|
-
|
|
226
|
+
const brokerStore = clientDirectory
|
|
227
|
+
? new pending_store_js_1.InMemoryOAuthBrokerStore({ clientDirectory })
|
|
228
|
+
: undefined;
|
|
229
|
+
oauthBroker = (0, routes_js_1.createOAuthBroker)(httpConfig, brokerStore, refreshStore);
|
|
211
230
|
}
|
|
212
231
|
return {
|
|
213
232
|
port,
|
|
214
233
|
baseUrl,
|
|
215
234
|
config: httpConfig,
|
|
216
235
|
close: async () => {
|
|
217
|
-
|
|
218
|
-
reportMcpHttpError(err);
|
|
219
|
-
});
|
|
236
|
+
var _a, _b;
|
|
220
237
|
await new Promise((resolve, reject) => {
|
|
221
238
|
server.close((err) => {
|
|
222
239
|
if (err)
|
|
@@ -225,6 +242,15 @@ async function createStreamableHttpServer(config) {
|
|
|
225
242
|
resolve();
|
|
226
243
|
});
|
|
227
244
|
});
|
|
245
|
+
await mcpHttpHandler.close().catch((err) => {
|
|
246
|
+
reportMcpHttpError(err);
|
|
247
|
+
});
|
|
248
|
+
await ((_a = refreshStore === null || refreshStore === void 0 ? void 0 : refreshStore.close) === null || _a === void 0 ? void 0 : _a.call(refreshStore).catch((err) => {
|
|
249
|
+
reportMcpHttpError(err);
|
|
250
|
+
}));
|
|
251
|
+
await ((_b = clientDirectory === null || clientDirectory === void 0 ? void 0 : clientDirectory.close) === null || _b === void 0 ? void 0 : _b.call(clientDirectory).catch((err) => {
|
|
252
|
+
reportMcpHttpError(err);
|
|
253
|
+
}));
|
|
228
254
|
},
|
|
229
255
|
};
|
|
230
256
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightdash-tools/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "MCP server for Lightdash semantic-layer, organization-audit, content-reader, content-developer, content-governance, ai-agent-ops, ai-agent-chat, and data-analyst profiles.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -19,17 +19,21 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@modelcontextprotocol/
|
|
22
|
+
"@google-cloud/firestore": "^9.4.1",
|
|
23
|
+
"@modelcontextprotocol/node": "2.1.2",
|
|
24
|
+
"@modelcontextprotocol/server": "2.4.0",
|
|
24
25
|
"commander": "^15.0.0",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"@lightdash-tools/client": "0.
|
|
26
|
+
"ioredis": "^6.1.0",
|
|
27
|
+
"pg": "^8.23.1",
|
|
28
|
+
"zod": "4.6.7",
|
|
29
|
+
"@lightdash-tools/client": "0.25.0",
|
|
30
|
+
"@lightdash-tools/common": "0.25.0"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
+
"@electric-sql/pglite": "^0.6.0",
|
|
34
|
+
"@modelcontextprotocol/client": "2.4.0",
|
|
35
|
+
"@types/node": "^25.9.3",
|
|
36
|
+
"@types/pg": "^8.23.1"
|
|
33
37
|
},
|
|
34
38
|
"publishConfig": {
|
|
35
39
|
"access": "public"
|