@transcend-io/mcp-server-workflows 0.1.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 +85 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +17 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/graphql-BE3vRhqA.mjs +204 -0
- package/dist/graphql-BE3vRhqA.mjs.map +1 -0
- package/dist/index.d.mts +44 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# @transcend-io/mcp-server-workflows
|
|
2
|
+
|
|
3
|
+
> **Alpha** — this package is under active development and has not yet been published to npm. APIs may change without notice.
|
|
4
|
+
|
|
5
|
+
Transcend MCP Server for workflow configuration. Provides tools for listing workflows, email templates, and updating workflow settings.
|
|
6
|
+
|
|
7
|
+
Requires **Node.js ≥ 22.12** (see `engines` in `package.json`).
|
|
8
|
+
|
|
9
|
+
For local runs from this repository, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** at the repo root (gitignored) and set your API key (see **Run from the monorepo**).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
When the package is available on npm, install the CLI globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @transcend-io/mcp-server-workflows
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Until then, run from a checkout of this repository (see **Run from the monorepo** below).
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# With TRANSCEND_API_KEY in the environment; from the monorepo use secret.env (see Run from the monorepo)
|
|
25
|
+
TRANSCEND_API_KEY=your-api-key transcend-mcp-workflows
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The process speaks MCP over **stdio** and is meant to be launched by an MCP client (for example Cursor or Claude Desktop), not used as an interactive shell.
|
|
29
|
+
|
|
30
|
+
### MCP client configuration
|
|
31
|
+
|
|
32
|
+
`npx` runs the package’s `transcend-mcp-workflows` binary (see `bin` in `package.json`).
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"transcend-workflows": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@transcend-io/mcp-server-workflows"],
|
|
40
|
+
"env": {
|
|
41
|
+
"TRANSCEND_API_KEY": "your-api-key"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
When developing in this repository, reuse the same variable names from root **`secret.env`** in the `env` block, or use your client’s env-file support if it has one.
|
|
49
|
+
|
|
50
|
+
### Run from the monorepo
|
|
51
|
+
|
|
52
|
+
1. **Credentials** — From the repository root, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** and set `TRANSCEND_API_KEY` (and optional URL overrides).
|
|
53
|
+
|
|
54
|
+
2. **Build and run** — `node ./dist/cli.mjs` matches the `transcend-mcp-workflows` `bin` (use `node` because `pnpm exec transcend-mcp-workflows` may not resolve this package’s own binary in a pnpm workspace):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# from the repository root
|
|
58
|
+
pnpm exec turbo run build --filter="@transcend-io/mcp-server-workflows..."
|
|
59
|
+
set -a && source ./secret.env && set +a
|
|
60
|
+
pnpm -F @transcend-io/mcp-server-workflows exec node ./dist/cli.mjs
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Alternative:** `./scripts/mcp-run.sh ./packages/mcp/mcp-server-workflows/dist/cli.mjs` (sources `secret.env` when present; run after build).
|
|
64
|
+
|
|
65
|
+
See [CONTRIBUTING.md](../../../CONTRIBUTING.md#mcp-servers) for workspace layout and `pnpm --filter` workflows.
|
|
66
|
+
|
|
67
|
+
### Environment variables
|
|
68
|
+
|
|
69
|
+
| Variable | Required | Default | Description |
|
|
70
|
+
| ----------------------- | -------- | ------------------------------------------ | ----------------- |
|
|
71
|
+
| `TRANSCEND_API_KEY` | Yes | — | Transcend API key |
|
|
72
|
+
| `TRANSCEND_API_URL` | No | `https://multi-tenant.sombra.transcend.io` | Sombra API URL |
|
|
73
|
+
| `TRANSCEND_GRAPHQL_URL` | No | `https://api.transcend.io` | GraphQL API URL |
|
|
74
|
+
|
|
75
|
+
**Monorepo:** keep these in root **`secret.env`** (from [`secret.env.example`](../../../secret.env.example)); see **Run from the monorepo**.
|
|
76
|
+
|
|
77
|
+
## Tools
|
|
78
|
+
|
|
79
|
+
- `workflows_list` — List workflows
|
|
80
|
+
- `workflows_list_email_templates` — List email templates
|
|
81
|
+
- `workflows_update_config` — Update workflow configuration
|
|
82
|
+
|
|
83
|
+
## Related packages
|
|
84
|
+
|
|
85
|
+
Also available as part of the unified [`@transcend-io/mcp-server`](../mcp-server/README.md) which includes all domains. See the [root README](../../../README.md#mcp-servers) for the full list.
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { n as getWorkflowTools, t as WorkflowsMixin } from "./graphql-BE3vRhqA.mjs";
|
|
3
|
+
import { TranscendRestClient, createMCPServer } from "@transcend-io/mcp-server-core";
|
|
4
|
+
//#region src/cli.ts
|
|
5
|
+
createMCPServer({
|
|
6
|
+
name: "transcend-mcp-workflows",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
getTools: getWorkflowTools,
|
|
9
|
+
createClients: (auth, sombraUrl, graphqlUrl) => ({
|
|
10
|
+
rest: new TranscendRestClient(auth, sombraUrl),
|
|
11
|
+
graphql: new WorkflowsMixin(auth, graphqlUrl)
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export {};
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createMCPServer, TranscendRestClient } from '@transcend-io/mcp-server-core';\n\nimport { WorkflowsMixin } from './graphql.js';\nimport { getWorkflowTools } from './tools/index.js';\n\ncreateMCPServer({\n name: 'transcend-mcp-workflows',\n version: '1.0.0',\n getTools: getWorkflowTools,\n createClients: (auth, sombraUrl, graphqlUrl) => ({\n rest: new TranscendRestClient(auth, sombraUrl),\n graphql: new WorkflowsMixin(auth, graphqlUrl),\n }),\n});\n"],"mappings":";;;;AAMA,gBAAgB;CACd,MAAM;CACN,SAAS;CACT,UAAU;CACV,gBAAgB,MAAM,WAAW,gBAAgB;EAC/C,MAAM,IAAI,oBAAoB,MAAM,UAAU;EAC9C,SAAS,IAAI,eAAe,MAAM,WAAW;EAC9C;CACF,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { PaginationSchema, TranscendGraphQLBase, createListResult, createToolResult, defineTool, z } from "@transcend-io/mcp-server-core";
|
|
2
|
+
//#region src/tools/workflows_list.ts
|
|
3
|
+
const ListWorkflowsSchema = PaginationSchema.extend({ cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)") });
|
|
4
|
+
function createWorkflowsListTool(clients) {
|
|
5
|
+
const graphql = clients.graphql;
|
|
6
|
+
return defineTool({
|
|
7
|
+
name: "workflows_list",
|
|
8
|
+
description: "List all workflows configured in your organization. Note: API does not support cursor pagination (max ~100 results).",
|
|
9
|
+
category: "Workflows",
|
|
10
|
+
readOnly: true,
|
|
11
|
+
annotations: {
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
idempotentHint: true
|
|
15
|
+
},
|
|
16
|
+
zodSchema: ListWorkflowsSchema,
|
|
17
|
+
handler: async ({ limit, cursor }) => {
|
|
18
|
+
const result = await graphql.listWorkflows({
|
|
19
|
+
first: limit,
|
|
20
|
+
after: cursor
|
|
21
|
+
});
|
|
22
|
+
return createListResult(result.nodes, {
|
|
23
|
+
totalCount: result.totalCount,
|
|
24
|
+
hasNextPage: result.pageInfo?.hasNextPage
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/tools/workflows_list_email_templates.ts
|
|
31
|
+
const ListEmailTemplatesSchema = PaginationSchema.extend({
|
|
32
|
+
cursor: z.string().optional().describe("Pagination cursor from previous response (where supported)"),
|
|
33
|
+
offset: z.coerce.number().min(0).optional().default(0).describe("Number of results to skip (default: 0)")
|
|
34
|
+
});
|
|
35
|
+
function createWorkflowsListEmailTemplatesTool(clients) {
|
|
36
|
+
const graphql = clients.graphql;
|
|
37
|
+
return defineTool({
|
|
38
|
+
name: "workflows_list_email_templates",
|
|
39
|
+
description: "List all email templates used in workflows and communications. Note: API does not support cursor pagination (max ~100 results).",
|
|
40
|
+
category: "Workflows",
|
|
41
|
+
readOnly: true,
|
|
42
|
+
annotations: {
|
|
43
|
+
readOnlyHint: true,
|
|
44
|
+
destructiveHint: false,
|
|
45
|
+
idempotentHint: true
|
|
46
|
+
},
|
|
47
|
+
zodSchema: ListEmailTemplatesSchema,
|
|
48
|
+
handler: async ({ limit, offset }) => {
|
|
49
|
+
const result = await graphql.listEmailTemplates({
|
|
50
|
+
first: limit,
|
|
51
|
+
offset
|
|
52
|
+
});
|
|
53
|
+
return createListResult(result.nodes, {
|
|
54
|
+
totalCount: result.totalCount,
|
|
55
|
+
hasNextPage: result.pageInfo?.hasNextPage
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/tools/workflows_update_config.ts
|
|
62
|
+
const UpdateWorkflowConfigSchema = z.object({
|
|
63
|
+
workflow_config_id: z.string().describe("ID of the workflow config to update (use workflows_list to find config IDs)"),
|
|
64
|
+
title: z.string().optional().describe("New title for the workflow"),
|
|
65
|
+
subtitle: z.string().optional().describe("New subtitle for the workflow"),
|
|
66
|
+
description: z.string().optional().describe("New description for the workflow"),
|
|
67
|
+
show_in_privacy_center: z.boolean().optional().describe("Whether to show this workflow in the Privacy Center")
|
|
68
|
+
});
|
|
69
|
+
function createWorkflowsUpdateConfigTool(clients) {
|
|
70
|
+
const graphql = clients.graphql;
|
|
71
|
+
return defineTool({
|
|
72
|
+
name: "workflows_update_config",
|
|
73
|
+
description: "Update the configuration for a workflow (title, subtitle, description, privacy center visibility)",
|
|
74
|
+
category: "Workflows",
|
|
75
|
+
readOnly: false,
|
|
76
|
+
confirmationHint: "Updates the workflow configuration",
|
|
77
|
+
annotations: {
|
|
78
|
+
readOnlyHint: false,
|
|
79
|
+
destructiveHint: false,
|
|
80
|
+
idempotentHint: true
|
|
81
|
+
},
|
|
82
|
+
zodSchema: UpdateWorkflowConfigSchema,
|
|
83
|
+
handler: async ({ workflow_config_id, title, subtitle, description, show_in_privacy_center }) => {
|
|
84
|
+
const updates = {};
|
|
85
|
+
if (title !== void 0) updates.title = title;
|
|
86
|
+
if (subtitle !== void 0) updates.subtitle = subtitle;
|
|
87
|
+
if (description !== void 0) updates.description = description;
|
|
88
|
+
if (show_in_privacy_center !== void 0) updates.showInPrivacyCenter = show_in_privacy_center;
|
|
89
|
+
return createToolResult(true, {
|
|
90
|
+
workflowConfig: await graphql.updateWorkflowConfig(workflow_config_id, updates),
|
|
91
|
+
message: "Workflow configuration updated successfully"
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/tools/index.ts
|
|
98
|
+
function getWorkflowTools(clients) {
|
|
99
|
+
return [
|
|
100
|
+
createWorkflowsListTool(clients),
|
|
101
|
+
createWorkflowsUpdateConfigTool(clients),
|
|
102
|
+
createWorkflowsListEmailTemplatesTool(clients)
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/graphql.ts
|
|
107
|
+
var WorkflowsMixin = class extends TranscendGraphQLBase {
|
|
108
|
+
async listWorkflows(options) {
|
|
109
|
+
const data = await this.makeRequest(`
|
|
110
|
+
query ListWorkflows($first: Int) {
|
|
111
|
+
workflows(first: $first) {
|
|
112
|
+
nodes {
|
|
113
|
+
id
|
|
114
|
+
title {
|
|
115
|
+
defaultMessage
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
totalCount
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`, { first: Math.min(options?.first || 50, 100) });
|
|
122
|
+
return {
|
|
123
|
+
nodes: data.workflows.nodes,
|
|
124
|
+
pageInfo: {
|
|
125
|
+
hasNextPage: data.workflows.nodes.length < data.workflows.totalCount,
|
|
126
|
+
hasPreviousPage: false
|
|
127
|
+
},
|
|
128
|
+
totalCount: data.workflows.totalCount
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
async updateWorkflowConfig(workflowConfigId, updates) {
|
|
132
|
+
const mutation = `
|
|
133
|
+
mutation UpdateWorkflowConfig($input: UpdateWorkflowConfigInput!) {
|
|
134
|
+
updateWorkflowConfig(input: $input) {
|
|
135
|
+
workflowConfig {
|
|
136
|
+
id
|
|
137
|
+
title {
|
|
138
|
+
defaultMessage
|
|
139
|
+
}
|
|
140
|
+
subtitle {
|
|
141
|
+
defaultMessage
|
|
142
|
+
}
|
|
143
|
+
description {
|
|
144
|
+
defaultMessage
|
|
145
|
+
}
|
|
146
|
+
showInPrivacyCenter
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
const input = {
|
|
152
|
+
workflowConfigId,
|
|
153
|
+
...updates
|
|
154
|
+
};
|
|
155
|
+
const wc = (await this.makeRequest(mutation, { input })).updateWorkflowConfig.workflowConfig;
|
|
156
|
+
return {
|
|
157
|
+
id: wc.id,
|
|
158
|
+
title: wc.title?.defaultMessage || "",
|
|
159
|
+
subtitle: wc.subtitle?.defaultMessage || "",
|
|
160
|
+
description: wc.description?.defaultMessage || "",
|
|
161
|
+
showInPrivacyCenter: wc.showInPrivacyCenter
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
async listEmailTemplates(options) {
|
|
165
|
+
const data = await this.makeRequest(`
|
|
166
|
+
query ListTemplates($first: Int, $offset: Int) {
|
|
167
|
+
templates(first: $first, offset: $offset) {
|
|
168
|
+
nodes {
|
|
169
|
+
id
|
|
170
|
+
title
|
|
171
|
+
type
|
|
172
|
+
isRequired
|
|
173
|
+
}
|
|
174
|
+
totalCount
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`, {
|
|
178
|
+
first: Math.min(options?.first || 50, 100),
|
|
179
|
+
offset: options?.offset || 0
|
|
180
|
+
});
|
|
181
|
+
const templates = data.templates.nodes.map((t) => ({
|
|
182
|
+
id: t.id,
|
|
183
|
+
name: t.title,
|
|
184
|
+
subject: "",
|
|
185
|
+
type: t.type,
|
|
186
|
+
locale: "",
|
|
187
|
+
isActive: t.isRequired,
|
|
188
|
+
createdAt: "",
|
|
189
|
+
updatedAt: ""
|
|
190
|
+
}));
|
|
191
|
+
return {
|
|
192
|
+
nodes: templates,
|
|
193
|
+
pageInfo: {
|
|
194
|
+
hasNextPage: templates.length < data.templates.totalCount,
|
|
195
|
+
hasPreviousPage: false
|
|
196
|
+
},
|
|
197
|
+
totalCount: data.templates.totalCount
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
export { ListWorkflowsSchema as a, ListEmailTemplatesSchema as i, getWorkflowTools as n, UpdateWorkflowConfigSchema as r, WorkflowsMixin as t };
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=graphql-BE3vRhqA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-BE3vRhqA.mjs","names":[],"sources":["../src/tools/workflows_list.ts","../src/tools/workflows_list_email_templates.ts","../src/tools/workflows_update_config.ts","../src/tools/index.ts","../src/graphql.ts"],"sourcesContent":["import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-core';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const ListWorkflowsSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n});\nexport type ListWorkflowsInput = z.infer<typeof ListWorkflowsSchema>;\n\nexport function createWorkflowsListTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_list',\n description:\n 'List all workflows configured in your organization. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Workflows',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListWorkflowsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listWorkflows({\n first: limit,\n after: cursor,\n });\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-core';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const ListEmailTemplatesSchema = PaginationSchema.extend({\n cursor: z\n .string()\n .optional()\n .describe('Pagination cursor from previous response (where supported)'),\n offset: z.coerce\n .number()\n .min(0)\n .optional()\n .default(0)\n .describe('Number of results to skip (default: 0)'),\n});\nexport type ListEmailTemplatesInput = z.infer<typeof ListEmailTemplatesSchema>;\n\nexport function createWorkflowsListEmailTemplatesTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_list_email_templates',\n description:\n 'List all email templates used in workflows and communications. Note: API does not support cursor pagination (max ~100 results).',\n category: 'Workflows',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListEmailTemplatesSchema,\n handler: async ({ limit, offset }) => {\n const result = await graphql.listEmailTemplates({\n first: limit,\n offset,\n });\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-core';\n\nimport type { WorkflowsMixin } from '../graphql.js';\n\nexport const UpdateWorkflowConfigSchema = z.object({\n workflow_config_id: z\n .string()\n .describe('ID of the workflow config to update (use workflows_list to find config IDs)'),\n title: z.string().optional().describe('New title for the workflow'),\n subtitle: z.string().optional().describe('New subtitle for the workflow'),\n description: z.string().optional().describe('New description for the workflow'),\n show_in_privacy_center: z\n .boolean()\n .optional()\n .describe('Whether to show this workflow in the Privacy Center'),\n});\nexport type UpdateWorkflowConfigInput = z.infer<typeof UpdateWorkflowConfigSchema>;\n\nexport function createWorkflowsUpdateConfigTool(clients: ToolClients) {\n const graphql = clients.graphql as WorkflowsMixin;\n return defineTool({\n name: 'workflows_update_config',\n description:\n 'Update the configuration for a workflow (title, subtitle, description, privacy center visibility)',\n category: 'Workflows',\n readOnly: false,\n confirmationHint: 'Updates the workflow configuration',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateWorkflowConfigSchema,\n handler: async ({\n workflow_config_id,\n title,\n subtitle,\n description,\n show_in_privacy_center,\n }) => {\n const updates: {\n title?: string;\n subtitle?: string;\n description?: string;\n showInPrivacyCenter?: boolean;\n } = {};\n\n if (title !== undefined) {\n updates.title = title;\n }\n if (subtitle !== undefined) {\n updates.subtitle = subtitle;\n }\n if (description !== undefined) {\n updates.description = description;\n }\n if (show_in_privacy_center !== undefined) {\n updates.showInPrivacyCenter = show_in_privacy_center;\n }\n\n const result = await graphql.updateWorkflowConfig(workflow_config_id, updates);\n\n return createToolResult(true, {\n workflowConfig: result,\n message: 'Workflow configuration updated successfully',\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-core';\n\nimport { createWorkflowsListTool } from './workflows_list.js';\nimport { createWorkflowsListEmailTemplatesTool } from './workflows_list_email_templates.js';\nimport { createWorkflowsUpdateConfigTool } from './workflows_update_config.js';\n\nexport function getWorkflowTools(clients: ToolClients): ToolDefinition[] {\n return [\n createWorkflowsListTool(clients),\n createWorkflowsUpdateConfigTool(clients),\n createWorkflowsListEmailTemplatesTool(clients),\n ];\n}\n","import {\n TranscendGraphQLBase,\n type EmailTemplate,\n type ListOptions,\n type PaginatedResponse,\n type Workflow,\n type WorkflowConfig,\n} from '@transcend-io/mcp-server-core';\n\nexport class WorkflowsMixin extends TranscendGraphQLBase {\n async listWorkflows(options?: ListOptions): Promise<PaginatedResponse<Workflow>> {\n const query = `\n query ListWorkflows($first: Int) {\n workflows(first: $first) {\n nodes {\n id\n title {\n defaultMessage\n }\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{ workflows: { nodes: Workflow[]; totalCount: number } }>(\n query,\n { first: Math.min(options?.first || 50, 100) },\n );\n return {\n nodes: data.workflows.nodes,\n pageInfo: {\n hasNextPage: data.workflows.nodes.length < data.workflows.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.workflows.totalCount,\n };\n }\n\n async updateWorkflowConfig(\n workflowConfigId: string,\n updates: {\n title?: string;\n subtitle?: string;\n description?: string;\n showInPrivacyCenter?: boolean;\n },\n ): Promise<WorkflowConfig> {\n const mutation = `\n mutation UpdateWorkflowConfig($input: UpdateWorkflowConfigInput!) {\n updateWorkflowConfig(input: $input) {\n workflowConfig {\n id\n title {\n defaultMessage\n }\n subtitle {\n defaultMessage\n }\n description {\n defaultMessage\n }\n showInPrivacyCenter\n }\n }\n }\n `;\n const input = { workflowConfigId, ...updates };\n const data = await this.makeRequest<{\n updateWorkflowConfig: {\n workflowConfig: {\n id: string;\n title: { defaultMessage: string } | null;\n subtitle: { defaultMessage: string } | null;\n description: { defaultMessage: string } | null;\n showInPrivacyCenter: boolean;\n };\n };\n }>(mutation, { input });\n const wc = data.updateWorkflowConfig.workflowConfig;\n return {\n id: wc.id,\n title: wc.title?.defaultMessage || '',\n subtitle: wc.subtitle?.defaultMessage || '',\n description: wc.description?.defaultMessage || '',\n showInPrivacyCenter: wc.showInPrivacyCenter,\n };\n }\n\n async listEmailTemplates(options?: ListOptions): Promise<PaginatedResponse<EmailTemplate>> {\n const query = `\n query ListTemplates($first: Int, $offset: Int) {\n templates(first: $first, offset: $offset) {\n nodes {\n id\n title\n type\n isRequired\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n templates: {\n nodes: Array<{ id: string; title: string; type: string; isRequired: boolean }>;\n totalCount: number;\n };\n }>(query, {\n first: Math.min(options?.first || 50, 100),\n offset: options?.offset || 0,\n });\n const templates: EmailTemplate[] = data.templates.nodes.map((t) => ({\n id: t.id,\n name: t.title,\n subject: '',\n type: t.type,\n locale: '',\n isActive: t.isRequired,\n createdAt: '',\n updatedAt: '',\n }));\n return {\n nodes: templates,\n pageInfo: {\n hasNextPage: templates.length < data.templates.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.templates.totalCount,\n };\n }\n}\n"],"mappings":";;AAUA,MAAa,sBAAsB,iBAAiB,OAAO,EACzD,QAAQ,EACL,QAAQ,CACR,UAAU,CACV,SAAS,6DAA6D,EAC1E,CAAC;AAGF,SAAgB,wBAAwB,SAAsB;CAC5D,MAAM,UAAU,QAAQ;AACxB,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,aAAa;GACpC,MAAM,SAAS,MAAM,QAAQ,cAAc;IACzC,OAAO;IACP,OAAO;IACR,CAAC;AAEF,UAAO,iBAAiB,OAAO,OAAO;IACpC,YAAY,OAAO;IACnB,aAAa,OAAO,UAAU;IAC/B,CAAC;;EAEL,CAAC;;;;AC7BJ,MAAa,2B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AK,UAAU,MAAM,KAAK,OAAO;GAClE,IAAI,EAAE;GACN,MAAM,EAAE;GACR,SAAS;GACT,MAAM,EAAE;GACR,QAAQ;GACR,UAAU,EAAE;GACZ,WAAW;GACX,WAAW;GACZ,EAAE;AACH,SAAO;GACL,OAAO;GACP,UAAU;IACR,aAAa,UAAU,SAAS,KAAK,UAAU;IAC/C,iBAAiB;IAClB;GACD,YAAY,KAAK,UAAU;GAC5B"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EmailTemplate, ListOptions, PaginatedResponse, ToolClients, ToolDefinition, TranscendGraphQLBase, Workflow, WorkflowConfig, z } from "@transcend-io/mcp-server-core";
|
|
2
|
+
|
|
3
|
+
//#region src/tools/index.d.ts
|
|
4
|
+
declare function getWorkflowTools(clients: ToolClients): ToolDefinition[];
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/graphql.d.ts
|
|
7
|
+
declare class WorkflowsMixin extends TranscendGraphQLBase {
|
|
8
|
+
listWorkflows(options?: ListOptions): Promise<PaginatedResponse<Workflow>>;
|
|
9
|
+
updateWorkflowConfig(workflowConfigId: string, updates: {
|
|
10
|
+
title?: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
showInPrivacyCenter?: boolean;
|
|
14
|
+
}): Promise<WorkflowConfig>;
|
|
15
|
+
listEmailTemplates(options?: ListOptions): Promise<PaginatedResponse<EmailTemplate>>;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/tools/workflows_list.d.ts
|
|
19
|
+
declare const ListWorkflowsSchema: z.ZodObject<{
|
|
20
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
21
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type ListWorkflowsInput = z.infer<typeof ListWorkflowsSchema>;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/tools/workflows_list_email_templates.d.ts
|
|
26
|
+
declare const ListEmailTemplatesSchema: z.ZodObject<{
|
|
27
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
28
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
29
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
type ListEmailTemplatesInput = z.infer<typeof ListEmailTemplatesSchema>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/tools/workflows_update_config.d.ts
|
|
34
|
+
declare const UpdateWorkflowConfigSchema: z.ZodObject<{
|
|
35
|
+
workflow_config_id: z.ZodString;
|
|
36
|
+
title: z.ZodOptional<z.ZodString>;
|
|
37
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
38
|
+
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
show_in_privacy_center: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
type UpdateWorkflowConfigInput = z.infer<typeof UpdateWorkflowConfigSchema>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { type ListEmailTemplatesInput, ListEmailTemplatesSchema, type ListWorkflowsInput, ListWorkflowsSchema, type UpdateWorkflowConfigInput, UpdateWorkflowConfigSchema, WorkflowsMixin, getWorkflowTools };
|
|
44
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/graphql.ts","../src/tools/workflows_list.ts","../src/tools/workflows_list_email_templates.ts","../src/tools/workflows_update_config.ts"],"mappings":";;;iBAMgB,gBAAA,CAAiB,OAAA,EAAS,WAAA,GAAc,cAAA;;;cCG3C,cAAA,SAAuB,oBAAA;EAC5B,aAAA,CAAc,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,QAAA;EA4BhE,oBAAA,CACJ,gBAAA,UACA,OAAA;IACE,KAAA;IACA,QAAA;IACA,WAAA;IACA,mBAAA;EAAA,IAED,OAAA,CAAQ,cAAA;EA0CL,kBAAA,CAAmB,OAAA,GAAU,WAAA,GAAc,OAAA,CAAQ,iBAAA,CAAkB,aAAA;AAAA;;;cC9EhE,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;KAMpB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,mBAAA;;;cCNnC,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;KAYzB,uBAAA,GAA0B,CAAA,CAAE,KAAA,QAAa,wBAAA;;;cClBxC,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;KAY3B,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,0BAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ListWorkflowsSchema, i as ListEmailTemplatesSchema, n as getWorkflowTools, r as UpdateWorkflowConfigSchema, t as WorkflowsMixin } from "./graphql-BE3vRhqA.mjs";
|
|
2
|
+
export { ListEmailTemplatesSchema, ListWorkflowsSchema, UpdateWorkflowConfigSchema, WorkflowsMixin, getWorkflowTools };
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@transcend-io/mcp-server-workflows",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Transcend MCP Server — Workflows tools.",
|
|
5
|
+
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-workflows",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "Transcend Inc.",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/transcend-io/tools.git",
|
|
11
|
+
"directory": "packages/mcp/mcp-server-workflows"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"transcend-mcp-workflows": "./dist/cli.mjs"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"types": "./dist/index.d.mts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"@transcend-io/source": "./src/index.ts",
|
|
25
|
+
"types": "./dist/index.d.mts",
|
|
26
|
+
"default": "./dist/index.mjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"check:exports": "attw --pack . --ignore-rules cjs-resolves-to-esm",
|
|
37
|
+
"check:publint": "publint --level warning --strict --pack pnpm"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "catalog:",
|
|
41
|
+
"@transcend-io/mcp-server-core": "workspace:*",
|
|
42
|
+
"zod": "catalog:"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@arethetypeswrong/cli": "catalog:",
|
|
46
|
+
"@types/node": "catalog:",
|
|
47
|
+
"publint": "catalog:",
|
|
48
|
+
"tsdown": "catalog:",
|
|
49
|
+
"typescript": "catalog:",
|
|
50
|
+
"vitest": "catalog:"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.12.0"
|
|
54
|
+
}
|
|
55
|
+
}
|