@taghost/mcp 1.0.0 → 1.0.1
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 +98 -4
- package/dist/chunk-JKPKXGK7.js +3384 -0
- package/dist/chunk-NP37ZIKB.js +3469 -0
- package/dist/chunk-ZM4TEOAC.js +3446 -0
- package/dist/chunk-ZSIUY6WV.js +3607 -0
- package/dist/index.cjs +583 -343
- package/dist/index.d.cts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +11 -1
- package/dist/server-BAkdXx6J.d.cts +208 -0
- package/dist/server-BAkdXx6J.d.ts +208 -0
- package/dist/server-BzjamriK.d.cts +215 -0
- package/dist/server-BzjamriK.d.ts +215 -0
- package/dist/server-XvrYGhnU.d.cts +209 -0
- package/dist/server-XvrYGhnU.d.ts +209 -0
- package/dist/server.cjs +561 -343
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/smithery.yaml +3 -2
package/dist/server.cjs
CHANGED
|
@@ -49,19 +49,31 @@ function getApiUrl() {
|
|
|
49
49
|
function credentialsPath(homeDir = process.env.TAGHOST_HOME || import_node_os.default.homedir()) {
|
|
50
50
|
return import_node_path.default.join(homeDir, ".taghost", "credentials.json");
|
|
51
51
|
}
|
|
52
|
+
var PLACEHOLDER_TOKEN_PATTERN = /^<?(your[_-].*token|replace[_-]?me|changeme|placeholder)>?$/i;
|
|
53
|
+
function sanitizeAuthToken(value) {
|
|
54
|
+
if (typeof value !== "string") return null;
|
|
55
|
+
const trimmed = value.trim();
|
|
56
|
+
if (!trimmed || PLACEHOLDER_TOKEN_PATTERN.test(trimmed)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return trimmed;
|
|
60
|
+
}
|
|
52
61
|
function resolveAuthToken() {
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
const apiToken = sanitizeAuthToken(process.env.TAGHOST_API_TOKEN);
|
|
63
|
+
if (apiToken) {
|
|
64
|
+
return apiToken;
|
|
55
65
|
}
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
const token = sanitizeAuthToken(process.env.TAGHOST_TOKEN);
|
|
67
|
+
if (token) {
|
|
68
|
+
return token;
|
|
58
69
|
}
|
|
59
70
|
const credsPath = credentialsPath();
|
|
60
71
|
if (import_node_fs.default.existsSync(credsPath)) {
|
|
61
72
|
try {
|
|
62
73
|
const data = JSON.parse(import_node_fs.default.readFileSync(credsPath, "utf8"));
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
const stored = sanitizeAuthToken(data?.token);
|
|
75
|
+
if (stored) {
|
|
76
|
+
return stored;
|
|
65
77
|
}
|
|
66
78
|
} catch {
|
|
67
79
|
}
|
|
@@ -101,16 +113,27 @@ function findProjectBinding(startDir = process.cwd()) {
|
|
|
101
113
|
// src/client/taghost-client.ts
|
|
102
114
|
var TagHostClient = class {
|
|
103
115
|
apiUrl;
|
|
104
|
-
|
|
116
|
+
explicitToken;
|
|
105
117
|
constructor(options = {}) {
|
|
106
118
|
this.apiUrl = (options.apiUrl || getApiUrl()).replace(/\/+$/, "");
|
|
107
|
-
this.
|
|
119
|
+
this.explicitToken = sanitizeAuthToken(options.token);
|
|
120
|
+
}
|
|
121
|
+
getToken() {
|
|
122
|
+
return this.explicitToken || resolveAuthToken();
|
|
108
123
|
}
|
|
109
124
|
async request(endpoint, options = {}) {
|
|
110
125
|
const url = endpoint.startsWith("http") ? endpoint : `${this.apiUrl}${endpoint.startsWith("/") ? "" : "/"}${endpoint}`;
|
|
111
126
|
const headers = new Headers(options.headers || {});
|
|
112
|
-
if (
|
|
113
|
-
|
|
127
|
+
if (!headers.has("Authorization")) {
|
|
128
|
+
const token = this.getToken();
|
|
129
|
+
if (!token) {
|
|
130
|
+
const error = new Error(
|
|
131
|
+
'Not authenticated with TagHost. Run "tag login" (saved to ~/.taghost/credentials.json) or set TAGHOST_API_TOKEN.'
|
|
132
|
+
);
|
|
133
|
+
error.status = 401;
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
114
137
|
}
|
|
115
138
|
const response = await fetch(url, {
|
|
116
139
|
...options,
|
|
@@ -334,6 +357,13 @@ var TagHostClient = class {
|
|
|
334
357
|
body: JSON.stringify(payload)
|
|
335
358
|
});
|
|
336
359
|
}
|
|
360
|
+
async cloneWordPressSite(projectId, payload) {
|
|
361
|
+
return this.request(`/projects/${projectId}/migrations/wordpress/clone`, {
|
|
362
|
+
method: "POST",
|
|
363
|
+
headers: { "Content-Type": "application/json" },
|
|
364
|
+
body: JSON.stringify(payload)
|
|
365
|
+
});
|
|
366
|
+
}
|
|
337
367
|
async listOrders(projectId, options = {}) {
|
|
338
368
|
const params = new URLSearchParams();
|
|
339
369
|
if (options.status) params.set("status", options.status);
|
|
@@ -556,154 +586,246 @@ var TagHostClient = class {
|
|
|
556
586
|
|
|
557
587
|
// src/tools/projects.ts
|
|
558
588
|
var import_zod = require("zod");
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
"
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
"
|
|
624
|
-
"
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
async ({ projectId, action, key, value, target }) => {
|
|
659
|
-
try {
|
|
660
|
-
const id = await client.resolveProjectId(projectId);
|
|
661
|
-
if (action === "list") {
|
|
662
|
-
const res = await client.getProjectEnv(id);
|
|
589
|
+
|
|
590
|
+
// src/scopes.ts
|
|
591
|
+
var MCP_SCOPES = [
|
|
592
|
+
{
|
|
593
|
+
id: "projects:read",
|
|
594
|
+
label: "Projects & quotas",
|
|
595
|
+
description: "List projects, inspect configuration, check quotas, and preview AST eject output.",
|
|
596
|
+
icon: "layers",
|
|
597
|
+
access: "read",
|
|
598
|
+
defaultSelected: true
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
id: "deployments:write",
|
|
602
|
+
label: "Deployments & environment",
|
|
603
|
+
description: "Deploy site bundles, publish partial files, manage env vars, set expiry, and rollback.",
|
|
604
|
+
icon: "deployed_code",
|
|
605
|
+
access: "write",
|
|
606
|
+
defaultSelected: true
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
id: "content:write",
|
|
610
|
+
label: "Edge content & collections",
|
|
611
|
+
description: "Edit [data-tag] bindings, patch HTML canvas elements, and publish CMS collection items.",
|
|
612
|
+
icon: "draw",
|
|
613
|
+
access: "write",
|
|
614
|
+
defaultSelected: true
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
id: "domains:write",
|
|
618
|
+
label: "Domains & DNS",
|
|
619
|
+
description: "Search/check domain availability, attach custom domains, verify SSL, and manage DNS records.",
|
|
620
|
+
icon: "language",
|
|
621
|
+
access: "write"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
id: "mail:read",
|
|
625
|
+
label: "TagMail (read)",
|
|
626
|
+
description: "List and read TagMail threads and check mail domain DNS verification.",
|
|
627
|
+
icon: "inbox",
|
|
628
|
+
access: "read"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
id: "mail:send",
|
|
632
|
+
label: "TagMail (send & mailboxes)",
|
|
633
|
+
description: "Send outbound transactional email and create workspace mailboxes.",
|
|
634
|
+
icon: "mail",
|
|
635
|
+
access: "write"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
id: "commerce:write",
|
|
639
|
+
label: "Commerce & orders",
|
|
640
|
+
description: "Configure stores, manage coupons, view/fulfill orders, and migrate catalogs.",
|
|
641
|
+
icon: "storefront",
|
|
642
|
+
access: "write"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
id: "forms:read",
|
|
646
|
+
label: "Forms, CRM & webhooks",
|
|
647
|
+
description: "Inspect form submissions, enroll leads in CRM sequences, and configure webhooks.",
|
|
648
|
+
icon: "assignment",
|
|
649
|
+
access: "write"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
id: "sql:read",
|
|
653
|
+
label: "Serverless D1 SQL (read-only)",
|
|
654
|
+
description: "Introspect project database schemas and execute read-only SELECT queries.",
|
|
655
|
+
icon: "database",
|
|
656
|
+
access: "read"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
id: "workspace:collaborate",
|
|
660
|
+
label: "Tasks, calendar, notes & Meet",
|
|
661
|
+
description: "Manage TagWork tasks, calendar events, notes, Meet rooms, and scheduled automations.",
|
|
662
|
+
icon: "event",
|
|
663
|
+
access: "write"
|
|
664
|
+
}
|
|
665
|
+
];
|
|
666
|
+
var ALL_MCP_SCOPES = MCP_SCOPES.map((s) => s.id);
|
|
667
|
+
var VALID_SCOPE_SET = new Set(ALL_MCP_SCOPES);
|
|
668
|
+
function hasMcpScope(granted, required) {
|
|
669
|
+
if (granted == null) return true;
|
|
670
|
+
if (granted.includes("*")) return true;
|
|
671
|
+
return granted.includes(required);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// src/tools/projects.ts
|
|
675
|
+
function registerProjectTools(server, client, scopes) {
|
|
676
|
+
if (hasMcpScope(scopes, "deployments:write")) {
|
|
677
|
+
server.tool(
|
|
678
|
+
"taghost_project_create",
|
|
679
|
+
"Create a new project on TagHost edge platform.",
|
|
680
|
+
{
|
|
681
|
+
name: import_zod.z.string().describe('Human readable name of the project (e.g. "Acme Storefront")'),
|
|
682
|
+
slug: import_zod.z.string().optional().describe('URL slug for the project (e.g. "acme-storefront")'),
|
|
683
|
+
framework: import_zod.z.string().optional().describe('Framework template (e.g. "html", "react", "nextjs", "vue")')
|
|
684
|
+
},
|
|
685
|
+
async ({ name, slug, framework }) => {
|
|
686
|
+
try {
|
|
687
|
+
const result = await client.createProject({ name, slug, framework });
|
|
663
688
|
return {
|
|
664
|
-
content: [
|
|
689
|
+
content: [
|
|
690
|
+
{
|
|
691
|
+
type: "text",
|
|
692
|
+
text: JSON.stringify(
|
|
693
|
+
{
|
|
694
|
+
success: true,
|
|
695
|
+
message: `Project "${name}" created successfully.`,
|
|
696
|
+
project: result.project || result
|
|
697
|
+
},
|
|
698
|
+
null,
|
|
699
|
+
2
|
|
700
|
+
)
|
|
701
|
+
}
|
|
702
|
+
]
|
|
703
|
+
};
|
|
704
|
+
} catch (err) {
|
|
705
|
+
return {
|
|
706
|
+
isError: true,
|
|
707
|
+
content: [{ type: "text", text: `Failed to create project: ${err.message}` }]
|
|
665
708
|
};
|
|
666
709
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
if (hasMcpScope(scopes, "projects:read")) {
|
|
714
|
+
server.tool(
|
|
715
|
+
"taghost_project_list",
|
|
716
|
+
"List all projects accessible within the current TagHost workspace.",
|
|
717
|
+
{
|
|
718
|
+
limit: import_zod.z.number().optional().describe("Maximum number of projects to return (default: 50)")
|
|
719
|
+
},
|
|
720
|
+
async ({ limit }) => {
|
|
721
|
+
try {
|
|
722
|
+
const result = await client.listProjects();
|
|
723
|
+
const list = Array.isArray(result) ? result : result.projects || [];
|
|
724
|
+
const items = limit ? list.slice(0, limit) : list;
|
|
675
725
|
return {
|
|
676
726
|
content: [
|
|
677
727
|
{
|
|
678
728
|
type: "text",
|
|
679
|
-
text: JSON.stringify({ success: true,
|
|
729
|
+
text: JSON.stringify({ success: true, count: items.length, projects: items }, null, 2)
|
|
680
730
|
}
|
|
681
731
|
]
|
|
682
732
|
};
|
|
733
|
+
} catch (err) {
|
|
734
|
+
return {
|
|
735
|
+
isError: true,
|
|
736
|
+
content: [{ type: "text", text: `Failed to list projects: ${err.message}` }]
|
|
737
|
+
};
|
|
683
738
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
server.tool(
|
|
742
|
+
"taghost_project_get",
|
|
743
|
+
"Get detailed information about a specific TagHost project, including active deployment and domains.",
|
|
744
|
+
{
|
|
745
|
+
projectId: import_zod.z.string().optional().describe('Project ID (e.g. "proj_..."). Defaults to active project.')
|
|
746
|
+
},
|
|
747
|
+
async ({ projectId }) => {
|
|
748
|
+
try {
|
|
749
|
+
const id = await client.resolveProjectId(projectId);
|
|
750
|
+
const result = await client.getProject(id);
|
|
689
751
|
return {
|
|
690
752
|
content: [
|
|
691
753
|
{
|
|
692
754
|
type: "text",
|
|
693
|
-
text: JSON.stringify({ success: true,
|
|
755
|
+
text: JSON.stringify({ success: true, project: result.project || result }, null, 2)
|
|
694
756
|
}
|
|
695
757
|
]
|
|
696
758
|
};
|
|
759
|
+
} catch (err) {
|
|
760
|
+
return {
|
|
761
|
+
isError: true,
|
|
762
|
+
content: [{ type: "text", text: `Failed to get project: ${err.message}` }]
|
|
763
|
+
};
|
|
697
764
|
}
|
|
698
|
-
return { isError: true, content: [{ type: "text", text: `Unknown action: ${action}` }] };
|
|
699
|
-
} catch (err) {
|
|
700
|
-
return {
|
|
701
|
-
isError: true,
|
|
702
|
-
content: [{ type: "text", text: `Failed to manage env vars: ${err.message}` }]
|
|
703
|
-
};
|
|
704
765
|
}
|
|
705
|
-
|
|
706
|
-
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
if (hasMcpScope(scopes, "deployments:write")) {
|
|
769
|
+
server.tool(
|
|
770
|
+
"taghost_env_manage",
|
|
771
|
+
"Manage environment variables for a TagHost project.",
|
|
772
|
+
{
|
|
773
|
+
projectId: import_zod.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
774
|
+
action: import_zod.z.enum(["list", "set", "delete"]).describe("Action to perform"),
|
|
775
|
+
key: import_zod.z.string().optional().describe("Environment variable key"),
|
|
776
|
+
value: import_zod.z.string().optional().describe("Environment variable value (for set action)"),
|
|
777
|
+
target: import_zod.z.enum(["production", "preview", "all"]).optional().describe("Deployment target")
|
|
778
|
+
},
|
|
779
|
+
async ({ projectId, action, key, value, target }) => {
|
|
780
|
+
try {
|
|
781
|
+
const id = await client.resolveProjectId(projectId);
|
|
782
|
+
if (action === "list") {
|
|
783
|
+
const res = await client.getProjectEnv(id);
|
|
784
|
+
return {
|
|
785
|
+
content: [{ type: "text", text: JSON.stringify({ success: true, envVars: res }, null, 2) }]
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
if (action === "set") {
|
|
789
|
+
if (!key || value === void 0) {
|
|
790
|
+
return {
|
|
791
|
+
isError: true,
|
|
792
|
+
content: [{ type: "text", text: 'Both key and value are required for "set" action.' }]
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
const res = await client.setProjectEnv(id, key, value, target || "all");
|
|
796
|
+
return {
|
|
797
|
+
content: [
|
|
798
|
+
{
|
|
799
|
+
type: "text",
|
|
800
|
+
text: JSON.stringify({ success: true, message: `Environment variable "${key}" set.`, result: res }, null, 2)
|
|
801
|
+
}
|
|
802
|
+
]
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
if (action === "delete") {
|
|
806
|
+
if (!key) {
|
|
807
|
+
return { isError: true, content: [{ type: "text", text: 'Key is required for "delete" action.' }] };
|
|
808
|
+
}
|
|
809
|
+
await client.deleteProjectEnv(id, key);
|
|
810
|
+
return {
|
|
811
|
+
content: [
|
|
812
|
+
{
|
|
813
|
+
type: "text",
|
|
814
|
+
text: JSON.stringify({ success: true, message: `Environment variable "${key}" deleted.` }, null, 2)
|
|
815
|
+
}
|
|
816
|
+
]
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
return { isError: true, content: [{ type: "text", text: `Unknown action: ${action}` }] };
|
|
820
|
+
} catch (err) {
|
|
821
|
+
return {
|
|
822
|
+
isError: true,
|
|
823
|
+
content: [{ type: "text", text: `Failed to manage env vars: ${err.message}` }]
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
);
|
|
828
|
+
}
|
|
707
829
|
}
|
|
708
830
|
|
|
709
831
|
// src/tools/deployments.ts
|
|
@@ -976,199 +1098,205 @@ function registerDeploymentTools(server, client) {
|
|
|
976
1098
|
|
|
977
1099
|
// src/tools/mail.ts
|
|
978
1100
|
var import_zod3 = require("zod");
|
|
979
|
-
function registerMailTools(server, client) {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1101
|
+
function registerMailTools(server, client, scopes) {
|
|
1102
|
+
if (hasMcpScope(scopes, "mail:read")) {
|
|
1103
|
+
server.tool(
|
|
1104
|
+
"taghost_mail_threads_list",
|
|
1105
|
+
"Check mail: list email threads and messages in the TagMail inbox with search and mailbox filters.",
|
|
1106
|
+
{
|
|
1107
|
+
projectId: import_zod3.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1108
|
+
mailboxId: import_zod3.z.string().optional().describe("Filter by specific mailbox ID"),
|
|
1109
|
+
query: import_zod3.z.string().optional().describe("Search query for sender, subject or body text"),
|
|
1110
|
+
limit: import_zod3.z.number().optional().describe("Maximum number of threads to return (default: 25)")
|
|
1111
|
+
},
|
|
1112
|
+
async ({ projectId, mailboxId, query, limit }) => {
|
|
1113
|
+
try {
|
|
1114
|
+
const id = await client.resolveProjectId(projectId);
|
|
1115
|
+
const result = await client.listMailThreads(id, { mailboxId, query, limit: limit || 25 });
|
|
1116
|
+
const threads = Array.isArray(result) ? result : result.threads || [];
|
|
1117
|
+
return {
|
|
1118
|
+
content: [
|
|
1119
|
+
{
|
|
1120
|
+
type: "text",
|
|
1121
|
+
text: JSON.stringify(
|
|
1122
|
+
{
|
|
1123
|
+
success: true,
|
|
1124
|
+
count: threads.length,
|
|
1125
|
+
threads: threads.map((t) => ({
|
|
1126
|
+
id: t.id,
|
|
1127
|
+
subject: t.subject || "(no subject)",
|
|
1128
|
+
from: t.fromAddress || t.snippetSender,
|
|
1129
|
+
snippet: t.snippet,
|
|
1130
|
+
unread: Boolean(t.unread),
|
|
1131
|
+
messageCount: t.messageCount || 1,
|
|
1132
|
+
receivedAt: t.lastMessageAt || t.receivedAt || t.createdAt
|
|
1133
|
+
}))
|
|
1134
|
+
},
|
|
1135
|
+
null,
|
|
1136
|
+
2
|
|
1137
|
+
)
|
|
1138
|
+
}
|
|
1139
|
+
]
|
|
1140
|
+
};
|
|
1141
|
+
} catch (err) {
|
|
1142
|
+
return {
|
|
1143
|
+
isError: true,
|
|
1144
|
+
content: [{ type: "text", text: `Failed to check mail: ${err.message}` }]
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1023
1147
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}
|
|
1148
|
+
);
|
|
1149
|
+
server.tool(
|
|
1150
|
+
"taghost_mail_thread_get",
|
|
1151
|
+
"Read the full contents of an email thread, including all inbound and outbound messages and attachment metadata.",
|
|
1152
|
+
{
|
|
1153
|
+
projectId: import_zod3.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1154
|
+
threadId: import_zod3.z.string().describe("The email thread ID to retrieve")
|
|
1155
|
+
},
|
|
1156
|
+
async ({ projectId, threadId }) => {
|
|
1157
|
+
try {
|
|
1158
|
+
const id = await client.resolveProjectId(projectId);
|
|
1159
|
+
const result = await client.getMailThread(id, threadId);
|
|
1160
|
+
return {
|
|
1161
|
+
content: [
|
|
1162
|
+
{
|
|
1163
|
+
type: "text",
|
|
1164
|
+
text: JSON.stringify({ success: true, thread: result.thread || result }, null, 2)
|
|
1165
|
+
}
|
|
1166
|
+
]
|
|
1167
|
+
};
|
|
1168
|
+
} catch (err) {
|
|
1169
|
+
return {
|
|
1170
|
+
isError: true,
|
|
1171
|
+
content: [{ type: "text", text: `Failed to read mail thread: ${err.message}` }]
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1050
1174
|
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1175
|
+
);
|
|
1176
|
+
}
|
|
1177
|
+
if (hasMcpScope(scopes, "mail:send")) {
|
|
1178
|
+
server.tool(
|
|
1179
|
+
"taghost_mail_send",
|
|
1180
|
+
"Send an email from a TagMail mailbox.",
|
|
1181
|
+
{
|
|
1182
|
+
projectId: import_zod3.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1183
|
+
mailboxId: import_zod3.z.string().optional().describe("Sender mailbox ID (defaults to project primary mailbox)"),
|
|
1184
|
+
to: import_zod3.z.string().describe("Recipient email address"),
|
|
1185
|
+
subject: import_zod3.z.string().describe("Email subject line"),
|
|
1186
|
+
text: import_zod3.z.string().optional().describe("Plain text body content"),
|
|
1187
|
+
html: import_zod3.z.string().optional().describe("HTML formatted body content"),
|
|
1188
|
+
cc: import_zod3.z.array(import_zod3.z.string()).optional().describe("Optional CC recipients"),
|
|
1189
|
+
bcc: import_zod3.z.array(import_zod3.z.string()).optional().describe("Optional BCC recipients")
|
|
1190
|
+
},
|
|
1191
|
+
async ({ projectId, mailboxId, to, subject, text, html, cc, bcc }) => {
|
|
1192
|
+
try {
|
|
1193
|
+
const id = await client.resolveProjectId(projectId);
|
|
1194
|
+
const result = await client.sendMail(id, {
|
|
1195
|
+
mailboxId,
|
|
1196
|
+
to,
|
|
1197
|
+
subject,
|
|
1198
|
+
text,
|
|
1199
|
+
html,
|
|
1200
|
+
cc,
|
|
1201
|
+
bcc
|
|
1202
|
+
});
|
|
1203
|
+
return {
|
|
1204
|
+
content: [
|
|
1205
|
+
{
|
|
1206
|
+
type: "text",
|
|
1207
|
+
text: JSON.stringify(
|
|
1208
|
+
{
|
|
1209
|
+
success: true,
|
|
1210
|
+
message: `Email sent to ${to} successfully.`,
|
|
1211
|
+
result
|
|
1212
|
+
},
|
|
1213
|
+
null,
|
|
1214
|
+
2
|
|
1215
|
+
)
|
|
1216
|
+
}
|
|
1217
|
+
]
|
|
1218
|
+
};
|
|
1219
|
+
} catch (err) {
|
|
1220
|
+
return {
|
|
1221
|
+
isError: true,
|
|
1222
|
+
content: [{ type: "text", text: `Failed to send email: ${err.message}` }]
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1099
1225
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
}
|
|
1226
|
+
);
|
|
1227
|
+
server.tool(
|
|
1228
|
+
"taghost_mail_create_mailbox",
|
|
1229
|
+
'Provision a new corporate mailbox (e.g. "sales@acme.com" or "hello@acme.com") on TagHost.',
|
|
1230
|
+
{
|
|
1231
|
+
projectId: import_zod3.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1232
|
+
localPart: import_zod3.z.string().describe('Local part of address before @ (e.g. "support", "orders", "hello")'),
|
|
1233
|
+
domain: import_zod3.z.string().optional().describe("Domain name for mailbox (defaults to project custom domain)"),
|
|
1234
|
+
displayName: import_zod3.z.string().optional().describe('Friendly display name (e.g. "Support Team")'),
|
|
1235
|
+
password: import_zod3.z.string().optional().describe("Initial password for Webmail/IMAP/SMTP access")
|
|
1236
|
+
},
|
|
1237
|
+
async ({ projectId, localPart, domain, displayName, password }) => {
|
|
1238
|
+
try {
|
|
1239
|
+
const id = await client.resolveProjectId(projectId);
|
|
1240
|
+
const result = await client.createMailbox(id, {
|
|
1241
|
+
localPart,
|
|
1242
|
+
domain,
|
|
1243
|
+
displayName,
|
|
1244
|
+
password
|
|
1245
|
+
});
|
|
1246
|
+
return {
|
|
1247
|
+
content: [
|
|
1248
|
+
{
|
|
1249
|
+
type: "text",
|
|
1250
|
+
text: JSON.stringify(
|
|
1251
|
+
{
|
|
1252
|
+
success: true,
|
|
1253
|
+
message: `Mailbox "${localPart}@${domain || "custom-domain"}" created.`,
|
|
1254
|
+
mailbox: result.mailbox || result
|
|
1255
|
+
},
|
|
1256
|
+
null,
|
|
1257
|
+
2
|
|
1258
|
+
)
|
|
1259
|
+
}
|
|
1260
|
+
]
|
|
1261
|
+
};
|
|
1262
|
+
} catch (err) {
|
|
1263
|
+
return {
|
|
1264
|
+
isError: true,
|
|
1265
|
+
content: [{ type: "text", text: `Failed to create mailbox: ${err.message}` }]
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1142
1268
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1269
|
+
);
|
|
1270
|
+
}
|
|
1271
|
+
if (hasMcpScope(scopes, "mail:read")) {
|
|
1272
|
+
server.tool(
|
|
1273
|
+
"taghost_mail_domain_verify",
|
|
1274
|
+
"Inspect DNS verification status for corporate email (MX, SPF, DKIM, DMARC records).",
|
|
1275
|
+
{
|
|
1276
|
+
projectId: import_zod3.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1277
|
+
domain: import_zod3.z.string().describe('Domain name to verify (e.g. "acme.com")')
|
|
1278
|
+
},
|
|
1279
|
+
async ({ projectId, domain }) => {
|
|
1280
|
+
try {
|
|
1281
|
+
const id = await client.resolveProjectId(projectId);
|
|
1282
|
+
const result = await client.getMailDomainVerification(id, domain);
|
|
1283
|
+
return {
|
|
1284
|
+
content: [
|
|
1285
|
+
{
|
|
1286
|
+
type: "text",
|
|
1287
|
+
text: JSON.stringify({ success: true, domain, verification: result }, null, 2)
|
|
1288
|
+
}
|
|
1289
|
+
]
|
|
1290
|
+
};
|
|
1291
|
+
} catch (err) {
|
|
1292
|
+
return {
|
|
1293
|
+
isError: true,
|
|
1294
|
+
content: [{ type: "text", text: `Failed to verify email domain: ${err.message}` }]
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1169
1297
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
1172
1300
|
}
|
|
1173
1301
|
|
|
1174
1302
|
// src/tools/domains.ts
|
|
@@ -1658,7 +1786,7 @@ function registerCommerceTools(server, client) {
|
|
|
1658
1786
|
);
|
|
1659
1787
|
server.tool(
|
|
1660
1788
|
"taghost_commerce_migrate_woocommerce",
|
|
1661
|
-
"Migrate a WordPress/WooCommerce
|
|
1789
|
+
"Migrate a WordPress/WooCommerce site to TagHost Edge. Migrates products, posts, pages, custom post types, customers, orders, R2 media, theme tokens, and 301 _redirects.",
|
|
1662
1790
|
{
|
|
1663
1791
|
projectId: import_zod5.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1664
1792
|
url: import_zod5.z.string().optional().describe('WordPress/WooCommerce site URL (e.g. "https://my-store.com")'),
|
|
@@ -1666,19 +1794,24 @@ function registerCommerceTools(server, client) {
|
|
|
1666
1794
|
consumerSecret: import_zod5.z.string().optional().describe("WooCommerce REST API Consumer Secret (cs_...)"),
|
|
1667
1795
|
products: import_zod5.z.array(import_zod5.z.any()).optional().describe("Direct array of WooCommerce product objects to import (or parsed from CSV/JSON)"),
|
|
1668
1796
|
posts: import_zod5.z.array(import_zod5.z.any()).optional().describe("Direct array of WordPress blog post objects to import"),
|
|
1797
|
+
pages: import_zod5.z.array(import_zod5.z.any()).optional().describe("Direct array of WordPress page objects to import"),
|
|
1669
1798
|
customers: import_zod5.z.array(import_zod5.z.any()).optional().describe("Direct array of WooCommerce customer objects to import"),
|
|
1670
1799
|
orders: import_zod5.z.array(import_zod5.z.any()).optional().describe("Direct array of WooCommerce order objects to import"),
|
|
1671
1800
|
wxrXml: import_zod5.z.string().optional().describe("Raw WordPress WXR XML export content (from Tools > Export) for complete offline migration"),
|
|
1672
1801
|
options: import_zod5.z.object({
|
|
1673
1802
|
importProducts: import_zod5.z.boolean().optional().describe("Whether to import products (default: true)"),
|
|
1674
1803
|
importPosts: import_zod5.z.boolean().optional().describe("Whether to import WordPress blog posts (default: true)"),
|
|
1804
|
+
importPages: import_zod5.z.boolean().optional().describe("Whether to import WordPress pages into a pages collection (default: true)"),
|
|
1675
1805
|
importCustomers: import_zod5.z.boolean().optional().describe("Whether to import customers (default: true)"),
|
|
1676
1806
|
importOrders: import_zod5.z.boolean().optional().describe("Whether to import orders (default: true)"),
|
|
1677
1807
|
scrapeDesign: import_zod5.z.boolean().optional().describe("Whether to scrape brand design & font tokens from site HTML (default: true)"),
|
|
1678
|
-
mirrorMedia: import_zod5.z.boolean().optional().describe("Whether to mirror remote images into Cloudflare R2 Edge Storage (default: true)")
|
|
1808
|
+
mirrorMedia: import_zod5.z.boolean().optional().describe("Whether to mirror remote images into Cloudflare R2 Edge Storage (default: true)"),
|
|
1809
|
+
cleanMarkup: import_zod5.z.boolean().optional().describe("Whether to strip Gutenberg comments and legacy page-builder shortcodes (default: true)"),
|
|
1810
|
+
writeRedirects: import_zod5.z.boolean().optional().describe("Whether to generate and merge 301 _redirects for legacy WordPress permalinks (default: true)"),
|
|
1811
|
+
maxPages: import_zod5.z.number().int().min(1).max(25).optional().describe("Max REST API pages to fetch per resource (100 items/page, default: 10)")
|
|
1679
1812
|
}).optional().describe("Migration options")
|
|
1680
1813
|
},
|
|
1681
|
-
async ({ projectId, url, consumerKey, consumerSecret, products, posts, customers, orders, wxrXml, options }) => {
|
|
1814
|
+
async ({ projectId, url, consumerKey, consumerSecret, products, posts, pages, customers, orders, wxrXml, options }) => {
|
|
1682
1815
|
try {
|
|
1683
1816
|
const id = await client.resolveProjectId(projectId);
|
|
1684
1817
|
const res = await client.migrateWooCommerce(id, {
|
|
@@ -1687,6 +1820,7 @@ function registerCommerceTools(server, client) {
|
|
|
1687
1820
|
consumerSecret,
|
|
1688
1821
|
products,
|
|
1689
1822
|
posts,
|
|
1823
|
+
pages,
|
|
1690
1824
|
customers,
|
|
1691
1825
|
orders,
|
|
1692
1826
|
wxrXml,
|
|
@@ -1699,11 +1833,17 @@ function registerCommerceTools(server, client) {
|
|
|
1699
1833
|
text: JSON.stringify(
|
|
1700
1834
|
{
|
|
1701
1835
|
success: res.success,
|
|
1702
|
-
message: `WooCommerce migration completed for project ${id}.`,
|
|
1836
|
+
message: `WordPress/WooCommerce migration completed for project ${id}.`,
|
|
1703
1837
|
summary: {
|
|
1704
1838
|
productsMigrated: res.productsMigrated,
|
|
1839
|
+
postsMigrated: res.postsMigrated,
|
|
1840
|
+
pagesMigrated: res.pagesMigrated,
|
|
1841
|
+
customItemsMigrated: res.customItemsMigrated,
|
|
1842
|
+
mediaMirrored: res.mediaMirrored,
|
|
1705
1843
|
customersMigrated: res.customersMigrated,
|
|
1706
1844
|
ordersMigrated: res.ordersMigrated,
|
|
1845
|
+
redirectsGenerated: res.redirectsGenerated,
|
|
1846
|
+
redirectsAppliedToDeployment: res.redirectsAppliedToDeployment,
|
|
1707
1847
|
themeScraped: res.themeScraped
|
|
1708
1848
|
},
|
|
1709
1849
|
errors: res.errors
|
|
@@ -1717,7 +1857,62 @@ function registerCommerceTools(server, client) {
|
|
|
1717
1857
|
} catch (err) {
|
|
1718
1858
|
return {
|
|
1719
1859
|
isError: true,
|
|
1720
|
-
content: [{ type: "text", text: `Failed to execute WooCommerce migration: ${err.message}` }]
|
|
1860
|
+
content: [{ type: "text", text: `Failed to execute WordPress/WooCommerce migration: ${err.message}` }]
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
);
|
|
1865
|
+
server.tool(
|
|
1866
|
+
"taghost_wordpress_visual_clone",
|
|
1867
|
+
"Clone a live WordPress website into TagHost Edge preserving its exact visual design (HTML, theme/Elementor/Divi CSS, webfonts, images) as an immutable R2 deployment ready for Tier 2 Visual Studio editing, with WordPress forms auto-rewired to /_tag/forms/*.",
|
|
1868
|
+
{
|
|
1869
|
+
projectId: import_zod5.z.string().optional().describe("Project ID. Defaults to active project."),
|
|
1870
|
+
url: import_zod5.z.string().describe('Public live WordPress site URL (e.g. "https://example.com")'),
|
|
1871
|
+
maxPages: import_zod5.z.number().int().min(1).max(30).optional().describe("Max pages to clone (default: 15, max: 30)"),
|
|
1872
|
+
maxAssets: import_zod5.z.number().int().min(10).max(250).optional().describe("Max CSS/font/image assets to mirror (default: 120, max: 250)"),
|
|
1873
|
+
rewireForms: import_zod5.z.boolean().optional().describe("Auto-rewire WordPress contact forms to TagHost Edge Forms (default: true)"),
|
|
1874
|
+
syncCollections: import_zod5.z.boolean().optional().describe("Also import WP posts & pages into TagHost Collections CMS (default: false)")
|
|
1875
|
+
},
|
|
1876
|
+
async ({ projectId, url, maxPages, maxAssets, rewireForms, syncCollections }) => {
|
|
1877
|
+
try {
|
|
1878
|
+
const id = await client.resolveProjectId(projectId);
|
|
1879
|
+
const res = await client.cloneWordPressSite(id, {
|
|
1880
|
+
url,
|
|
1881
|
+
maxPages,
|
|
1882
|
+
maxAssets,
|
|
1883
|
+
rewireForms,
|
|
1884
|
+
syncCollections
|
|
1885
|
+
});
|
|
1886
|
+
return {
|
|
1887
|
+
content: [
|
|
1888
|
+
{
|
|
1889
|
+
type: "text",
|
|
1890
|
+
text: JSON.stringify(
|
|
1891
|
+
{
|
|
1892
|
+
success: res.success,
|
|
1893
|
+
message: `WordPress visual clone deployed for project ${id}.`,
|
|
1894
|
+
deployment: res.deployment,
|
|
1895
|
+
summary: {
|
|
1896
|
+
pagesCloned: res.pagesCloned,
|
|
1897
|
+
editablePagesCount: res.editablePagesCount,
|
|
1898
|
+
totalDiscoveredPages: res.totalDiscoveredPages,
|
|
1899
|
+
assetsMirrored: res.assetsMirrored,
|
|
1900
|
+
formsRewired: res.formsRewired,
|
|
1901
|
+
rewiredFormNames: res.rewiredFormNames,
|
|
1902
|
+
detectedDynamicWidgets: res.detectedDynamicWidgets
|
|
1903
|
+
},
|
|
1904
|
+
errors: res.errors
|
|
1905
|
+
},
|
|
1906
|
+
null,
|
|
1907
|
+
2
|
|
1908
|
+
)
|
|
1909
|
+
}
|
|
1910
|
+
]
|
|
1911
|
+
};
|
|
1912
|
+
} catch (err) {
|
|
1913
|
+
return {
|
|
1914
|
+
isError: true,
|
|
1915
|
+
content: [{ type: "text", text: `Failed to visually clone WordPress site: ${err.message}` }]
|
|
1721
1916
|
};
|
|
1722
1917
|
}
|
|
1723
1918
|
}
|
|
@@ -3344,18 +3539,41 @@ function createTagHostMcpServer(options = {}) {
|
|
|
3344
3539
|
version: options.version || "1.0.0"
|
|
3345
3540
|
});
|
|
3346
3541
|
const client = new TagHostClient(options);
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3542
|
+
const scopes = options.scopes ?? null;
|
|
3543
|
+
if (hasMcpScope(scopes, "projects:read") || hasMcpScope(scopes, "deployments:write")) {
|
|
3544
|
+
registerProjectTools(server, client, scopes);
|
|
3545
|
+
}
|
|
3546
|
+
if (hasMcpScope(scopes, "deployments:write")) {
|
|
3547
|
+
registerDeploymentTools(server, client);
|
|
3548
|
+
}
|
|
3549
|
+
if (hasMcpScope(scopes, "mail:read") || hasMcpScope(scopes, "mail:send")) {
|
|
3550
|
+
registerMailTools(server, client, scopes);
|
|
3551
|
+
}
|
|
3552
|
+
if (hasMcpScope(scopes, "domains:write")) {
|
|
3553
|
+
registerDomainTools(server, client);
|
|
3554
|
+
}
|
|
3555
|
+
if (hasMcpScope(scopes, "commerce:write")) {
|
|
3556
|
+
registerCommerceTools(server, client);
|
|
3557
|
+
}
|
|
3558
|
+
if (hasMcpScope(scopes, "content:write")) {
|
|
3559
|
+
registerCollectionTools(server, client);
|
|
3560
|
+
registerContentTools(server, client);
|
|
3561
|
+
}
|
|
3562
|
+
if (hasMcpScope(scopes, "forms:read")) {
|
|
3563
|
+
registerFormsCrmTools(server, client);
|
|
3564
|
+
}
|
|
3565
|
+
if (hasMcpScope(scopes, "sql:read")) {
|
|
3566
|
+
registerSqlTools(server, client);
|
|
3567
|
+
}
|
|
3568
|
+
if (hasMcpScope(scopes, "projects:read")) {
|
|
3569
|
+
registerObservabilityTools(server, client);
|
|
3570
|
+
}
|
|
3571
|
+
if (hasMcpScope(scopes, "workspace:collaborate")) {
|
|
3572
|
+
registerTasksCollaborationTools(server, client);
|
|
3573
|
+
}
|
|
3574
|
+
if (hasMcpScope(scopes, "projects:read")) {
|
|
3575
|
+
registerResources(server, client);
|
|
3576
|
+
}
|
|
3359
3577
|
registerPrompts(server);
|
|
3360
3578
|
return { server, client };
|
|
3361
3579
|
}
|