@transcend-io/mcp-server-config 0.0.0-stage → 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/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +26 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +82 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/src-DSpQACky.mjs +336 -0
- package/dist/src-DSpQACky.mjs.map +1 -0
- package/package.json +59 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @transcend-io/mcp-server-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pull and push `transcend.yml` files from MCP tools. Same behavior as `transcend inventory pull` and `transcend inventory push`.
|
|
4
|
+
|
|
5
|
+
These tools read and write files on your machine, so they run over `stdio` only. The hosted HTTP server does not list them.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | What it does |
|
|
10
|
+
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `config_pull` | Writes the organization configuration to an absolute `.yml` path. Returns counts. |
|
|
12
|
+
| `config_push` | Pushes a `.yml` file to Transcend. Needs confirmation. Returns errors and warnings. |
|
|
13
|
+
| `config_get_schema` | Section catalog by default; pass `resources` for partial schema, or `includeFullSchema` for the full file (very large). |
|
|
14
|
+
|
|
15
|
+
## Run
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx -y @transcend-io/mcp-server-config
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Auth works like the other MCP servers. See the [MCP README](../README.md).
|
|
22
|
+
|
|
23
|
+
## OAuth scopes
|
|
24
|
+
|
|
25
|
+
The server requests every scope that the pull and push paths can need. See `src/scopes.ts`.
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as CONFIG_OAUTH_SCOPES, t as getConfigTools } from "./src-DSpQACky.mjs";
|
|
3
|
+
import { TranscendGraphQLBase, createMCPServer, createTranscendRestClient } from "@transcend-io/mcp-server-base";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/cli.ts
|
|
6
|
+
createMCPServer({
|
|
7
|
+
name: "transcend-mcp-config",
|
|
8
|
+
version: "0.1.0",
|
|
9
|
+
oauthScopes: CONFIG_OAUTH_SCOPES,
|
|
10
|
+
getTools: getConfigTools,
|
|
11
|
+
createClients: ({ auth, sombraUrl, sombraCustomerKey, graphqlUrl, dashboardUrl }) => {
|
|
12
|
+
const graphql = new TranscendGraphQLBase(auth, graphqlUrl);
|
|
13
|
+
return {
|
|
14
|
+
rest: createTranscendRestClient(auth, graphql, {
|
|
15
|
+
sombraUrl,
|
|
16
|
+
sombraCustomerKey
|
|
17
|
+
}),
|
|
18
|
+
graphql,
|
|
19
|
+
dashboardUrl
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export {};
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":["packageJson.version"],"sources":["../package.json","../src/cli.ts"],"mappings":";;;;;ACWA,gBAAgB;CACd,MAAM;CACGA;CACT,aAAa;CACb,UAAU;CACV,gBAAgB,EAAE,MAAM,WAAW,mBAAmB,YAAY,mBAAmB;EACnF,MAAM,UAAU,IAAI,qBAAqB,MAAM,WAAW;AAC1D,SAAO;GACL,MAAM,0BAA0B,MAAM,SAAS;IAAE;IAAW;IAAmB,CAAC;GAChF;GACA;GACD;;CAEJ,CAAC"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ScopeName } from "@transcend-io/privacy-types";
|
|
2
|
+
import { TranscendPullResource } from "@transcend-io/sdk";
|
|
3
|
+
import { ToolClients, ToolDefinition, z } from "@transcend-io/mcp-server-base";
|
|
4
|
+
|
|
5
|
+
//#region src/scopes.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* OAuth scopes for the config MCP tools (offline_access added by base).
|
|
8
|
+
*
|
|
9
|
+
* The union of every scope the `transcend.yml` pull and push paths can need, so a
|
|
10
|
+
* user can pull or push any section after one sign-in.
|
|
11
|
+
*/
|
|
12
|
+
declare const CONFIG_OAUTH_SCOPES: ScopeName[];
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/tools/config_get_schema.d.ts
|
|
15
|
+
declare const ConfigGetSchemaSchema: z.ZodObject<{
|
|
16
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
17
|
+
apiKeys: TranscendPullResource.ApiKeys;
|
|
18
|
+
customFields: TranscendPullResource.Attributes;
|
|
19
|
+
templates: TranscendPullResource.Templates;
|
|
20
|
+
dataSilos: TranscendPullResource.DataSilos;
|
|
21
|
+
enrichers: TranscendPullResource.Enrichers;
|
|
22
|
+
dataFlows: TranscendPullResource.DataFlows;
|
|
23
|
+
businessEntities: TranscendPullResource.BusinessEntities;
|
|
24
|
+
processingActivities: TranscendPullResource.ProcessingActivities;
|
|
25
|
+
actions: TranscendPullResource.Actions;
|
|
26
|
+
dataSubjects: TranscendPullResource.DataSubjects;
|
|
27
|
+
identifiers: TranscendPullResource.Identifiers;
|
|
28
|
+
cookies: TranscendPullResource.Cookies;
|
|
29
|
+
consentSites: TranscendPullResource.ConsentSites;
|
|
30
|
+
consentManager: TranscendPullResource.ConsentManager;
|
|
31
|
+
partitions: TranscendPullResource.Partitions;
|
|
32
|
+
vendors: TranscendPullResource.Vendors;
|
|
33
|
+
dataCategories: TranscendPullResource.DataCategories;
|
|
34
|
+
processingPurposes: TranscendPullResource.ProcessingPurposes;
|
|
35
|
+
actionItems: TranscendPullResource.ActionItems;
|
|
36
|
+
actionItemCollections: TranscendPullResource.ActionItemCollections;
|
|
37
|
+
teams: TranscendPullResource.Teams;
|
|
38
|
+
privacyCenters: TranscendPullResource.PrivacyCenters;
|
|
39
|
+
policies: TranscendPullResource.Policies;
|
|
40
|
+
messages: TranscendPullResource.Messages;
|
|
41
|
+
assessments: TranscendPullResource.Assessments;
|
|
42
|
+
assessmentTemplates: TranscendPullResource.AssessmentTemplates;
|
|
43
|
+
purposes: TranscendPullResource.Purposes;
|
|
44
|
+
preferenceOptions: TranscendPullResource.PreferenceOptions;
|
|
45
|
+
systemDiscovery: TranscendPullResource.SystemDiscovery;
|
|
46
|
+
preferenceWorkflowConfigs: TranscendPullResource.PreferenceWorkflowConfigs;
|
|
47
|
+
workflowConfigs: TranscendPullResource.WorkflowConfigs;
|
|
48
|
+
}>>>;
|
|
49
|
+
includeFullSchema: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
type ConfigGetSchemaInput = z.infer<typeof ConfigGetSchemaSchema>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/tools/config_pull.d.ts
|
|
54
|
+
declare const ConfigPullSchema: z.ZodObject<{
|
|
55
|
+
filePath: z.ZodString;
|
|
56
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
|
+
dataSiloIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
+
integrationNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
trackerStatuses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
skipDatapoints: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
skipSubDatapoints: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
includeGuessedCategories: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
type ConfigPullInput = z.infer<typeof ConfigPullSchema>;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/tools/config_push.d.ts
|
|
69
|
+
declare const ConfigPushSchema: z.ZodObject<{
|
|
70
|
+
filePath: z.ZodString;
|
|
71
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
+
publishToPrivacyCenter: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
classifyService: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
type ConfigPushInput = z.infer<typeof ConfigPushSchema>;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/index.d.ts
|
|
79
|
+
declare function getConfigTools(clients: ToolClients): ToolDefinition[];
|
|
80
|
+
//#endregion
|
|
81
|
+
export { CONFIG_OAUTH_SCOPES, type ConfigGetSchemaInput, ConfigGetSchemaSchema, type ConfigPullInput, ConfigPullSchema, type ConfigPushInput, ConfigPushSchema, getConfigTools };
|
|
82
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/scopes.ts","../src/tools/config_get_schema.ts","../src/tools/config_pull.ts","../src/tools/config_push.ts","../src/index.ts"],"mappings":";;;;;;;;;AASA;;cAAa,mBAAA,EAAqB,SAAA;;;cCYrB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KActB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,qBAAA;;;cCTrC,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;;KAgDjB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,gBAAA;;;cChDhC,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;KA4BjB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,gBAAA;;;iBC/C7B,cAAA,CAAe,OAAA,EAAS,WAAA,GAAc,cAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { ConsentTrackerStatus } from "@transcend-io/privacy-types";
|
|
2
|
+
import { DEFAULT_TRANSCEND_PULL_RESOURCES, TR_PULL_RESOURCE_SCOPE_MAP, TR_PUSH_RESOURCE_SCOPE_MAP, TR_YML_RESOURCE_TO_FIELD_NAME, TranscendInput, TranscendPullResource, parseTranscendYaml, pullTranscendConfiguration, serializeTranscendYaml, syncConfigurationToTranscend } from "@transcend-io/sdk";
|
|
3
|
+
import { ErrorCode, ToolError, createGraphqlRequestClient, defineTool, getOAuthScopes, z } from "@transcend-io/mcp-server-base";
|
|
4
|
+
import { toJsonSchema } from "@transcend-io/type-utils";
|
|
5
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
//#region src/scopes.ts
|
|
8
|
+
/**
|
|
9
|
+
* OAuth scopes for the config MCP tools (offline_access added by base).
|
|
10
|
+
*
|
|
11
|
+
* The union of every scope the `transcend.yml` pull and push paths can need, so a
|
|
12
|
+
* user can pull or push any section after one sign-in.
|
|
13
|
+
*/
|
|
14
|
+
const CONFIG_OAUTH_SCOPES = [...new Set([...Object.values(TR_PULL_RESOURCE_SCOPE_MAP).flat(), ...Object.values(TR_PUSH_RESOURCE_SCOPE_MAP).flat()])].sort();
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/tools/config_get_schema.ts
|
|
17
|
+
const TRANSCEND_PULL_RESOURCE_VALUES = Object.values(TranscendPullResource);
|
|
18
|
+
const TranscendPullResourceSchema = z.enum(TRANSCEND_PULL_RESOURCE_VALUES);
|
|
19
|
+
const FULL_SCHEMA_WARNING = "Full transcend.yml JSON schema is very large (about 160k tokens). Prefer requesting specific resources.";
|
|
20
|
+
const SCHEMA_CATALOG_HINT = "No schema returned. Pass resources for section schemas, or set includeFullSchema to true for the full file.";
|
|
21
|
+
const ConfigGetSchemaSchema = z.object({
|
|
22
|
+
resources: z.array(TranscendPullResourceSchema).optional().describe("Sections to describe, such as [\"dataSilos\"]. Omit for a catalog of all sections."),
|
|
23
|
+
includeFullSchema: z.boolean().optional().default(false).describe("When true and resources is omitted, return the full file schema. Very large; can overflow agent context.")
|
|
24
|
+
});
|
|
25
|
+
let cachedSchema;
|
|
26
|
+
/** Built on first use: the codec is large, and most sessions never need it. */
|
|
27
|
+
function getTranscendInputSchema() {
|
|
28
|
+
cachedSchema ??= toJsonSchema(TranscendInput);
|
|
29
|
+
return cachedSchema;
|
|
30
|
+
}
|
|
31
|
+
function buildKeyBySection(resources) {
|
|
32
|
+
const sections = resources.length > 0 ? resources : Object.values(TranscendPullResource);
|
|
33
|
+
return Object.fromEntries(sections.map((resource) => [resource, TR_YML_RESOURCE_TO_FIELD_NAME[resource]]));
|
|
34
|
+
}
|
|
35
|
+
function createConfigGetSchemaTool(_clients) {
|
|
36
|
+
return defineTool({
|
|
37
|
+
name: "config_get_schema",
|
|
38
|
+
description: "Get transcend.yml JSON schema for chosen sections, or a section catalog when resources is omitted. Use before editing a file for config_push. The full-file schema is huge; pass resources or only set includeFullSchema when you truly need every section at once.",
|
|
39
|
+
category: "Config",
|
|
40
|
+
readOnly: true,
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: true,
|
|
43
|
+
destructiveHint: false,
|
|
44
|
+
idempotentHint: true
|
|
45
|
+
},
|
|
46
|
+
zodSchema: ConfigGetSchemaSchema,
|
|
47
|
+
handler: async ({ resources = [], includeFullSchema = false }) => {
|
|
48
|
+
const keyBySection = buildKeyBySection(resources);
|
|
49
|
+
if (resources.length === 0 && !includeFullSchema) return {
|
|
50
|
+
keyBySection,
|
|
51
|
+
validSections: TRANSCEND_PULL_RESOURCE_VALUES,
|
|
52
|
+
hint: SCHEMA_CATALOG_HINT
|
|
53
|
+
};
|
|
54
|
+
const schema = getTranscendInputSchema();
|
|
55
|
+
if (resources.length === 0) return {
|
|
56
|
+
schema,
|
|
57
|
+
keyBySection,
|
|
58
|
+
warning: FULL_SCHEMA_WARNING
|
|
59
|
+
};
|
|
60
|
+
const keys = new Set(Object.values(keyBySection));
|
|
61
|
+
const { required: _required, ...rest } = schema;
|
|
62
|
+
return {
|
|
63
|
+
schema: {
|
|
64
|
+
...rest,
|
|
65
|
+
properties: Object.fromEntries(Object.entries(schema.properties ?? {}).filter(([key]) => keys.has(key)))
|
|
66
|
+
},
|
|
67
|
+
keyBySection
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/helpers/assertScopesAvailable.ts
|
|
74
|
+
/**
|
|
75
|
+
* Fail fast when a stdio OAuth session never asked for scopes the call needs.
|
|
76
|
+
*
|
|
77
|
+
* Only the scopes requested at sign-in are known here, not the ones the user
|
|
78
|
+
* finally granted, and API keys carry no scope list at all. For those the server
|
|
79
|
+
* answers with an `ACCESS_DENIED` error that already names the missing scopes.
|
|
80
|
+
*
|
|
81
|
+
* @param graphql - Client whose current auth decides whether the check applies
|
|
82
|
+
* @param required - Scopes the call needs
|
|
83
|
+
* @throws ToolError with `missingScopes` when sign-in did not request them
|
|
84
|
+
*/
|
|
85
|
+
function assertScopesAvailable(graphql, required) {
|
|
86
|
+
if (graphql.effectiveAuth()?.type !== "oauthToken") return;
|
|
87
|
+
let requested;
|
|
88
|
+
try {
|
|
89
|
+
requested = getOAuthScopes();
|
|
90
|
+
} catch {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const missing = required.filter((scope) => !requested.includes(scope));
|
|
94
|
+
if (missing.length === 0) return;
|
|
95
|
+
throw new ToolError(ErrorCode.PERMISSION_ERROR, `This session did not request scopes needed for these sections: ${missing.join(", ")}. Sign in again with a server that includes the config tools, or use an API key that has them.`, false, { missingScopes: missing });
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/helpers/collectingLogger.ts
|
|
99
|
+
/** Maximum lines kept, so a large sync cannot flood a tool result. */
|
|
100
|
+
const MAX_LOGS = 200;
|
|
101
|
+
/**
|
|
102
|
+
* Logger that keeps lines in memory instead of printing.
|
|
103
|
+
*
|
|
104
|
+
* A stdio MCP server reserves stdout for protocol frames, so SDK output must not
|
|
105
|
+
* reach it.
|
|
106
|
+
*
|
|
107
|
+
* @returns The logger and the lines it captured
|
|
108
|
+
*/
|
|
109
|
+
function createCollectedLogger() {
|
|
110
|
+
const logs = [];
|
|
111
|
+
const add = (level) => (...args) => {
|
|
112
|
+
if (level === "debug" || logs.length >= MAX_LOGS) return;
|
|
113
|
+
logs.push({
|
|
114
|
+
level,
|
|
115
|
+
message: args.map((arg) => typeof arg === "string" ? arg : JSON.stringify(arg)).join(" ")
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
logger: {
|
|
120
|
+
debug: add("debug"),
|
|
121
|
+
info: add("info"),
|
|
122
|
+
warn: add("warn"),
|
|
123
|
+
error: add("error")
|
|
124
|
+
},
|
|
125
|
+
logs
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/helpers/configFilePath.ts
|
|
130
|
+
const YAML_EXTENSIONS = new Set([".yml", ".yaml"]);
|
|
131
|
+
/**
|
|
132
|
+
* Validate the path an agent passes for a `transcend.yml` file.
|
|
133
|
+
*
|
|
134
|
+
* Absolute paths only, because the server's working directory is not the
|
|
135
|
+
* agent's. YAML extensions only, so a tool call cannot overwrite arbitrary files.
|
|
136
|
+
*
|
|
137
|
+
* @param filePath - Path from the tool arguments
|
|
138
|
+
* @returns The normalized absolute path
|
|
139
|
+
* @throws ToolError when the path is relative or not a YAML file
|
|
140
|
+
*/
|
|
141
|
+
function assertConfigFilePath(filePath) {
|
|
142
|
+
if (!path.isAbsolute(filePath)) throw new ToolError(ErrorCode.VALIDATION_ERROR, `filePath must be absolute, got "${filePath}".`, false);
|
|
143
|
+
const normalized = path.normalize(filePath);
|
|
144
|
+
if (!YAML_EXTENSIONS.has(path.extname(normalized).toLowerCase())) throw new ToolError(ErrorCode.VALIDATION_ERROR, `filePath must end in .yml or .yaml, got "${filePath}".`, false);
|
|
145
|
+
return normalized;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/helpers/resources.ts
|
|
149
|
+
const VALID_RESOURCES = new Set(Object.values(TranscendPullResource));
|
|
150
|
+
/**
|
|
151
|
+
* Validate section names from a tool call.
|
|
152
|
+
*
|
|
153
|
+
* Tool inputs take plain strings instead of an enum. The 30 names would otherwise
|
|
154
|
+
* be repeated in the input schema of every tool, which counts against the size of
|
|
155
|
+
* `tools/list`. The error names every valid value, so a wrong guess costs one retry.
|
|
156
|
+
*
|
|
157
|
+
* @param names - Section names from the arguments
|
|
158
|
+
* @returns The names as resources
|
|
159
|
+
* @throws ToolError naming the unknown sections and all valid ones
|
|
160
|
+
*/
|
|
161
|
+
function parseResources(names) {
|
|
162
|
+
const unknown = names.filter((name) => !VALID_RESOURCES.has(name));
|
|
163
|
+
if (unknown.length > 0) throw new ToolError(ErrorCode.VALIDATION_ERROR, `Unknown sections: ${unknown.join(", ")}. Valid sections: ${[...VALID_RESOURCES].join(", ")}.`, false);
|
|
164
|
+
return names;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/helpers/sections.ts
|
|
168
|
+
/** Whether a top-level `transcend.yml` section has anything to sync. */
|
|
169
|
+
function hasConfigSection(value) {
|
|
170
|
+
if (value === void 0 || value === null) return false;
|
|
171
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
172
|
+
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Drop empty sections. An empty array such as `action-items: []` still counts as
|
|
177
|
+
* a present key, and would request scopes and sync attempts for nothing.
|
|
178
|
+
*/
|
|
179
|
+
function stripEmptyConfigSections(input) {
|
|
180
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => hasConfigSection(value)));
|
|
181
|
+
}
|
|
182
|
+
/** Item count per non-empty section, so a tool result never has to echo the file. */
|
|
183
|
+
function countConfigSections(input) {
|
|
184
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => hasConfigSection(value)).map(([key, value]) => [key, Array.isArray(value) ? value.length : Object.keys(value).length || 1]));
|
|
185
|
+
}
|
|
186
|
+
/** Resources whose section is present in the input. */
|
|
187
|
+
function resourcesInInput(input) {
|
|
188
|
+
return Object.values(TranscendPullResource).filter((resource) => hasConfigSection(input[TR_YML_RESOURCE_TO_FIELD_NAME[resource]]));
|
|
189
|
+
}
|
|
190
|
+
/** Union of the scopes for the given resources, from a scope map. */
|
|
191
|
+
function scopesForResources(resources, scopeMap) {
|
|
192
|
+
return [...new Set(resources.flatMap((resource) => scopeMap[resource]))].sort();
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/helpers/trackerStatuses.ts
|
|
196
|
+
const VALID_STATUSES = new Set(Object.values(ConsentTrackerStatus));
|
|
197
|
+
/**
|
|
198
|
+
* Validate tracker statuses from a tool call.
|
|
199
|
+
*
|
|
200
|
+
* @param names - Status names from the arguments
|
|
201
|
+
* @returns The names as statuses
|
|
202
|
+
* @throws ToolError naming the unknown statuses and all valid ones
|
|
203
|
+
*/
|
|
204
|
+
function parseTrackerStatuses(names) {
|
|
205
|
+
const unknown = names.filter((name) => !VALID_STATUSES.has(name));
|
|
206
|
+
if (unknown.length > 0) throw new ToolError(ErrorCode.VALIDATION_ERROR, `Unknown tracker statuses: ${unknown.join(", ")}. Valid: ${[...VALID_STATUSES].join(", ")}.`, false);
|
|
207
|
+
return names;
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/tools/config_pull.ts
|
|
211
|
+
const ConfigPullSchema = z.object({
|
|
212
|
+
filePath: z.string().describe("Absolute path of the transcend.yml file to write. Must end in .yml or .yaml."),
|
|
213
|
+
resources: z.array(z.string()).optional().describe(`Section names to pull, such as ["dataSilos", "purposes"]. Use ["all"] for every section. Defaults to ${DEFAULT_TRANSCEND_PULL_RESOURCES.join(", ")}. Valid names: config_get_schema.`),
|
|
214
|
+
dataSiloIds: z.array(z.string()).optional().describe("Only pull these data silo IDs. Cannot be combined with integrationNames."),
|
|
215
|
+
integrationNames: z.array(z.string()).optional().describe("Only pull data silos of these integration types, such as \"salesforce\"."),
|
|
216
|
+
trackerStatuses: z.array(z.string()).optional().describe("Cookie and data flow statuses to pull: LIVE or NEEDS_REVIEW. Defaults to all."),
|
|
217
|
+
skipDatapoints: z.boolean().optional().describe("Skip data points when pulling data silos. Faster for large organizations."),
|
|
218
|
+
skipSubDatapoints: z.boolean().optional().describe("Skip sub data points when pulling data silos."),
|
|
219
|
+
includeGuessedCategories: z.boolean().optional().describe("Include metadata about guessed data categories."),
|
|
220
|
+
pageSize: z.number().int().min(1).max(100).optional().describe("Records per API request. Defaults to 50."),
|
|
221
|
+
overwrite: z.boolean().optional().describe("Replace the file if it exists. Defaults to false, which fails instead.")
|
|
222
|
+
});
|
|
223
|
+
function createConfigPullTool(clients) {
|
|
224
|
+
return defineTool({
|
|
225
|
+
name: "config_pull",
|
|
226
|
+
description: "Pull organization configuration from Transcend into a transcend.yml file on disk. Same output as `transcend inventory pull`. Returns per-section counts, never the file contents. Read the file to see it. Use config_get_schema to learn the file format.",
|
|
227
|
+
category: "Config",
|
|
228
|
+
readOnly: false,
|
|
229
|
+
requireLocalFilesystem: true,
|
|
230
|
+
annotations: {
|
|
231
|
+
readOnlyHint: false,
|
|
232
|
+
destructiveHint: false,
|
|
233
|
+
idempotentHint: true
|
|
234
|
+
},
|
|
235
|
+
zodSchema: ConfigPullSchema,
|
|
236
|
+
handler: async ({ filePath, resources, dataSiloIds = [], integrationNames = [], trackerStatuses, skipDatapoints, skipSubDatapoints, includeGuessedCategories, pageSize = 50, overwrite = false }) => {
|
|
237
|
+
const target = assertConfigFilePath(filePath);
|
|
238
|
+
if (existsSync(target) && !overwrite) throw new ToolError(ErrorCode.VALIDATION_ERROR, `${target} already exists. Pass overwrite: true to replace it.`, false);
|
|
239
|
+
const resourcesToPull = !resources ? [...DEFAULT_TRANSCEND_PULL_RESOURCES] : resources.includes("all") ? Object.values(TranscendPullResource) : parseResources(resources);
|
|
240
|
+
const requiredScopes = scopesForResources(resourcesToPull, TR_PULL_RESOURCE_SCOPE_MAP);
|
|
241
|
+
assertScopesAvailable(clients.graphql, requiredScopes);
|
|
242
|
+
const { logger, logs } = createCollectedLogger();
|
|
243
|
+
const configuration = await pullTranscendConfiguration(createGraphqlRequestClient(clients.graphql), {
|
|
244
|
+
dataSiloIds,
|
|
245
|
+
integrationNames,
|
|
246
|
+
resources: resourcesToPull,
|
|
247
|
+
trackerStatuses: trackerStatuses && parseTrackerStatuses(trackerStatuses),
|
|
248
|
+
skipDatapoints,
|
|
249
|
+
skipSubDatapoints,
|
|
250
|
+
includeGuessedCategories,
|
|
251
|
+
pageSize,
|
|
252
|
+
debug: false,
|
|
253
|
+
logger
|
|
254
|
+
});
|
|
255
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
256
|
+
writeFileSync(target, serializeTranscendYaml(configuration));
|
|
257
|
+
return {
|
|
258
|
+
filePath: target,
|
|
259
|
+
resources: resourcesToPull,
|
|
260
|
+
sections: countConfigSections(configuration),
|
|
261
|
+
requiredScopes,
|
|
262
|
+
...logs.some((log) => log.level !== "info") && { logs }
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region src/tools/config_push.ts
|
|
269
|
+
const ConfigPushSchema = z.object({
|
|
270
|
+
filePath: z.string().describe("Absolute path of the transcend.yml file to push. Must end in .yml or .yaml."),
|
|
271
|
+
variables: z.record(z.string(), z.string()).optional().describe("Values for <<parameters.name>> placeholders in the file, keyed by name. Every placeholder in the file needs a value."),
|
|
272
|
+
publishToPrivacyCenter: z.boolean().optional().describe("Publish privacy center changes after the push. Defaults to false."),
|
|
273
|
+
classifyService: z.boolean().optional().describe("Run service classification on data silos during the push. Defaults to false."),
|
|
274
|
+
pageSize: z.number().int().min(1).max(100).optional().describe("Records per API request. Defaults to 50.")
|
|
275
|
+
});
|
|
276
|
+
function createConfigPushTool(clients) {
|
|
277
|
+
return defineTool({
|
|
278
|
+
name: "config_push",
|
|
279
|
+
description: "Push a transcend.yml file from disk to Transcend, creating and updating resources to match it. Same behavior as `transcend inventory push`. Empty sections are skipped. Returns success, per-resource errors, and warnings. Use config_get_schema for the file format and config_pull to start from the current state.",
|
|
280
|
+
category: "Config",
|
|
281
|
+
readOnly: false,
|
|
282
|
+
requireLocalFilesystem: true,
|
|
283
|
+
confirmation: { hint: "Creates and updates resources in the Transcend organization to match the transcend.yml file at filePath, across every section the file contains (data silos, purposes, workflows, policies, and more). Resources missing from the file are not deleted, but matching resources are overwritten. Check the file path, and whether publishToPrivacyCenter is set, before agreeing." },
|
|
284
|
+
annotations: {
|
|
285
|
+
readOnlyHint: false,
|
|
286
|
+
destructiveHint: true,
|
|
287
|
+
idempotentHint: true
|
|
288
|
+
},
|
|
289
|
+
zodSchema: ConfigPushSchema,
|
|
290
|
+
handler: async ({ filePath, variables = {}, publishToPrivacyCenter = false, classifyService = false, pageSize = 50 }) => {
|
|
291
|
+
const source = assertConfigFilePath(filePath);
|
|
292
|
+
let contents;
|
|
293
|
+
try {
|
|
294
|
+
contents = readFileSync(source, "utf-8");
|
|
295
|
+
} catch (error) {
|
|
296
|
+
throw new ToolError(ErrorCode.VALIDATION_ERROR, `Could not read ${source}: ${error instanceof Error ? error.message : String(error)}`, false);
|
|
297
|
+
}
|
|
298
|
+
let input;
|
|
299
|
+
try {
|
|
300
|
+
input = stripEmptyConfigSections(parseTranscendYaml(contents, variables, source));
|
|
301
|
+
} catch (error) {
|
|
302
|
+
throw new ToolError(ErrorCode.VALIDATION_ERROR, `${source} is not a valid transcend.yml: ${error instanceof Error ? error.message : String(error)}`, false);
|
|
303
|
+
}
|
|
304
|
+
const requiredScopes = scopesForResources(resourcesInInput(input), TR_PUSH_RESOURCE_SCOPE_MAP);
|
|
305
|
+
assertScopesAvailable(clients.graphql, requiredScopes);
|
|
306
|
+
const { logger, logs } = createCollectedLogger();
|
|
307
|
+
const result = await syncConfigurationToTranscend(input, createGraphqlRequestClient(clients.graphql), {
|
|
308
|
+
pageSize,
|
|
309
|
+
publishToPrivacyCenter,
|
|
310
|
+
classifyService,
|
|
311
|
+
logger
|
|
312
|
+
});
|
|
313
|
+
return {
|
|
314
|
+
success: result.success,
|
|
315
|
+
errors: result.errors,
|
|
316
|
+
...result.warnings && { warnings: result.warnings },
|
|
317
|
+
sections: countConfigSections(input),
|
|
318
|
+
requiredScopes,
|
|
319
|
+
...!result.success && { logs: result.logs ?? logs }
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/index.ts
|
|
326
|
+
function getConfigTools(clients) {
|
|
327
|
+
return [
|
|
328
|
+
createConfigPullTool(clients),
|
|
329
|
+
createConfigPushTool(clients),
|
|
330
|
+
createConfigGetSchemaTool(clients)
|
|
331
|
+
];
|
|
332
|
+
}
|
|
333
|
+
//#endregion
|
|
334
|
+
export { CONFIG_OAUTH_SCOPES as a, ConfigGetSchemaSchema as i, ConfigPushSchema as n, ConfigPullSchema as r, getConfigTools as t };
|
|
335
|
+
|
|
336
|
+
//# sourceMappingURL=src-DSpQACky.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-DSpQACky.mjs","names":[],"sources":["../src/scopes.ts","../src/tools/config_get_schema.ts","../src/helpers/assertScopesAvailable.ts","../src/helpers/collectingLogger.ts","../src/helpers/configFilePath.ts","../src/helpers/resources.ts","../src/helpers/sections.ts","../src/helpers/trackerStatuses.ts","../src/tools/config_pull.ts","../src/tools/config_push.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;AASA,MAAa,sBAAmC,CAC9C,GAAG,IAAI,IAAI,CACT,GAAG,OAAO,OAAO,2BAA2B,CAAC,MAAM,EACnD,GAAG,OAAO,OAAO,2BAA2B,CAAC,MAAM,CACpD,CAAC,CACH,CAAC,MAAM;;;ACNR,MAAM,iCAAiC,OAAO,OAAO,sBAAsB;AAK3E,MAAM,8BAA8B,EAAE,KAAK,+BAA+B;AAE1E,MAAM,sBACJ;AAEF,MAAM,sBACJ;AAEF,MAAa,wBAAwB,EAAE,OAAO;CAC5C,WAAW,EACR,MAAM,4BAA4B,CAClC,UAAU,CACV,SAAS,qFAAmF;CAC/F,mBAAmB,EAChB,SAAS,CACT,UAAU,CACV,QAAQ,MAAM,CACd,SACC,2GACD;CACJ,CAAC;AAIF,IAAI;;AAGJ,SAAS,0BAA2D;AAClE,kBAAiB,aAAa,eAAe;AAC7C,QAAO;;AAGT,SAAS,kBAAkB,WAA6C;CACtE,MAAM,WACJ,UAAU,SAAS,IACf,YACC,OAAO,OAAO,sBAAsB;AAC3C,QAAO,OAAO,YACZ,SAAS,KAAK,aAAa,CAAC,UAAU,8BAA8B,UAAU,CAAC,CAChF;;AAGH,SAAgB,0BAA0B,UAAuB;AAC/D,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EAGF,UAAU;EACV,UAAU;EACV,aAAa;GAAE,cAAc;GAAM,iBAAiB;GAA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AO,MAAM,IAExD,MACD;;GAGH,MAAM,iBAAiB,mBACrB,iBAAiB,MAAM,EACvB,2BACD;AACD,yBAAsB,QAAQ,SAAS,eAAe;GAEtD,MAAM,EAAE,QAAQ,SAAS,uBAAuB;GAChD,MAAM,SAAS,MAAM,6BACnB,OACA,2BAA2B,QAAQ,QAAQ,EAC3C;IAAE;IAAU;IAAwB;IAAiB;IAAQ,CAC9D;AAED,UAAO;IACL,SAAS,OAAO;IAChB,QAAQ,OAAO;IACf,GAAI,OAAO,YAAY,EAAE,UAAU,OAAO,UAAU;IACpD,UAAU,oBAAoB,MAAM;IACpC;IACA,GAAI,CAAC,OAAO,WAAW,EAAE,MAAM,OAAO,QAAQ,MAAM;IACrD;;EAEJ,CAAC;;;;AC7HJ,SAAgB,eAAe,SAAwC;AACrE,QAAO;EACL,qBAAqB,QAAQ;EAC7B,qBAAqB,QAAQ;EAC7B,0BAA0B,QAAQ;EACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transcend-io/mcp-server-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Transcend MCP Server — transcend.yml pull and push tools.",
|
|
5
|
+
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-config",
|
|
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-config"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"transcend-mcp-config": "./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
|
+
"dependencies": {
|
|
33
|
+
"@transcend-io/mcp-server-base": "^3.1.0",
|
|
34
|
+
"@transcend-io/privacy-types": "^7.1.1",
|
|
35
|
+
"@transcend-io/sdk": "^3.2.0",
|
|
36
|
+
"@transcend-io/type-utils": "^3.3.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@arethetypeswrong/cli": "0.18.3",
|
|
40
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
41
|
+
"@types/node": "24.13.3",
|
|
42
|
+
"publint": "0.3.21",
|
|
43
|
+
"tsdown": "0.21.10",
|
|
44
|
+
"typescript": "6.0.3",
|
|
45
|
+
"vitest": "4.1.11",
|
|
46
|
+
"zod": "4.6.6"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
50
|
+
"zod": "^4.6.6"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.12.0"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsdown",
|
|
57
|
+
"test": "vitest run --config ../../../vitest.config.mcp.ts",
|
|
58
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
59
|
+
"check:exports": "attw --pack . --ignore-rules cjs-resolves-to-esm",
|
|
60
|
+
"check:publint": "publint --level warning --strict --pack pnpm"
|
|
61
|
+
}
|
|
6
62
|
}
|