@connect-xlab/mcp-server 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +146 -0
- package/dist/tools/addCalendarQuestion.js +41 -0
- package/dist/tools/addSmartJoinQuestion.js +38 -0
- package/dist/tools/addSubscriptionPrice.js +33 -0
- package/dist/tools/clearSmartJoinResponses.js +26 -0
- package/dist/tools/createCompany.js +48 -0
- package/dist/tools/createCompanyCategory.js +29 -0
- package/dist/tools/createFunnel.js +40 -0
- package/dist/tools/createLinkInBioBlock.js +55 -0
- package/dist/tools/createPost.js +4 -1
- package/dist/tools/createShopProduct.js +5 -3
- package/dist/tools/deleteCalendarQuestion.js +29 -0
- package/dist/tools/deleteCompany.js +29 -0
- package/dist/tools/deleteCompanyCategory.js +29 -0
- package/dist/tools/deleteFunnel.js +29 -0
- package/dist/tools/deleteFunnelItem.js +34 -0
- package/dist/tools/deleteLinkInBioBlock.js +31 -0
- package/dist/tools/deleteNewsletterEdition.js +29 -0
- package/dist/tools/deleteNewsletterSubscriber.js +29 -0
- package/dist/tools/deleteSmartJoinQuestion.js +29 -0
- package/dist/tools/deleteSubscriptionPrice.js +29 -0
- package/dist/tools/duplicateSmartJoinQuestion.js +29 -0
- package/dist/tools/getCalendar.js +26 -0
- package/dist/tools/getCalendarPipeline.js +26 -0
- package/dist/tools/getFunnel.js +35 -0
- package/dist/tools/getFunnelStats.js +35 -0
- package/dist/tools/getLabAffiliationConfig.js +29 -0
- package/dist/tools/getLinkInBio.js +29 -0
- package/dist/tools/getNewsletterEdition.js +29 -0
- package/dist/tools/getNewsletterRevenue.js +28 -0
- package/dist/tools/getNewsletterSettings.js +28 -0
- package/dist/tools/getProductAffiliationConfig.js +36 -0
- package/dist/tools/getSmartJoin.js +26 -0
- package/dist/tools/getStripeConnectStatus.js +32 -0
- package/dist/tools/getSubscriptionSettings.js +29 -0
- package/dist/tools/listCompanies.js +34 -0
- package/dist/tools/listCompanyCategories.js +28 -0
- package/dist/tools/listFunnelOffers.js +29 -0
- package/dist/tools/listLabAffiliates.js +40 -0
- package/dist/tools/listPixelRequests.js +45 -0
- package/dist/tools/listProductAffiliates.js +49 -0
- package/dist/tools/listSmartJoinResponses.js +40 -0
- package/dist/tools/manageLabAffiliate.js +41 -0
- package/dist/tools/managePixelRequest.js +35 -0
- package/dist/tools/manageProductAffiliate.js +45 -0
- package/dist/tools/reactivateNewsletter.js +28 -0
- package/dist/tools/reorderClass.js +34 -0
- package/dist/tools/reorderLinkInBioBlocks.js +37 -0
- package/dist/tools/reorderSmartJoinQuestions.js +32 -0
- package/dist/tools/scheduleNewsletterEdition.js +34 -0
- package/dist/tools/setCurrentSubscriptionPrice.js +34 -0
- package/dist/tools/setFunnelItem.js +94 -0
- package/dist/tools/stopNewsletter.js +28 -0
- package/dist/tools/toggleLinkInBioPublish.js +29 -0
- package/dist/tools/updateCalendar.js +70 -0
- package/dist/tools/updateCalendarAvailability.js +51 -0
- package/dist/tools/updateCalendarDisqualifRules.js +48 -0
- package/dist/tools/updateCalendarFollowupConfig.js +51 -0
- package/dist/tools/updateCalendarQuestion.js +43 -0
- package/dist/tools/updateCompany.js +49 -0
- package/dist/tools/updateCompanyCategory.js +34 -0
- package/dist/tools/updateFunnel.js +37 -0
- package/dist/tools/updateLabAffiliationConfig.js +44 -0
- package/dist/tools/updateLinkInBio.js +61 -0
- package/dist/tools/updateLinkInBioBlock.js +44 -0
- package/dist/tools/updateNewsletterEdition.js +43 -0
- package/dist/tools/updateNewsletterSettings.js +63 -0
- package/dist/tools/updatePost.js +3 -1
- package/dist/tools/updateProductAffiliationConfig.js +43 -0
- package/dist/tools/updateShopProduct.js +5 -1
- package/dist/tools/updateSmartJoinQuestion.js +40 -0
- package/dist/tools/updateSmartJoinSettings.js +29 -0
- package/dist/tools/updateTrialSettings.js +34 -0
- package/package.json +19 -6
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_link_in_bio_block` — modifie un bloc existant. Tous les champs
|
|
3
|
+
* sont optionnels : seuls ceux fournis sont modifies.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const updateLinkInBioBlockTool = {
|
|
8
|
+
name: 'update_link_in_bio_block',
|
|
9
|
+
description: "Modifie un bloc existant (identifie par block_id, entier renvoye par get_link_in_bio ou create_link_in_bio_block). Champs modifiables : title, subtitle, action_url, image_url, is_active (afficher/masquer sans supprimer).",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
block_id: { type: 'number', minimum: 1 },
|
|
15
|
+
title: { type: 'string', maxLength: 60 },
|
|
16
|
+
subtitle: { type: 'string', maxLength: 120 },
|
|
17
|
+
action_url: { type: 'string' },
|
|
18
|
+
image_url: { type: 'string' },
|
|
19
|
+
is_active: { type: 'boolean' },
|
|
20
|
+
},
|
|
21
|
+
required: ['lab', 'block_id'],
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
},
|
|
24
|
+
zodSchema: z.object({
|
|
25
|
+
lab: z.string(),
|
|
26
|
+
block_id: z.number().int().positive(),
|
|
27
|
+
title: z.string().max(60).optional(),
|
|
28
|
+
subtitle: z.string().max(120).optional(),
|
|
29
|
+
action_url: z.string().optional(),
|
|
30
|
+
image_url: z.string().optional(),
|
|
31
|
+
is_active: z.boolean().optional(),
|
|
32
|
+
}),
|
|
33
|
+
async handler(args) {
|
|
34
|
+
const parsed = this.zodSchema.parse(args);
|
|
35
|
+
const { lab, block_id, ...body } = parsed;
|
|
36
|
+
try {
|
|
37
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(lab)}/link-in-bio/blocks/${block_id}`, body);
|
|
38
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_newsletter_edition` — édite un draft de newsletter.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const updateNewsletterEditionTool = {
|
|
7
|
+
name: 'update_newsletter_edition',
|
|
8
|
+
description: "Modifie une edition de newsletter (title, subject, body_html, access, audience). Une edition deja envoyee ne peut plus etre modifiee. edition_id vient de list_newsletter_editions. IMPORTANT : action ecriture.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
edition_id: { type: 'number' },
|
|
14
|
+
title: { type: 'string', maxLength: 255 },
|
|
15
|
+
subject: { type: 'string', maxLength: 255 },
|
|
16
|
+
body_html: { type: 'string', description: 'Contenu HTML de l\'edition' },
|
|
17
|
+
access: { type: 'string', enum: ['free', 'premium'] },
|
|
18
|
+
audience: { type: 'string', enum: ['all', 'premium', 'free', 'lab_members'] },
|
|
19
|
+
},
|
|
20
|
+
required: ['lab', 'edition_id'],
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
},
|
|
23
|
+
zodSchema: z.object({
|
|
24
|
+
lab: z.string(),
|
|
25
|
+
edition_id: z.number().int().positive(),
|
|
26
|
+
title: z.string().max(255).optional(),
|
|
27
|
+
subject: z.string().max(255).optional(),
|
|
28
|
+
body_html: z.string().nullable().optional(),
|
|
29
|
+
access: z.enum(['free', 'premium']).optional(),
|
|
30
|
+
audience: z.enum(['all', 'premium', 'free', 'lab_members']).optional(),
|
|
31
|
+
}),
|
|
32
|
+
async handler(args) {
|
|
33
|
+
const p = this.zodSchema.parse(args);
|
|
34
|
+
const { lab, edition_id, ...body } = p;
|
|
35
|
+
try {
|
|
36
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(lab)}/newsletter/editions/${edition_id}`, body);
|
|
37
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_newsletter_settings` — met à jour les réglages clés de la
|
|
3
|
+
* newsletter (sous-ensemble curé ; l'éditeur de landing page complet reste
|
|
4
|
+
* sur le front).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { http, formatApiError } from '../http.js';
|
|
8
|
+
export const updateNewsletterSettingsTool = {
|
|
9
|
+
name: 'update_newsletter_settings',
|
|
10
|
+
description: "Met a jour les reglages cles de la newsletter (titre, tagline, auteur, apparence, CTA, email de bienvenue, mode d'envoi). N'envoie que ce que tu veux changer. L'editeur de landing page complet (perks / temoignages / FAQ / sections) reste sur le front.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
lab: { type: 'string' },
|
|
15
|
+
title: { type: 'string', maxLength: 191 },
|
|
16
|
+
tagline: { type: 'string', maxLength: 2000 },
|
|
17
|
+
author_name: { type: 'string', maxLength: 191 },
|
|
18
|
+
author_bio: { type: 'string', maxLength: 2000 },
|
|
19
|
+
accent_color: { type: 'string', maxLength: 16 },
|
|
20
|
+
background: { type: 'string', enum: ['white', 'cream', 'dark'] },
|
|
21
|
+
cta_primary_text: { type: 'string', maxLength: 191 },
|
|
22
|
+
cta_secondary_text: { type: 'string', maxLength: 191 },
|
|
23
|
+
show_secondary_cta: { type: 'boolean' },
|
|
24
|
+
footer_text: { type: 'string', maxLength: 2000 },
|
|
25
|
+
unsubscribe_label: { type: 'string', maxLength: 100 },
|
|
26
|
+
welcome_email_subject: { type: 'string', maxLength: 255 },
|
|
27
|
+
welcome_email_html: { type: 'string', maxLength: 50000 },
|
|
28
|
+
welcome_email_enabled: { type: 'boolean' },
|
|
29
|
+
send_mode: { type: 'string', enum: ['standard', 'custom_domain'] },
|
|
30
|
+
},
|
|
31
|
+
required: ['lab'],
|
|
32
|
+
additionalProperties: false,
|
|
33
|
+
},
|
|
34
|
+
zodSchema: z.object({
|
|
35
|
+
lab: z.string(),
|
|
36
|
+
title: z.string().max(191).optional(),
|
|
37
|
+
tagline: z.string().max(2000).nullable().optional(),
|
|
38
|
+
author_name: z.string().max(191).nullable().optional(),
|
|
39
|
+
author_bio: z.string().max(2000).nullable().optional(),
|
|
40
|
+
accent_color: z.string().max(16).optional(),
|
|
41
|
+
background: z.enum(['white', 'cream', 'dark']).optional(),
|
|
42
|
+
cta_primary_text: z.string().max(191).optional(),
|
|
43
|
+
cta_secondary_text: z.string().max(191).optional(),
|
|
44
|
+
show_secondary_cta: z.boolean().optional(),
|
|
45
|
+
footer_text: z.string().max(2000).nullable().optional(),
|
|
46
|
+
unsubscribe_label: z.string().max(100).nullable().optional(),
|
|
47
|
+
welcome_email_subject: z.string().max(255).nullable().optional(),
|
|
48
|
+
welcome_email_html: z.string().max(50000).nullable().optional(),
|
|
49
|
+
welcome_email_enabled: z.boolean().optional(),
|
|
50
|
+
send_mode: z.enum(['standard', 'custom_domain']).optional(),
|
|
51
|
+
}),
|
|
52
|
+
async handler(args) {
|
|
53
|
+
const p = this.zodSchema.parse(args);
|
|
54
|
+
const { lab, ...body } = p;
|
|
55
|
+
try {
|
|
56
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(lab)}/newsletter/settings`, body);
|
|
57
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|
package/dist/tools/updatePost.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { http, formatApiError } from '../http.js';
|
|
3
3
|
export const updatePostTool = {
|
|
4
4
|
name: 'update_post',
|
|
5
|
-
description: "Modifie un post existant (titre / corps / categorie). Champs optionnels : n'envoie que ce que tu veux changer. IMPORTANT : action ecriture, demander confirmation.",
|
|
5
|
+
description: "Modifie un post existant (titre / corps / categorie / produit Boutique). Champs optionnels : n'envoie que ce que tu veux changer. shop_id : passe l'id d'un produit (list_shops) pour l'attacher, ou null pour retirer le produit du post. IMPORTANT : action ecriture, demander confirmation.",
|
|
6
6
|
inputSchema: {
|
|
7
7
|
type: 'object',
|
|
8
8
|
properties: {
|
|
@@ -11,6 +11,7 @@ export const updatePostTool = {
|
|
|
11
11
|
title: { type: 'string', maxLength: 255 },
|
|
12
12
|
body: { type: 'string' },
|
|
13
13
|
category_id: { type: 'number' },
|
|
14
|
+
shop_id: { type: ['number', 'null'], description: "Id d'un produit Boutique a mettre en avant (list_shops), ou null pour le retirer." },
|
|
14
15
|
},
|
|
15
16
|
required: ['lab', 'post_id'],
|
|
16
17
|
additionalProperties: false,
|
|
@@ -21,6 +22,7 @@ export const updatePostTool = {
|
|
|
21
22
|
title: z.string().max(255).optional(),
|
|
22
23
|
body: z.string().optional(),
|
|
23
24
|
category_id: z.number().int().positive().optional(),
|
|
25
|
+
shop_id: z.number().int().positive().nullable().optional(),
|
|
24
26
|
}),
|
|
25
27
|
async handler(args) {
|
|
26
28
|
const parsed = this.zodSchema.parse(args);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_product_affiliation_config` — active/configure l'affiliation
|
|
3
|
+
* d'un produit (boutique ou agent IA).
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
const PRODUCT_TYPES = ['shop_product', 'agent_ai'];
|
|
8
|
+
export const updateProductAffiliationConfigTool = {
|
|
9
|
+
name: 'update_product_affiliation_config',
|
|
10
|
+
description: "Active / configure l'affiliation d'un produit (boutique ou agent IA custom). enabled = activer, percent = commission % reversee a l'affilie, visibility = qui peut devenir affilie (members_only = membres approuves, open = tout utilisateur connecte, approval_required = sur validation manuelle).",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
lab: { type: 'string' },
|
|
15
|
+
product_type: { type: 'string', enum: [...PRODUCT_TYPES] },
|
|
16
|
+
product_id: { type: 'number' },
|
|
17
|
+
affiliation_enabled: { type: 'boolean' },
|
|
18
|
+
affiliation_percent: { type: 'number', minimum: 0, maximum: 100 },
|
|
19
|
+
affiliation_visibility: { type: 'string', enum: ['members_only', 'open', 'approval_required'] },
|
|
20
|
+
},
|
|
21
|
+
required: ['lab', 'product_type', 'product_id'],
|
|
22
|
+
additionalProperties: false,
|
|
23
|
+
},
|
|
24
|
+
zodSchema: z.object({
|
|
25
|
+
lab: z.string(),
|
|
26
|
+
product_type: z.enum(PRODUCT_TYPES),
|
|
27
|
+
product_id: z.number().int().positive(),
|
|
28
|
+
affiliation_enabled: z.boolean().optional(),
|
|
29
|
+
affiliation_percent: z.number().min(0).max(100).optional(),
|
|
30
|
+
affiliation_visibility: z.enum(['members_only', 'open', 'approval_required']).optional(),
|
|
31
|
+
}),
|
|
32
|
+
async handler(args) {
|
|
33
|
+
const p = this.zodSchema.parse(args);
|
|
34
|
+
const { lab, product_type, product_id, ...body } = p;
|
|
35
|
+
try {
|
|
36
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(lab)}/affiliation/products/${product_type}/${product_id}/config`, body);
|
|
37
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { http, formatApiError } from '../http.js';
|
|
3
3
|
export const updateShopProductTool = {
|
|
4
4
|
name: 'update_shop_product',
|
|
5
|
-
description: "Modifie un produit boutique (titre, prix, description, publication). Champs optionnels. Prix en centimes.",
|
|
5
|
+
description: "Modifie un produit boutique (titre, prix, description, publication, type d'offre). Champs optionnels. Prix en centimes. Passe offer_type=formation + course_id (list_classes) pour que l'achat debloque un cours ; tout autre offer_type detache le cours lie.",
|
|
6
6
|
inputSchema: {
|
|
7
7
|
type: 'object',
|
|
8
8
|
properties: {
|
|
@@ -12,6 +12,8 @@ export const updateShopProductTool = {
|
|
|
12
12
|
short_description: { type: 'string' },
|
|
13
13
|
description: { type: 'string' },
|
|
14
14
|
price_cents: { type: 'number', minimum: 0 },
|
|
15
|
+
offer_type: { type: 'string', enum: ['digital', 'calendar', 'formation'] },
|
|
16
|
+
course_id: { type: 'number', description: "Id d'un cours du Lab (list_classes) — requis/utilise quand offer_type=formation." },
|
|
15
17
|
payment_mode: { type: 'string', enum: ['external', 'stripe'] },
|
|
16
18
|
payment_link_text: { type: 'string', maxLength: 255 },
|
|
17
19
|
support_email: { type: 'string', format: 'email' },
|
|
@@ -27,6 +29,8 @@ export const updateShopProductTool = {
|
|
|
27
29
|
short_description: z.string().optional(),
|
|
28
30
|
description: z.string().optional(),
|
|
29
31
|
price_cents: z.number().int().min(0).nullable().optional(),
|
|
32
|
+
offer_type: z.enum(['digital', 'calendar', 'formation']).optional(),
|
|
33
|
+
course_id: z.number().int().positive().nullable().optional(),
|
|
30
34
|
payment_mode: z.enum(['external', 'stripe']).optional(),
|
|
31
35
|
payment_link_text: z.string().max(255).nullable().optional(),
|
|
32
36
|
support_email: z.string().email().nullable().optional(),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_smart_join_question` — modifie une question Smart Join.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
const TYPES = ['email', 'short_text', 'long_text', 'phone', 'number', 'single_choice', 'multiple_choice'];
|
|
7
|
+
export const updateSmartJoinQuestionTool = {
|
|
8
|
+
name: 'update_smart_join_question',
|
|
9
|
+
description: "Modifie une question de qualification Smart Join. question_id vient de get_smart_join. Pour single_choice / multiple_choice, fournis options.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
question_id: { type: 'number' },
|
|
15
|
+
label: { type: 'string', maxLength: 500 },
|
|
16
|
+
type: { type: 'string', enum: [...TYPES] },
|
|
17
|
+
options: { type: 'array', items: { type: 'string' } },
|
|
18
|
+
},
|
|
19
|
+
required: ['lab', 'question_id'],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
zodSchema: z.object({
|
|
23
|
+
lab: z.string(),
|
|
24
|
+
question_id: z.number().int().positive(),
|
|
25
|
+
label: z.string().max(500).optional(),
|
|
26
|
+
type: z.enum(TYPES).optional(),
|
|
27
|
+
options: z.array(z.string()).optional(),
|
|
28
|
+
}),
|
|
29
|
+
async handler(args) {
|
|
30
|
+
const p = this.zodSchema.parse(args);
|
|
31
|
+
const { lab, question_id, ...body } = p;
|
|
32
|
+
try {
|
|
33
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(lab)}/smart-join/questions/${question_id}`, body);
|
|
34
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_smart_join_settings` — active / désactive le plug-in Smart Join.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const updateSmartJoinSettingsTool = {
|
|
7
|
+
name: 'update_smart_join_settings',
|
|
8
|
+
description: "Active ou desactive le plug-in Smart Join (pop-up de questions a l'inscription). is_active = true active le questionnaire de qualification.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
is_active: { type: 'boolean' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'is_active'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), is_active: z.boolean() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const p = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(p.lab)}/smart-join`, { is_active: p.is_active });
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `update_trial_settings` — configure la période d'essai gratuite d'un Lab.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const updateTrialSettingsTool = {
|
|
7
|
+
name: 'update_trial_settings',
|
|
8
|
+
description: "Configure la periode d'essai gratuite d'un Lab payant : enabled = active/desactive, days = nombre de jours offerts avant le premier prelevement.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
enabled: { type: 'boolean' },
|
|
14
|
+
days: { type: 'number', minimum: 0, description: "Nombre de jours d'essai" },
|
|
15
|
+
},
|
|
16
|
+
required: ['lab', 'enabled', 'days'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
},
|
|
19
|
+
zodSchema: z.object({
|
|
20
|
+
lab: z.string(),
|
|
21
|
+
enabled: z.boolean(),
|
|
22
|
+
days: z.number().int().min(0),
|
|
23
|
+
}),
|
|
24
|
+
async handler(args) {
|
|
25
|
+
const p = this.zodSchema.parse(args);
|
|
26
|
+
try {
|
|
27
|
+
const { data } = await http.put(`/mcp/labs/${encodeURIComponent(p.lab)}/subscriptions/trial`, { enabled: p.enabled, days: p.days });
|
|
28
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
};
|
package/package.json
CHANGED
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@connect-xlab/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Serveur MCP pour piloter ton Lab ConnectXLab depuis Claude Desktop / Cursor / n'importe quel client MCP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
|
|
7
|
+
"bin": {
|
|
8
|
+
"connectxlab-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
9
13
|
"repository": {
|
|
10
14
|
"type": "git",
|
|
11
15
|
"url": "git+https://github.com/Elmzelji/Xlab-Mcp.git"
|
|
12
16
|
},
|
|
13
17
|
"homepage": "https://github.com/Elmzelji/Xlab-Mcp#readme",
|
|
14
|
-
"bugs": {
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/Elmzelji/Xlab-Mcp/issues"
|
|
20
|
+
},
|
|
15
21
|
"scripts": {
|
|
16
22
|
"build": "tsc",
|
|
17
23
|
"dev": "tsx watch src/index.ts",
|
|
18
24
|
"start": "node dist/index.js",
|
|
19
25
|
"prepublishOnly": "npm run build"
|
|
20
26
|
},
|
|
21
|
-
"engines": {
|
|
22
|
-
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"model-context-protocol",
|
|
33
|
+
"connectxlab",
|
|
34
|
+
"claude"
|
|
35
|
+
],
|
|
23
36
|
"author": "ConnectXLab",
|
|
24
37
|
"license": "MIT",
|
|
25
38
|
"dependencies": {
|