@transcend-io/mcp-server-discovery 0.4.13 → 0.5.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/cli.mjs
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as DISCOVERY_OAUTH_SCOPES, r as getDiscoveryTools, t as DiscoveryMixin } from "./graphql-
|
|
3
|
-
import {
|
|
2
|
+
import { n as DISCOVERY_OAUTH_SCOPES, r as getDiscoveryTools, t as DiscoveryMixin } from "./graphql-ChZOyuMh.mjs";
|
|
3
|
+
import { createMCPServer, createTranscendRestClient } from "@transcend-io/mcp-server-base";
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/cli.ts
|
|
6
6
|
createMCPServer({
|
|
7
7
|
name: "transcend-mcp-discovery",
|
|
8
|
-
version: "0.
|
|
8
|
+
version: "0.5.0",
|
|
9
9
|
oauthScopes: DISCOVERY_OAUTH_SCOPES,
|
|
10
10
|
getTools: getDiscoveryTools,
|
|
11
|
-
createClients: ({ auth, sombraUrl, graphqlUrl, dashboardUrl }) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
createClients: ({ auth, sombraUrl, sombraCustomerKey, graphqlUrl, dashboardUrl }) => {
|
|
12
|
+
const graphql = new DiscoveryMixin(auth, graphqlUrl);
|
|
13
|
+
return {
|
|
14
|
+
rest: createTranscendRestClient(auth, graphql, {
|
|
15
|
+
sombraUrl,
|
|
16
|
+
sombraCustomerKey
|
|
17
|
+
}),
|
|
18
|
+
graphql,
|
|
19
|
+
dashboardUrl
|
|
20
|
+
};
|
|
21
|
+
}
|
|
16
22
|
});
|
|
17
23
|
//#endregion
|
|
18
24
|
export {};
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":["packageJson.version"],"sources":["../package.json","../src/cli.ts"],"sourcesContent":["","#!/usr/bin/env node\nimport { createMCPServer,
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":["packageJson.version"],"sources":["../package.json","../src/cli.ts"],"sourcesContent":["","#!/usr/bin/env node\nimport { createMCPServer, createTranscendRestClient } from '@transcend-io/mcp-server-base';\n\nimport packageJson from '../package.json' with { type: 'json' };\nimport { DiscoveryMixin } from './graphql.js';\nimport { DISCOVERY_OAUTH_SCOPES } from './scopes.js';\nimport { getDiscoveryTools } from './tools/index.js';\n\ncreateMCPServer({\n name: 'transcend-mcp-discovery',\n version: packageJson.version,\n oauthScopes: DISCOVERY_OAUTH_SCOPES,\n getTools: getDiscoveryTools,\n createClients: ({ auth, sombraUrl, sombraCustomerKey, graphqlUrl, dashboardUrl }) => {\n const graphql = new DiscoveryMixin(auth, graphqlUrl);\n return {\n rest: createTranscendRestClient(auth, graphql, { sombraUrl, sombraCustomerKey }),\n graphql,\n dashboardUrl,\n };\n },\n});\n"],"mappings":";;;;;ACQA,gBAAgB;CACd,MAAM;CACGA;CACT,aAAa;CACb,UAAU;CACV,gBAAgB,EAAE,MAAM,WAAW,mBAAmB,YAAY,mBAAmB;EACnF,MAAM,UAAU,IAAI,eAAe,MAAM,WAAW;AACpD,SAAO;GACL,MAAM,0BAA0B,MAAM,SAAS;IAAE;IAAW;IAAmB,CAAC;GAChF;GACA;GACD;;CAEJ,CAAC"}
|
|
@@ -18,6 +18,7 @@ function createDiscoveryClassifyTextTool(clients) {
|
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
idempotentHint: true
|
|
20
20
|
},
|
|
21
|
+
requireSombra: true,
|
|
21
22
|
zodSchema: ClassifyTextSchema,
|
|
22
23
|
handler: async ({ texts, categories, model }) => {
|
|
23
24
|
return createToolResult(true, {
|
|
@@ -106,6 +107,7 @@ function createDiscoveryNerExtractTool(clients) {
|
|
|
106
107
|
destructiveHint: false,
|
|
107
108
|
idempotentHint: true
|
|
108
109
|
},
|
|
110
|
+
requireSombra: true,
|
|
109
111
|
zodSchema: NerExtractSchema,
|
|
110
112
|
handler: async ({ text, entityTypes }) => {
|
|
111
113
|
const result = await rest.extractEntities({
|
|
@@ -426,4 +428,4 @@ var DiscoveryMixin = class extends TranscendGraphQLBase {
|
|
|
426
428
|
//#endregion
|
|
427
429
|
export { ListScansSchema as a, NerExtractSchema as i, DISCOVERY_OAUTH_SCOPES as n, ListPluginsSchema as o, getDiscoveryTools as r, ClassifyTextSchema as s, DiscoveryMixin as t };
|
|
428
430
|
|
|
429
|
-
//# sourceMappingURL=graphql-
|
|
431
|
+
//# sourceMappingURL=graphql-ChZOyuMh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-ChZOyuMh.mjs","names":["types.DiscoveryListDataSilosDocument","types.DiscoveryListDataSiloTypesDocument"],"sources":["../src/tools/discovery_classify_text.ts","../src/tools/discovery_list_plugins.ts","../src/tools/discovery_list_scans.ts","../src/tools/discovery_ner_extract.ts","../src/tools/index.ts","../src/scopes.ts","../src/__generated__/graphql.ts","../src/__generated__/gql.ts","../src/graphql.ts"],"sourcesContent":["import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nexport const ClassifyTextSchema = z.object({\n texts: z.array(z.string()).describe('Array of text strings to classify'),\n categories: z\n .array(z.string())\n .optional()\n .describe('Specific categories to classify against (optional)'),\n model: z.string().optional().describe('LLM model to use for classification (optional)'),\n});\nexport type ClassifyTextInput = z.infer<typeof ClassifyTextSchema>;\n\nexport function createDiscoveryClassifyTextTool(clients: ToolClients) {\n const { rest } = clients;\n return defineTool({\n name: 'discovery_classify_text',\n description:\n \"Classify text content using Transcend's LLM classifier to identify data categories\",\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n requireSombra: true,\n zodSchema: ClassifyTextSchema,\n handler: async ({ texts, categories, model }) => {\n const results = await rest.classifyText({\n texts,\n categories,\n model,\n });\n\n return createToolResult(true, {\n results,\n inputCount: texts.length,\n message: `Classified ${texts.length} text(s) successfully`,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DiscoveryMixin } from '../graphql.js';\n\nexport const ListPluginsSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListPluginsInput = z.infer<typeof ListPluginsSchema>;\n\nexport function createDiscoveryListPluginsTool(clients: ToolClients) {\n const graphql = clients.graphql as DiscoveryMixin;\n return defineTool({\n name: 'discovery_list_plugins',\n description: 'List all available discovery plugins (integration types) in your organization.',\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListPluginsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listDiscoveryPlugins({\n first: limit,\n after: cursor,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DiscoveryMixin } from '../graphql.js';\n\nexport const ListScansSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListScansInput = z.infer<typeof ListScansSchema>;\n\nexport function createDiscoveryListScansTool(clients: ToolClients) {\n const graphql = clients.graphql as DiscoveryMixin;\n return defineTool({\n name: 'discovery_list_scans',\n description: 'List all data classification scans. Returns data silos with classification info.',\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListScansSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listClassificationScans({\n first: limit,\n after: cursor,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nexport const NerExtractSchema = z.object({\n text: z.string().describe('Text to extract entities from'),\n entityTypes: z\n .array(z.string())\n .optional()\n .describe('Specific entity types to extract (optional)'),\n});\nexport type NerExtractInput = z.infer<typeof NerExtractSchema>;\n\nexport function createDiscoveryNerExtractTool(clients: ToolClients) {\n const { rest } = clients;\n return defineTool({\n name: 'discovery_ner_extract',\n description: 'Extract named entities (PII, organizations, locations, etc.) from text using NER',\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n requireSombra: true,\n zodSchema: NerExtractSchema,\n handler: async ({ text, entityTypes }) => {\n const result = await rest.extractEntities({\n text,\n entityTypes,\n });\n\n return createToolResult(true, {\n entities: result.entities,\n entityCount: result.entities.length,\n entityTypes: [...new Set(result.entities.map((e) => e.type))],\n message: `Extracted ${result.entities.length} entities from text`,\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createDiscoveryClassifyTextTool } from './discovery_classify_text.js';\nimport { createDiscoveryListPluginsTool } from './discovery_list_plugins.js';\nimport { createDiscoveryListScansTool } from './discovery_list_scans.js';\nimport { createDiscoveryNerExtractTool } from './discovery_ner_extract.js';\n\nexport function getDiscoveryTools(clients: ToolClients): ToolDefinition[] {\n return [\n createDiscoveryClassifyTextTool(clients),\n createDiscoveryNerExtractTool(clients),\n createDiscoveryListScansTool(clients),\n createDiscoveryListPluginsTool(clients),\n ];\n}\n","import { ScopeName } from '@transcend-io/privacy-types';\n\n/** OAuth scopes required for Discovery MCP tools (offline_access added by base). */\nexport const DISCOVERY_OAUTH_SCOPES = [\n ScopeName.ViewDataMap,\n ScopeName.ViewAssignedIntegrations,\n ScopeName.ViewCodeScanning,\n ScopeName.ManageCodeScanning,\n ScopeName.ViewPrompts,\n ScopeName.ViewPromptRuns,\n ScopeName.ExecutePrompt,\n] as const;\n","/* eslint-disable */\n/** Internal type. DO NOT USE DIRECTLY. */\ntype Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\n/** Internal type. DO NOT USE DIRECTLY. */\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type DiscoveryListDataSilosQueryVariables = Exact<{\n first?: number | null | undefined;\n}>;\n\n\nexport type DiscoveryListDataSilosQuery = { dataSilos: { totalCount: number, nodes: Array<{ id: string, title: string, type: string, createdAt: string }> } };\n\nexport type DiscoveryListDataSiloTypesQueryVariables = Exact<{\n first?: number | null | undefined;\n}>;\n\n\nexport type DiscoveryListDataSiloTypesQuery = { dataSilos: { totalCount: number, nodes: Array<{ id: string, title: string, type: string, description: string }> } };\n\n\nexport const DiscoveryListDataSilosDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"DiscoveryListDataSilos\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"dataSilos\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<DiscoveryListDataSilosQuery, DiscoveryListDataSilosQueryVariables>;\nexport const DiscoveryListDataSiloTypesDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"DiscoveryListDataSiloTypes\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"dataSilos\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"description\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<DiscoveryListDataSiloTypesQuery, DiscoveryListDataSiloTypesQueryVariables>;","/* eslint-disable */\nimport * as types from './graphql.js';\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\": typeof types.DiscoveryListDataSilosDocument,\n \"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\": typeof types.DiscoveryListDataSiloTypesDocument,\n};\nconst documents: Documents = {\n \"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\": types.DiscoveryListDataSilosDocument,\n \"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\": types.DiscoveryListDataSiloTypesDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;","import {\n TranscendGraphQLBase,\n type ClassificationScan,\n type DiscoveryPlugin,\n type ListOptions,\n type PaginatedResponse,\n} from '@transcend-io/mcp-server-base';\n\nimport { graphql } from './__generated__/gql.js';\n\nconst ListDataSilosForClassificationDoc = graphql(/* GraphQL */ `\n query DiscoveryListDataSilos($first: Int) {\n dataSilos(first: $first) {\n nodes {\n id\n title\n type\n createdAt\n }\n totalCount\n }\n }\n`);\n\nconst ListDataSiloTypesDoc = graphql(/* GraphQL */ `\n query DiscoveryListDataSiloTypes($first: Int) {\n dataSilos(first: $first) {\n nodes {\n id\n title\n type\n description\n }\n totalCount\n }\n }\n`);\n\nexport class DiscoveryMixin extends TranscendGraphQLBase {\n async listClassificationScans(\n options?: ListOptions,\n ): Promise<PaginatedResponse<ClassificationScan>> {\n const data = await this.makeRequest(ListDataSilosForClassificationDoc, {\n first: Math.min(options?.first ?? 50, 100),\n });\n const scans: ClassificationScan[] = data.dataSilos.nodes.map((silo) => ({\n id: silo.id,\n name: `Classification: ${silo.title}`,\n type: silo.type,\n status: 'COMPLETED',\n dataSiloId: silo.id,\n createdAt: silo.createdAt,\n }));\n return {\n nodes: scans,\n pageInfo: { hasNextPage: scans.length < data.dataSilos.totalCount, hasPreviousPage: false },\n totalCount: data.dataSilos.totalCount,\n };\n }\n\n async listDiscoveryPlugins(options?: ListOptions): Promise<PaginatedResponse<DiscoveryPlugin>> {\n const data = await this.makeRequest(ListDataSiloTypesDoc, {\n first: options?.first ?? 50,\n });\n const typeMap = new Map<string, DiscoveryPlugin>();\n data.dataSilos.nodes.forEach((silo) => {\n if (!typeMap.has(silo.type)) {\n typeMap.set(silo.type, {\n id: silo.type,\n name: silo.type.replace(/([A-Z])/g, ' $1').trim(),\n type: silo.type,\n description: `Integration for ${silo.type}`,\n isEnabled: true,\n });\n }\n });\n const plugins = Array.from(typeMap.values());\n return {\n nodes: plugins,\n pageInfo: { hasNextPage: false, hasPreviousPage: false },\n totalCount: plugins.length,\n };\n }\n}\n"],"mappings":";;;AAEA,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS,oCAAoC;CACxE,YAAY,EACT,MAAM,EAAE,QAAQ,CAAC,CACjB,UAAU,CACV,SAAS,qDAAqD;CACjE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iDAAiD;CACxF,CAAC;AAGF,SAAgB,gCAAgC,SAAsB;CACpE,MAAM,EAAE,SAAS;AACjB,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EACF,UAAU;EACV,UAAU;EACV,aAAa;GAAE,cAAc;GAAM,iBAAiB;GAAO,gBAAgB;GAAM;EACjF,eAAe;EACf,WAAW;EACX,SAAS,OAAO,EAAE,OAAO,YAAY,YAAY;AAO/C,UAAO,iBAAiB,MAAM;IAC5B,SAAA,MAPoB,KAAK,aAAa;KACtC;KACA;KACA;KACD,CAAC;IAIA,YAAY,MAAM;IAClB,SAAS,cAAc,MAAM,OAAO;IACrC,CAAC;;EAEL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AO,SAAS,SAAS,IAC1B,CAAC;EACF,MAAM,0BAAU,IAAI,KAA8B;AAClD,OAAK,UAAU,MAAM,SAAS,SAAS;AACrC,OAAI,CAAC,QAAQ,IAAI,KAAK,KAAK,CACzB,SAAQ,IAAI,KAAK,MAAM;IACrB,IAAI,KAAK;IACT,MAAM,KAAK,KAAK,QAAQ,YAAY,MAAM,CAAC,MAAM;IACjD,MAAM,KAAK;IACX,aAAa,mBAAmB,KAAK;IACrC,WAAW;IACZ,CAAC;IAEJ;EACF,MAAM,UAAU,MAAM,KAAK,QAAQ,QAAQ,CAAC;AAC5C,SAAO;GACL,OAAO;GACP,UAAU;IAAE,aAAa;IAAO,iBAAiB;IAAO;GACxD,YAAY,QAAQ;GACrB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ListScansSchema, i as NerExtractSchema, n as DISCOVERY_OAUTH_SCOPES, o as ListPluginsSchema, r as getDiscoveryTools, s as ClassifyTextSchema, t as DiscoveryMixin } from "./graphql-
|
|
1
|
+
import { a as ListScansSchema, i as NerExtractSchema, n as DISCOVERY_OAUTH_SCOPES, o as ListPluginsSchema, r as getDiscoveryTools, s as ClassifyTextSchema, t as DiscoveryMixin } from "./graphql-ChZOyuMh.mjs";
|
|
2
2
|
export { ClassifyTextSchema, DISCOVERY_OAUTH_SCOPES, DiscoveryMixin, ListPluginsSchema, ListScansSchema, NerExtractSchema, getDiscoveryTools };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transcend-io/mcp-server-discovery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Transcend MCP Server — Data Discovery tools.",
|
|
5
5
|
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-discovery",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
35
|
"graphql": "^16.14.0",
|
|
36
36
|
"zod": "^4.3.6",
|
|
37
|
-
"@transcend-io/mcp-server-base": "0.
|
|
37
|
+
"@transcend-io/mcp-server-base": "0.8.0",
|
|
38
38
|
"@transcend-io/privacy-types": "5.9.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-piEf44KX.mjs","names":["types.DiscoveryListDataSilosDocument","types.DiscoveryListDataSiloTypesDocument"],"sources":["../src/tools/discovery_classify_text.ts","../src/tools/discovery_list_plugins.ts","../src/tools/discovery_list_scans.ts","../src/tools/discovery_ner_extract.ts","../src/tools/index.ts","../src/scopes.ts","../src/__generated__/graphql.ts","../src/__generated__/gql.ts","../src/graphql.ts"],"sourcesContent":["import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nexport const ClassifyTextSchema = z.object({\n texts: z.array(z.string()).describe('Array of text strings to classify'),\n categories: z\n .array(z.string())\n .optional()\n .describe('Specific categories to classify against (optional)'),\n model: z.string().optional().describe('LLM model to use for classification (optional)'),\n});\nexport type ClassifyTextInput = z.infer<typeof ClassifyTextSchema>;\n\nexport function createDiscoveryClassifyTextTool(clients: ToolClients) {\n const { rest } = clients;\n return defineTool({\n name: 'discovery_classify_text',\n description:\n \"Classify text content using Transcend's LLM classifier to identify data categories\",\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ClassifyTextSchema,\n handler: async ({ texts, categories, model }) => {\n const results = await rest.classifyText({\n texts,\n categories,\n model,\n });\n\n return createToolResult(true, {\n results,\n inputCount: texts.length,\n message: `Classified ${texts.length} text(s) successfully`,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DiscoveryMixin } from '../graphql.js';\n\nexport const ListPluginsSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListPluginsInput = z.infer<typeof ListPluginsSchema>;\n\nexport function createDiscoveryListPluginsTool(clients: ToolClients) {\n const graphql = clients.graphql as DiscoveryMixin;\n return defineTool({\n name: 'discovery_list_plugins',\n description: 'List all available discovery plugins (integration types) in your organization.',\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListPluginsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listDiscoveryPlugins({\n first: limit,\n after: cursor,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { DiscoveryMixin } from '../graphql.js';\n\nexport const ListScansSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListScansInput = z.infer<typeof ListScansSchema>;\n\nexport function createDiscoveryListScansTool(clients: ToolClients) {\n const graphql = clients.graphql as DiscoveryMixin;\n return defineTool({\n name: 'discovery_list_scans',\n description: 'List all data classification scans. Returns data silos with classification info.',\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListScansSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listClassificationScans({\n first: limit,\n after: cursor,\n });\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nexport const NerExtractSchema = z.object({\n text: z.string().describe('Text to extract entities from'),\n entityTypes: z\n .array(z.string())\n .optional()\n .describe('Specific entity types to extract (optional)'),\n});\nexport type NerExtractInput = z.infer<typeof NerExtractSchema>;\n\nexport function createDiscoveryNerExtractTool(clients: ToolClients) {\n const { rest } = clients;\n return defineTool({\n name: 'discovery_ner_extract',\n description: 'Extract named entities (PII, organizations, locations, etc.) from text using NER',\n category: 'Data Discovery',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: NerExtractSchema,\n handler: async ({ text, entityTypes }) => {\n const result = await rest.extractEntities({\n text,\n entityTypes,\n });\n\n return createToolResult(true, {\n entities: result.entities,\n entityCount: result.entities.length,\n entityTypes: [...new Set(result.entities.map((e) => e.type))],\n message: `Extracted ${result.entities.length} entities from text`,\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createDiscoveryClassifyTextTool } from './discovery_classify_text.js';\nimport { createDiscoveryListPluginsTool } from './discovery_list_plugins.js';\nimport { createDiscoveryListScansTool } from './discovery_list_scans.js';\nimport { createDiscoveryNerExtractTool } from './discovery_ner_extract.js';\n\nexport function getDiscoveryTools(clients: ToolClients): ToolDefinition[] {\n return [\n createDiscoveryClassifyTextTool(clients),\n createDiscoveryNerExtractTool(clients),\n createDiscoveryListScansTool(clients),\n createDiscoveryListPluginsTool(clients),\n ];\n}\n","import { ScopeName } from '@transcend-io/privacy-types';\n\n/** OAuth scopes required for Discovery MCP tools (offline_access added by base). */\nexport const DISCOVERY_OAUTH_SCOPES = [\n ScopeName.ViewDataMap,\n ScopeName.ViewAssignedIntegrations,\n ScopeName.ViewCodeScanning,\n ScopeName.ManageCodeScanning,\n ScopeName.ViewPrompts,\n ScopeName.ViewPromptRuns,\n ScopeName.ExecutePrompt,\n] as const;\n","/* eslint-disable */\n/** Internal type. DO NOT USE DIRECTLY. */\ntype Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\n/** Internal type. DO NOT USE DIRECTLY. */\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type DiscoveryListDataSilosQueryVariables = Exact<{\n first?: number | null | undefined;\n}>;\n\n\nexport type DiscoveryListDataSilosQuery = { dataSilos: { totalCount: number, nodes: Array<{ id: string, title: string, type: string, createdAt: string }> } };\n\nexport type DiscoveryListDataSiloTypesQueryVariables = Exact<{\n first?: number | null | undefined;\n}>;\n\n\nexport type DiscoveryListDataSiloTypesQuery = { dataSilos: { totalCount: number, nodes: Array<{ id: string, title: string, type: string, description: string }> } };\n\n\nexport const DiscoveryListDataSilosDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"DiscoveryListDataSilos\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"dataSilos\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"createdAt\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<DiscoveryListDataSilosQuery, DiscoveryListDataSilosQueryVariables>;\nexport const DiscoveryListDataSiloTypesDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"DiscoveryListDataSiloTypes\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"dataSilos\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"first\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"title\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"description\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"totalCount\"}}]}}]}}]} as unknown as DocumentNode<DiscoveryListDataSiloTypesQuery, DiscoveryListDataSiloTypesQueryVariables>;","/* eslint-disable */\nimport * as types from './graphql.js';\nimport type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size\n */\ntype Documents = {\n \"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\": typeof types.DiscoveryListDataSilosDocument,\n \"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\": typeof types.DiscoveryListDataSiloTypesDocument,\n};\nconst documents: Documents = {\n \"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\": types.DiscoveryListDataSilosDocument,\n \"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\": types.DiscoveryListDataSiloTypesDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query DiscoveryListDataSilos($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n createdAt\\n }\\n totalCount\\n }\\n }\\n\"];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\"): (typeof documents)[\"\\n query DiscoveryListDataSiloTypes($first: Int) {\\n dataSilos(first: $first) {\\n nodes {\\n id\\n title\\n type\\n description\\n }\\n totalCount\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;","import {\n TranscendGraphQLBase,\n type ClassificationScan,\n type DiscoveryPlugin,\n type ListOptions,\n type PaginatedResponse,\n} from '@transcend-io/mcp-server-base';\n\nimport { graphql } from './__generated__/gql.js';\n\nconst ListDataSilosForClassificationDoc = graphql(/* GraphQL */ `\n query DiscoveryListDataSilos($first: Int) {\n dataSilos(first: $first) {\n nodes {\n id\n title\n type\n createdAt\n }\n totalCount\n }\n }\n`);\n\nconst ListDataSiloTypesDoc = graphql(/* GraphQL */ `\n query DiscoveryListDataSiloTypes($first: Int) {\n dataSilos(first: $first) {\n nodes {\n id\n title\n type\n description\n }\n totalCount\n }\n }\n`);\n\nexport class DiscoveryMixin extends TranscendGraphQLBase {\n async listClassificationScans(\n options?: ListOptions,\n ): Promise<PaginatedResponse<ClassificationScan>> {\n const data = await this.makeRequest(ListDataSilosForClassificationDoc, {\n first: Math.min(options?.first ?? 50, 100),\n });\n const scans: ClassificationScan[] = data.dataSilos.nodes.map((silo) => ({\n id: silo.id,\n name: `Classification: ${silo.title}`,\n type: silo.type,\n status: 'COMPLETED',\n dataSiloId: silo.id,\n createdAt: silo.createdAt,\n }));\n return {\n nodes: scans,\n pageInfo: { hasNextPage: scans.length < data.dataSilos.totalCount, hasPreviousPage: false },\n totalCount: data.dataSilos.totalCount,\n };\n }\n\n async listDiscoveryPlugins(options?: ListOptions): Promise<PaginatedResponse<DiscoveryPlugin>> {\n const data = await this.makeRequest(ListDataSiloTypesDoc, {\n first: options?.first ?? 50,\n });\n const typeMap = new Map<string, DiscoveryPlugin>();\n data.dataSilos.nodes.forEach((silo) => {\n if (!typeMap.has(silo.type)) {\n typeMap.set(silo.type, {\n id: silo.type,\n name: silo.type.replace(/([A-Z])/g, ' $1').trim(),\n type: silo.type,\n description: `Integration for ${silo.type}`,\n isEnabled: true,\n });\n }\n });\n const plugins = Array.from(typeMap.values());\n return {\n nodes: plugins,\n pageInfo: { hasNextPage: false, hasPreviousPage: false },\n totalCount: plugins.length,\n };\n }\n}\n"],"mappings":";;;AAEA,MAAa,qBAAqB,EAAE,OAAO;CACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS,oCAAoC;CACxE,YAAY,EACT,MAAM,EAAE,QAAQ,CAAC,CACjB,UAAU,CACV,SAAS,qDAAqD;CACjE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iDAAiD;CACxF,CAAC;AAGF,SAAgB,gCAAgC,SAAsB;CACpE,MAAM,EAAE,SAAS;AACjB,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EACF,UAAU;EACV,UAAU;EACV,aAAa;GAAE,cAAc;GAAM,iBAAiB;GAAO,gBAAgB;GAAM;EACjF,WAAW;EACX,SAAS,OAAO,EAAE,OAAO,YAAY,YAAY;AAO/C,UAAO,iBAAiB,MAAM;IAC5B,SAAA,MAPoB,KAAK,aAAa;KACtC;KACA;KACA;KACD,CAAC;IAIA,YAAY,MAAM;IAClB,SAAS,cAAc,MAAM,OAAO;IACrC,CAAC;;EAEL,CAAC;;;;ACzBJ,MAAa,oBAAoB,iBAAiB,OAAO,EACvD,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,6DAA6D,EAC1E,CAAC;AAGF,SAAgB,+BAA+B,SAAsB;CACnE,MAAM,UAAU,QAAQ;AACxB,QAAO,WAAW;EA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