@hypequery/mcp 0.10.1 → 0.11.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/dist/prompts/dataset-guide.d.ts.map +1 -1
- package/dist/prompts/dataset-guide.js +1 -0
- package/dist/tools/args.d.ts.map +1 -1
- package/dist/tools/args.js +4 -5
- package/dist/utils/http-client/discovery.d.ts.map +1 -1
- package/dist/utils/http-client/discovery.js +12 -2
- package/dist/utils/http-client/manifest.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-guide.d.ts","sourceRoot":"","sources":["../../src/prompts/dataset-guide.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,MAAM;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dataset-guide.d.ts","sourceRoot":"","sources":["../../src/prompts/dataset-guide.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,MAAM;;;;;;;;EAgJjF"}
|
|
@@ -121,6 +121,7 @@ ${datasetList.map((name) => `- ${name}`).join('\n')}
|
|
|
121
121
|
- \`notIn\`: Not in list
|
|
122
122
|
- \`between\`: Between two values
|
|
123
123
|
- \`like\`: Pattern match
|
|
124
|
+
- \`isNull\` / \`isNotNull\`: Field is (not) NULL; omit \`value\`, and only where the filter lists the operator
|
|
124
125
|
|
|
125
126
|
## Time Grains
|
|
126
127
|
- \`day\`: Daily aggregation
|
package/dist/tools/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/tools/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,qBAAqB,CAAC;AAmC7B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGjC,CAAC;AAaH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,CAS5F;AAED,wBAAgB,eAAe,CAC7B,OAAO,GAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAM,GAC1F,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/tools/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,qBAAqB,CAAC;AAmC7B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGjC,CAAC;AAaH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,CAS5F;AAED,wBAAgB,eAAe,CAC7B,OAAO,GAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAM,GAC1F,YAAY,EAAE,CAKhB"}
|
package/dist/tools/args.js
CHANGED
|
@@ -49,9 +49,8 @@ export function parseToolArgs(schema, toolName, args) {
|
|
|
49
49
|
return result.data;
|
|
50
50
|
}
|
|
51
51
|
export function toMetricFilters(filters = []) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
operator: filter.operator
|
|
55
|
-
value: filter.value
|
|
56
|
-
}));
|
|
52
|
+
// A null check (RFC 0023) carries no value, so none is copied onto it.
|
|
53
|
+
return filters.map(filter => (filter.value === undefined
|
|
54
|
+
? { field: filter.field, operator: filter.operator }
|
|
55
|
+
: { field: filter.field, operator: filter.operator, value: filter.value }));
|
|
57
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/utils/http-client/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/utils/http-client/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAA0B,MAAM,qBAAqB,CAAC;AAI1F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,EAAE,CAE7E;AAQD,+FAA+F;AAC/F,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ/G;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAc3F"}
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
+
const GENERIC_DESCRIPTION = 'Authorized client endpoints.';
|
|
1
2
|
export function clientDatasetNames(contract) {
|
|
2
3
|
return [...new Set(contract.endpoints.map(endpoint => endpoint.dataset))].sort();
|
|
3
4
|
}
|
|
5
|
+
/** Group text from the dataset endpoint when visible, else any endpoint of the group (id order). */
|
|
6
|
+
function groupText(endpoints, key) {
|
|
7
|
+
const ordered = [...endpoints.filter(endpoint => endpoint.kind === 'dataset'), ...endpoints.filter(endpoint => endpoint.kind === 'metric')];
|
|
8
|
+
return ordered.find(endpoint => endpoint.annotations?.[key] !== undefined)?.annotations?.[key];
|
|
9
|
+
}
|
|
4
10
|
/** Preserve endpoint-specific permissions instead of merging them into a synthetic dataset. */
|
|
5
11
|
export function clientDatasetProfile(contract, dataset) {
|
|
6
12
|
const endpoints = contract.endpoints.filter(endpoint => endpoint.dataset === dataset);
|
|
13
|
+
const label = groupText(endpoints, 'label'), description = groupText(endpoints, 'description');
|
|
7
14
|
return {
|
|
8
|
-
name: dataset,
|
|
15
|
+
name: dataset, ...(label === undefined ? {} : { label }), ...(description === undefined ? {} : { description }),
|
|
16
|
+
queryable: endpoints.some(endpoint => endpoint.kind === 'dataset'),
|
|
9
17
|
endpoints: endpoints.map(({ path: _path, schemaHash: _hash, ...profile }) => profile),
|
|
10
18
|
};
|
|
11
19
|
}
|
|
12
20
|
export function clientDatasetList(contract) {
|
|
13
21
|
const datasets = clientDatasetNames(contract).map(name => {
|
|
14
22
|
const endpoints = contract.endpoints.filter(endpoint => endpoint.dataset === name);
|
|
23
|
+
const label = groupText(endpoints, 'label');
|
|
15
24
|
return {
|
|
16
|
-
name,
|
|
25
|
+
name, ...(label === undefined ? {} : { label }),
|
|
26
|
+
description: groupText(endpoints, 'description') ?? GENERIC_DESCRIPTION,
|
|
17
27
|
queryable: endpoints.some(endpoint => endpoint.kind === 'dataset'),
|
|
18
28
|
dimensionCount: new Set(endpoints.flatMap(endpoint => Object.keys(endpoint.dimensions))).size,
|
|
19
29
|
measureCount: new Set(endpoints.flatMap(endpoint => Object.keys(endpoint.measures))).size,
|
|
@@ -2,14 +2,14 @@ import { buildMCPToolManifest } from '../../tools/tool-manifest.js';
|
|
|
2
2
|
import { resultSchema } from '../../tools/utils/result-schema.js';
|
|
3
3
|
const profileOutput = resultSchema({
|
|
4
4
|
type: 'object', additionalProperties: false, required: ['name', 'queryable', 'endpoints'],
|
|
5
|
-
properties: { name: { type: 'string' }, queryable: { type: 'boolean' }, endpoints: { type: 'array', items: { type: 'object' } } },
|
|
5
|
+
properties: { name: { type: 'string' }, label: { type: 'string' }, description: { type: 'string' }, queryable: { type: 'boolean' }, endpoints: { type: 'array', items: { type: 'object' } } },
|
|
6
6
|
});
|
|
7
7
|
const listOutput = resultSchema({
|
|
8
8
|
type: 'object', additionalProperties: false, required: ['datasets', 'total'],
|
|
9
9
|
properties: {
|
|
10
10
|
datasets: { type: 'array', items: { type: 'object', additionalProperties: false,
|
|
11
11
|
required: ['name', 'description', 'queryable', 'dimensionCount', 'measureCount', 'metricCount'],
|
|
12
|
-
properties: { name: { type: 'string' }, description: { type: 'string' }, queryable: { type: 'boolean' },
|
|
12
|
+
properties: { name: { type: 'string' }, label: { type: 'string' }, description: { type: 'string' }, queryable: { type: 'boolean' },
|
|
13
13
|
dimensionCount: { type: 'integer', minimum: 0 }, measureCount: { type: 'integer', minimum: 0 }, metricCount: { type: 'integer', minimum: 0 } },
|
|
14
14
|
} }, total: { type: 'integer', minimum: 0 },
|
|
15
15
|
},
|
|
@@ -34,12 +34,12 @@ export function clientHttpManifest(schemas, authorizedHash) {
|
|
|
34
34
|
const manifest = buildMCPToolManifest(schemas);
|
|
35
35
|
for (const tool of manifest.tools) {
|
|
36
36
|
if (tool.name === 'get_dataset_schema') {
|
|
37
|
-
tool.description = 'Inspect authorized endpoint profiles for a dataset group. Each endpoint retains its own permissions and defaults.';
|
|
37
|
+
tool.description = 'Inspect authorized endpoint profiles for a dataset group. Each endpoint retains its own permissions and defaults; annotations carry backend-authored field labels and descriptions.';
|
|
38
38
|
tool.inputSchema = { type: 'object', additionalProperties: false, properties: { dataset: { type: 'string' } }, required: ['dataset'] };
|
|
39
39
|
tool.outputSchema = profileOutput;
|
|
40
40
|
}
|
|
41
41
|
else if (tool.name === 'list_datasets') {
|
|
42
|
-
tool.description = 'List authorized dataset groups, including metric-only groups whose queryable flag is false.';
|
|
42
|
+
tool.description = 'List authorized dataset groups with their descriptions, including metric-only groups whose queryable flag is false.';
|
|
43
43
|
tool.inputSchema = { type: 'object', additionalProperties: false, properties: {} };
|
|
44
44
|
tool.outputSchema = listOutput;
|
|
45
45
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const MCP_PACKAGE_VERSION = "0.
|
|
1
|
+
export declare const MCP_PACKAGE_VERSION = "0.11.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypequery/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Governed ClickHouse MCP server for semantic metrics, datasets, Claude, Cursor, and AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"!dist/**/type-tests/**"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@hypequery/datasets": "^0.
|
|
41
|
+
"@hypequery/datasets": "^0.27.0",
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
43
43
|
"zod": "^4.6.6",
|
|
44
|
-
"@hypequery/protocol": "0.
|
|
44
|
+
"@hypequery/protocol": "0.24.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^20.11.30",
|