@baref00t/mcp-server 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -60
- package/dist/server.js +24 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +105 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/partner/bulkCreateCustomers.d.ts +84 -0
- package/dist/tools/partner/bulkCreateCustomers.d.ts.map +1 -0
- package/dist/tools/partner/bulkCreateCustomers.js +42 -0
- package/dist/tools/partner/bulkCreateCustomers.js.map +1 -0
- package/dist/tools/partner/deleteCustomer.d.ts +12 -0
- package/dist/tools/partner/deleteCustomer.d.ts.map +1 -0
- package/dist/tools/partner/deleteCustomer.js +23 -0
- package/dist/tools/partner/deleteCustomer.js.map +1 -0
- package/dist/tools/partner/updateCustomer.d.ts +129 -0
- package/dist/tools/partner/updateCustomer.d.ts.map +1 -0
- package/dist/tools/partner/updateCustomer.js +46 -0
- package/dist/tools/partner/updateCustomer.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,115 +44,133 @@ Key prefix routes to the right scope. Partner keys see partner tools, distributo
|
|
|
44
44
|
|
|
45
45
|
Get an API key at https://www.baref00t.io → Settings → API keys.
|
|
46
46
|
|
|
47
|
-
## Tool catalogue
|
|
47
|
+
## Tool catalogue
|
|
48
48
|
|
|
49
49
|
Full coverage of the Partner API + Distributor API. Destructive actions (delete, revoke, raw-secret reveals) include explicit warnings in the tool description so the AI assistant narrates the consequences before invoking.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
<!-- mcp-tools:start -->
|
|
52
|
+
<!-- This section is autogenerated from the live tool registry by
|
|
53
|
+
`pnpm docs:gen-mcp` (see scripts/gen-mcp-docs.mjs). Edits between
|
|
54
|
+
the markers will be overwritten on the next run. 11 categories, 50 tools. -->
|
|
55
|
+
|
|
56
|
+
### Customers (6 tools, scope=`pk_*`)
|
|
57
|
+
|
|
58
|
+
| Tool | What it does |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `partner_list_customers` | List all customers in the partner account. Returns customerId, name, email, tenantId, status and createdAt. Use when the user asks "show me my customers" or wants to look up a customer id. |
|
|
61
|
+
| `partner_get_customer` | Fetch a single customer by id, including notification toggles + creation date. Use when the user asks for details about a specific customer. |
|
|
62
|
+
| `partner_create_customer` | Create a new customer record. Requires the customer's display name and Microsoft Entra tenant id (GUID). Returns the new customerId. Use when the user asks to add or onboard a customer. |
|
|
63
|
+
| `partner_update_customer` | Update whitelisted fields on an existing customer. Partial — only fields you pass are changed. Note: changing `tenantId` rebinds the customer to a different Microsoft Entra tenant; existing consents tied to the old tenant will not transfer. |
|
|
64
|
+
| `partner_delete_customer` | Delete a customer. Idempotent — re-deleting returns 404. Past assessments + reports tied to the customer remain queryable through partner_list_assessments / partner_get_assessment_report until their own retention windows expire; only the customer record itself is removed. Granted consents on the Microsoft Entra tenant are NOT revoked here — the customer admin must remove the baref00t app from Enterprise Applications separately. |
|
|
65
|
+
| `partner_bulk_create_customers` | Bulk-create up to 100 customers in one request. Per-row failures do NOT fail the whole call — inspect `results[]` for the per-customer outcome (status: "created" \| "error", with customerId or error string). Returns total / succeeded / failed counts plus the per-row results array. Use partner_create_customer for one-offs; this is for onboarding spreadsheets / CSV imports. |
|
|
66
|
+
|
|
67
|
+
### Consent (2 tools)
|
|
52
68
|
|
|
53
69
|
| Tool | What it does |
|
|
54
70
|
|---|---|
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `partner_get_payment_portal_url` | Stripe Customer Portal deep-link for payment-method management |
|
|
71
|
+
| `partner_get_consent_url` | Mint a consent URL the customer can visit to grant the baref00t app read-only Microsoft Graph access on their tenant. Required before the first assessment for any customer who hasn't already consented — partner_trigger_assessment will silently fail (orchestrator graph token-exchange 401s) without consent. Returns { consentUrl, assessmentId, product, customerId }. Hand the URL to the partner to share with the customer manually, or use partner_send_consent_email to email it on the partner's behalf. |
|
|
72
|
+
| `partner_send_consent_email` | Send a partner-branded consent invitation email to the customer's configured consentRecipients (or primary email as fallback). The email contains a Grant Consent button linking to the consent URL. Returns { sent, skipped, recipients, failed, consentUrl, emailConsentEnabled, skipReason }. Honours the 2-stage email gate: if the partner's mail provider is 'off' OR the customer's emailConsentEnabled is false, no email is sent and emailConsentEnabled is returned as false with skipReason set; consentUrl is always returned so it can be shared manually. |
|
|
58
73
|
|
|
59
|
-
###
|
|
74
|
+
### Assessments (5 tools)
|
|
60
75
|
|
|
61
76
|
| Tool | What it does |
|
|
62
77
|
|---|---|
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
78
|
+
| `partner_list_assessments` | List assessment runs for the partner. Filter by month (YYYY-MM), product, and/or customerId. Also returns runsUsed/runLimit so the LLM knows how much quota remains. Use when the user asks "show me recent runs" or wants to find a specific assessment. |
|
|
79
|
+
| `partner_get_assessment` | Fetch one assessment run by id. Returns product, status, customer id, and timestamps. Use to check the live status of a previously triggered run. |
|
|
80
|
+
| `partner_get_assessment_report` | Get a 30-day SAS URL for the rendered HTML report of a completed assessment. Returns { url, expiresAt }. Hand the URL to the user as a clickable link or fetch it in a browser. The assessment must be in `completed` status — call partner_get_assessment_status first to confirm. Only HTML format is supported today; PDF format returns NOT_IMPLEMENTED. |
|
|
81
|
+
| `partner_trigger_assessment` | Start a new assessment for the given customer. The platform performs a live consent pre-flight (client-credentials token mint against the customer tenant) before accepting the run. Inspect the response's "status" field: "queued"/"completed"/"failed" means the run was accepted (assessmentId + runId populated, COSTS 1 CREDIT — poll via partner_get_assessment_status). "consent_required" means the per-product Entra app does NOT currently exist in the customer tenant (never consented OR the customer admin removed it from Enterprise Applications) — no credit was burned, assessmentId is null, but consentUrl is returned. In that case call partner_send_consent_email or share consentUrl directly with the customer, then re-trigger. |
|
|
82
|
+
| `partner_get_assessment_status` | Poll the status of a previously-triggered assessment. Returns the current status (queued, completed, failed) and the runAt timestamp. Use to wait for a triggered assessment to finish. |
|
|
65
83
|
|
|
66
|
-
###
|
|
84
|
+
### Plan & Billing (3 tools)
|
|
67
85
|
|
|
68
86
|
| Tool | What it does |
|
|
69
87
|
|---|---|
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `partner_get_consent_url` | Get the customer-facing Microsoft admin-consent URL for a product |
|
|
74
|
-
| `partner_send_consent_email` | Email the consent link to the customer's configured recipients |
|
|
88
|
+
| `partner_get_plan_billing` | Fetch the partner's current plan, billing cycle, monthly assessment quota usage, and list of allowed products. Use when the user asks about their plan, quota, or available products before triggering an assessment. |
|
|
89
|
+
| `partner_get_billing` | Read-only Stripe snapshot for the partner: active subscriptions, last 20 invoices, last 20 successful charges, plus a freshly-minted Stripe Customer Portal URL valid ~1 hour. When the partner has no Stripe customer linked yet, all arrays are empty and portal_url is null. For just the portal URL (or a guaranteed-fresh one) use partner_get_payment_portal_url. The platform owns the subscription lifecycle — plan changes still go through partner_get_plan_billing / the change-plan SDK call. |
|
|
90
|
+
| `partner_get_payment_portal_url` | Mint a fresh, short-lived Stripe Customer Portal URL. The partner opens it in a new tab to manage payment methods, download invoices, and update billing details directly on Stripe — no card data ever touches baref00t.io. Use this when the cached portal_url from partner_get_billing has expired (or any time you want a guaranteed-fresh session). Errors 400 if the partner has no Stripe customer linked yet. |
|
|
75
91
|
|
|
76
|
-
###
|
|
92
|
+
### Branding (2 tools)
|
|
77
93
|
|
|
78
94
|
| Tool | What it does |
|
|
79
95
|
|---|---|
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `partner_get_assessment_status` | Poll status of a running assessment |
|
|
83
|
-
| `partner_trigger_assessment` | Start a new assessment (costs 1 quota credit) |
|
|
84
|
-
| `partner_get_assessment_report` | Fetch the 30-day SAS URL for the rendered report (HTML) |
|
|
96
|
+
| `partner_get_branding` | Fetch the partner-wide branding (company name, brand colour, footer text, contact email, and a 30-day SAS URL for the uploaded logo when present). Drives customer-facing emails + the report viewer chrome. Use when the user asks "what does our branding look like?" or before mutating a single field via partner_update_branding. |
|
|
97
|
+
| `partner_update_branding` | Update one or more partner-branding text fields. All fields optional — provide only what you want to change. Affects customer-facing emails (consent invitation, report-ready, questionnaire) and the report viewer chrome. Logo upload is a separate multipart flow (POST /api/partner/branding/logo, MSAL only) and is not covered by this tool. |
|
|
85
98
|
|
|
86
|
-
###
|
|
99
|
+
### Members (5 tools)
|
|
87
100
|
|
|
88
101
|
| Tool | What it does |
|
|
89
102
|
|---|---|
|
|
90
|
-
| `partner_list_members` | List Admin/Member/Viewer
|
|
91
|
-
| `partner_invite_member` | Invite
|
|
92
|
-
| `partner_update_member` |
|
|
93
|
-
| `partner_remove_member` |
|
|
94
|
-
| `partner_resend_invite` |
|
|
103
|
+
| `partner_list_members` | List all members on the partner account, with role (Admin / Member / Viewer), status (Pending / Active / Suspended), and lifecycle timestamps. Also returns the calling principal's effective role — for X-Partner-Key callers this is always "Admin". Each member row exposes an emailHash that downstream member tools (update / remove / resend) use as the path identifier. |
|
|
104
|
+
| `partner_invite_member` | Invite a new member to the partner account. Sends an invitation email with a one-time accept link valid for 14 days. Returns the new (Pending) member record including the emailHash needed for downstream update/remove/resend calls. Errors 409 if the address is already a member or has an open invite. |
|
|
105
|
+
| `partner_update_member` | Update a member's role and/or status (provide at least one). Suspending revokes their ability to sign in but retains the row for audit; reactivate by setting status="Active". Cannot demote the last Admin — errors 409 in that case. |
|
|
106
|
+
| `partner_remove_member` | WARNING — permanent. Removes a member from the partner account; the row is deleted (audit history of past actions is retained on the audit log, but the member entry is gone — re-add via partner_invite_member). Cannot remove the last Admin (errors 409). Prefer partner_update_member with status="Suspended" if you might re-enable later. |
|
|
107
|
+
| `partner_resend_invite` | Re-issue the invitation email and reset the 14-day accept window for a Pending member. Errors 409 if the member is not in Pending status (use partner_update_member to change role on already-Active members instead). |
|
|
95
108
|
|
|
96
|
-
###
|
|
109
|
+
### Webhooks (6 tools)
|
|
97
110
|
|
|
98
111
|
| Tool | What it does |
|
|
99
112
|
|---|---|
|
|
100
|
-
| `partner_list_webhooks` | List configured endpoints
|
|
101
|
-
| `partner_create_webhook` | Create endpoint —
|
|
102
|
-
| `partner_update_webhook` |
|
|
103
|
-
| `partner_delete_webhook` |
|
|
104
|
-
| `partner_test_webhook` | Fire a
|
|
105
|
-
| `partner_list_webhook_deliveries` | Recent delivery
|
|
113
|
+
| `partner_list_webhooks` | List all webhook endpoints configured on the partner account, plus the catalog of event types you can subscribe to (assessment.completed / failed, customer.created / updated / deleted, etc.). Each row includes lastSuccessAt, lastFailureAt, and failureCount — handy for spotting endpoints that are silently broken. |
|
|
114
|
+
| `partner_create_webhook` | Create a new webhook endpoint. WARNING — the signing secret is returned ONCE in response.secret; store it immediately (e.g. in your secrets manager). It cannot be re-fetched. Use partner_update_webhook with rotateSecret=true to mint a fresh secret if lost. Verify incoming deliveries against X-Baref00t-Signature using verifyWebhookSignature() from @baref00t/sdk/webhooks. |
|
|
115
|
+
| `partner_update_webhook` | Partial update for a webhook endpoint — change the URL, events, enabled flag, description, and/or rotate the signing secret. When rotateSecret=true, the new secret is returned ONCE in response.secret and the previous one stops working immediately. |
|
|
116
|
+
| `partner_delete_webhook` | WARNING — permanent. Removes the webhook endpoint and STOPS any in-flight retries (events currently mid-backoff are abandoned). Historical delivery rows remain queryable until the retention window expires. If you only want to pause deliveries, prefer partner_update_webhook with enabled=false instead. |
|
|
117
|
+
| `partner_test_webhook` | Fire a synthetic test.ping delivery to the endpoint with a real signed payload — useful while wiring up your handler. The 10-second response is returned inline so you can see exactly what your server replied (statusCode + first ~500 bytes of responseBody). Does NOT cost a credit and does NOT count toward retry backoff. |
|
|
118
|
+
| `partner_list_webhook_deliveries` | Recent delivery attempts for a single webhook endpoint. Useful for debugging when a partner's receiver is silently failing — surfaces statusCode, durationMs, lastError, attemptCount (with v2.1.7+ retry-backoff schedule: 1m, 5m, 30m, 2h, 24h), and a 500-byte slice of the response body. Status can be Pending / Delivered / Failed / Abandoned. |
|
|
106
119
|
|
|
107
|
-
###
|
|
120
|
+
### Mail (6 tools)
|
|
108
121
|
|
|
109
122
|
| Tool | What it does |
|
|
110
123
|
|---|---|
|
|
111
|
-
| `partner_mail_status` |
|
|
112
|
-
| `partner_mail_set_mode` |
|
|
113
|
-
| `partner_mail_disconnect` | Revoke the cached refresh token
|
|
114
|
-
| `partner_mail_send_test` | Send a test email
|
|
115
|
-
| `partner_mail_set_shared_mailbox` | Set
|
|
116
|
-
| `partner_mail_start_connect` |
|
|
124
|
+
| `partner_mail_status` | Fetch the current partner-mail configuration: provider ("resend" / "microsoft" / "off"), connected Microsoft mailbox UPN (when provider="microsoft"), shared-mailbox UPN, whether the cached refresh token can still mint a Graph access token, and the access-token expiry. Use to check status before mode/sharedMailbox changes or to decide whether to re-run partner_mail_start_connect. |
|
|
125
|
+
| `partner_mail_set_mode` | Set the partner-wide mail provider. Switching to "microsoft" before completing partner_mail_start_connect errors 412 NO_CONNECTION (no refresh token on file). "off" is the recommended kill-switch — flipping it back to "resend" or "microsoft" resumes sending immediately. |
|
|
126
|
+
| `partner_mail_disconnect` | Revoke the cached Microsoft refresh token and revert the provider to Resend. Use when the connected mailbox is compromised or the partner admin wants to re-consent under a different account. After disconnect, partner_mail_start_connect must be run again before partner_mail_set_mode can flip back to "microsoft". |
|
|
127
|
+
| `partner_mail_send_test` | Send a one-off test email via Microsoft Graph using the connected mailbox (or sharedMailbox if set). Recipient is always the calling user's own email — no body to specify. Use to confirm the OAuth flow + Graph permissions are wired correctly. Errors 412 NOT_CONNECTED if the partner hasn't connected a Microsoft mailbox yet, or 502 GRAPH_<status> if Graph rejects the send (typically a missing Send-As permission on the shared mailbox). |
|
|
128
|
+
| `partner_mail_set_shared_mailbox` | Set or clear the shared-mailbox UPN that customer-facing emails are sent FROM. When unset (null), mail is sent from the connected user's own mailbox. Confirm permission is wired correctly afterwards via partner_mail_send_test — Graph errors 502 if Send-As permission is missing on the shared mailbox. |
|
|
129
|
+
| `partner_mail_start_connect` | Returns the Microsoft authorize URL for the partner admin to navigate to. The OAuth callback handles token persistence on the platform; no further MCP calls are needed for the consent step itself. After the callback bounces back to returnTo with ?mailConnected=1, call partner_mail_set_mode with mode="microsoft" to switch the provider on. Errors 503 MAIL_APP_NOT_CONFIGURED if the platform's Partner Mail Sender Entra app isn't configured server-side. |
|
|
117
130
|
|
|
118
|
-
###
|
|
131
|
+
### API Keys (3 tools)
|
|
119
132
|
|
|
120
133
|
| Tool | What it does |
|
|
121
134
|
|---|---|
|
|
122
|
-
| `partner_list_keys` | List active API key slots (
|
|
123
|
-
| `partner_create_key` |
|
|
124
|
-
| `partner_revoke_key` | Revoke key
|
|
135
|
+
| `partner_list_keys` | List the active API key slots (1 and 2) for the partner. Each slot exposes its number + a 4-char suffix of the raw key for visual identification — the raw key itself is never re-fetchable. Returned as part of the partner profile (the same shape partner_get_plan_billing already exposes). Use to confirm which slot is in use before partner_create_key (max 2) or partner_revoke_key. |
|
|
136
|
+
| `partner_create_key` | WARNING — raw key returned ONCE in response.key. Store immediately (e.g. in a secrets manager); it cannot be re-fetched. Costs an active slot (max 2). Throws MAX_KEYS if both slots are already in use — call partner_revoke_key on the unused slot first. Recommended rotation flow: create slot 2, deploy with new key, verify, then revoke slot 1. |
|
|
137
|
+
| `partner_revoke_key` | WARNING — irreversible. Revoke the API key in the given slot (1 or 2). The key is invalidated immediately; any caller still using it gets 401 on the next request. Foot- gun: revoking the slot the SDK / MCP server is currently using locks subsequent calls out of the platform. Always rotate (partner_create_key) and verify the new key works before revoking the old one. |
|
|
125
138
|
|
|
126
|
-
###
|
|
139
|
+
### Pipeline / Leads (10 tools)
|
|
127
140
|
|
|
128
|
-
Requires the partner record to have `prospecting` in `enabledFeatures` (admin-granted only — no plan tier auto-includes it).
|
|
141
|
+
Requires the partner record to have `prospecting` in `enabledFeatures` (admin-granted only — no plan tier auto-includes it).
|
|
129
142
|
|
|
130
143
|
| Tool | What it does |
|
|
131
144
|
|---|---|
|
|
132
|
-
| `partner_list_leads` |
|
|
133
|
-
| `partner_get_lead` |
|
|
134
|
-
| `partner_create_lead` | Create from a domain
|
|
135
|
-
| `partner_bulk_create_leads` |
|
|
136
|
-
| `partner_update_lead` |
|
|
137
|
-
| `partner_delete_lead` | Soft-delete
|
|
138
|
-
| `partner_enrich_lead` | Re-run enrichment
|
|
139
|
-
| `partner_set_lead_stage` |
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
145
|
+
| `partner_list_leads` | List partner prospecting leads with optional stage / search filters and stage-count rollup. Requires the partner record to have `prospecting` in enabledFeatures (admin-granted only — no plan tier auto-includes it). Returns leads with domain, company, contact info, stage, and timestamps. Use when the user asks "show me my pipeline", "leads in stage X", or wants to look up a leadId. |
|
|
146
|
+
| `partner_get_lead` | Fetch one lead with its full contact list, partner overrides, lifecycle timestamps, and the most recent 50 activity log entries. Requires `prospecting` feature flag. Use when the user wants details on a specific lead (by id) or to inspect activity / enrichment results. |
|
|
147
|
+
| `partner_create_lead` | Create a single lead from a domain. Requires `prospecting` feature flag. By default runs enrichment synchronously: Apollo + Hunter populate company/contact fields, and an OIDC probe against login.microsoftonline.com fills tenantId/isOnM365 when the domain is on Entra. Returns 409 with `existingLeadId` if a lead for the same domain already exists for this partner. |
|
|
148
|
+
| `partner_bulk_create_leads` | Bulk-create up to 50 leads from a list of domains. Requires `prospecting` feature flag. Returns `created` (lead rows) + `skipped` (duplicates / invalid domains with reasons). Enrichment runs in the background — partner_get_lead will return enriched data once Apollo / Hunter / M365 finish (typically <30s per lead). |
|
|
149
|
+
| `partner_update_lead` | Update whitelisted lead fields. Requires `prospecting` feature flag. Stage cannot be set via this tool — use partner_set_lead_stage for terminal Won/Lost transitions; other stages are server-managed by the assessment lifecycle. Identity links (customerId, assessmentId) are also server-managed and not partner-settable. |
|
|
150
|
+
| `partner_delete_lead` | Soft-delete a lead. Requires `prospecting` feature flag. Cancels any in-flight outreach cadence. The row stays in Postgres for audit; re-creating the same domain after deletion creates a fresh lead row with a new id. Idempotent — re-deleting an already-deleted lead returns 404. |
|
|
151
|
+
| `partner_enrich_lead` | Re-run enrichment for a lead: Apollo people search + Hunter domain search + Microsoft 365 OIDC tenant discovery (login.microsoftonline.com/{domain}/.well-known/openid-configuration). Requires `prospecting` feature flag. Returns the updated lead, the contributing sources (`apollo`, `hunter`, `m365`), and `fromCache: true` when results were served from the freshness cache. On successful enrichment the lead auto-advances from `New` to `Enriched`. |
|
|
152
|
+
| `partner_set_lead_stage` | Mark a lead Won or Lost — the two terminal states. Requires `prospecting` feature flag. Other stages (Enriched / OutreachSent / Consented / ReportDelivered) are server-managed via the assessment lifecycle and cannot be set explicitly. Setting Won or Lost cancels any in-flight outreach cadence for the lead. |
|
|
153
|
+
| `partner_list_lead_activity` | Read the activity log for a lead — created, enriched, email_sent, email_delivered, email_opened, email_clicked, consented, report_ready, stage_changed, note, etc. Each entry has type / detail / metadata / actorEmail / createdAt. Requires `prospecting` feature flag. Use when the user asks "what happened to this lead" or to debug an outreach sequence. |
|
|
154
|
+
| `partner_send_lead_consent` | Kick off the partner-branded outreach cadence for a lead. Creates (or attaches to) a customer record, mints an assessment + run row (COSTS 1 CREDIT), sends touch-1 of the consent email to each recipient, advances the lead to `OutreachSent`, and fires the `lead.outreach_sent` webhook event. Touches 2 + 3 fire from the background cadence worker on day 3 + 7. Suppressed addresses are skipped silently with `skipped: "suppressed"` in the per-recipient result. Dispatch is routed by the partner's mail mode (`mailProvider`): `resend` (default — baref00t Resend with partner From-name + Reply-To), `microsoft` (partner's connected Graph mailbox), or `off` (call fails with `MAIL_DISABLED` unless `skipEmail: true`). Each per-recipient result reports `via: "resend" \| "microsoft"` so the caller can confirm which channel ran. Pass `skipEmail: true` to bypass the email send entirely — the response still carries the per-recipient `consentUrl` strings so the partner can dispatch via their own channel. Requires the `prospecting` feature flag. Reject if the lead is in a terminal stage (Won / Lost). |
|
|
142
155
|
|
|
143
156
|
### Distributor (2 tools, scope=`dk_*`)
|
|
144
157
|
|
|
145
158
|
| Tool | What it does |
|
|
146
159
|
|---|---|
|
|
147
|
-
| `distributor_list_partners` | List sub-partners
|
|
148
|
-
| `distributor_get_usage` | Aggregated
|
|
160
|
+
| `distributor_list_partners` | List all sub-partners owned by this distributor. Optionally filter by status. Returns each partner's id, company, email, plan, billing, and status. |
|
|
161
|
+
| `distributor_get_usage` | Aggregated assessment usage across all sub-partners for a billing month. Returns totalPartners, activePartners, totalRuns, and per-partner breakdown (runs vs limit). Use to answer "how much have my sub-partners used this month?". |
|
|
162
|
+
<!-- mcp-tools:end -->
|
|
149
163
|
|
|
150
164
|
### Versioning
|
|
151
165
|
|
|
166
|
+
See [`CHANGELOG.md`](./CHANGELOG.md) for per-release notes. Major SDK pins:
|
|
167
|
+
|
|
152
168
|
| MCP version | SDK pin | Highlights |
|
|
153
169
|
|---|---|---|
|
|
154
|
-
|
|
|
155
|
-
| 0.
|
|
170
|
+
| 0.4.x | `@baref00t/sdk@^0.7.0` | Customer CRUD parity (update/delete/bulk_create); /docs + this README autogenerated from the registry. |
|
|
171
|
+
| 0.3.x | `@baref00t/sdk@^0.7.0` | Lead pipeline (10 tools, prospecting feature flag); consent URL + email tooling. |
|
|
172
|
+
| 0.2.x | `@baref00t/sdk@^0.6.0` | Full partner-portal surface coverage. 21 net new tools across branding, members, billing, webhooks, mail, keys. |
|
|
173
|
+
| 0.1.x | `@baref00t/sdk@^0.4.0` | Initial release: customers + assessments + plan/billing read. |
|
|
156
174
|
|
|
157
175
|
## Local self-host
|
|
158
176
|
|
package/dist/server.js
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { createServer } from 'node:http';
|
|
25
25
|
import { randomUUID } from 'node:crypto';
|
|
26
|
+
import { readFileSync } from 'node:fs';
|
|
27
|
+
import { fileURLToPath } from 'node:url';
|
|
26
28
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
27
29
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
28
30
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -34,7 +36,28 @@ import { keyHashShort } from './sdkCache.js';
|
|
|
34
36
|
import { callTool, listToolsForScope } from './registry.js';
|
|
35
37
|
import { registerAllTools } from './tools/index.js';
|
|
36
38
|
const SDK_NAME = 'baref00t-mcp-server';
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Read version dynamically from this package's package.json so the
|
|
41
|
+
* `/healthz` smoke + MCP `initialize` response always reflect the
|
|
42
|
+
* actual deployed package version. Hard-coding it bit us once when
|
|
43
|
+
* the constant drifted to 0.1.6 while npm/ACA had moved past v0.2 —
|
|
44
|
+
* the publish-mcp.yml smoke tested for the package version and
|
|
45
|
+
* failed every release until we noticed.
|
|
46
|
+
*
|
|
47
|
+
* dist/server.js is at packages/mcp-server/dist/server.js, so
|
|
48
|
+
* package.json is one directory up from the compiled file.
|
|
49
|
+
*/
|
|
50
|
+
function readSdkVersion() {
|
|
51
|
+
try {
|
|
52
|
+
const pkgPath = fileURLToPath(new URL('../package.json', import.meta.url));
|
|
53
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
54
|
+
return pkg.version ?? '0.0.0-unknown';
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return '0.0.0-unknown';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const SDK_VERSION = readSdkVersion();
|
|
38
61
|
async function main() {
|
|
39
62
|
const e = env();
|
|
40
63
|
const log = logger();
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,M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AAO,EAAE,CAAC;aAC3C,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,sEAAsE;IACtE,mEAAmE;IACnE,mEAAmE;IACnE,wEAAwE;IACxE,mEAAmE;IACnE,yDAAyD;IACzD,MAAM,SAAS,GAAG,IAAI,6BAA6B,CAAC;QAClD,kBAAkB,EAAE,SAAS;QAC7B,kBAAkB,EAAE,IAAI;KACzB,CAAC,CAAA;IACF,MAAM,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAE5B,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAEvC,MAAM,EAAE,CAAC,KAAK,CACZ;QACE,SAAS;QACT,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC;KAClC,EACD,qBAAqB,CACtB,CAAA;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -5,4 +5,27 @@
|
|
|
5
5
|
* Called once from server.ts at startup.
|
|
6
6
|
*/
|
|
7
7
|
export declare function registerAllTools(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Docs grouping. Source of truth for `scripts/gen-mcp-docs.mjs` — every
|
|
10
|
+
* tool name registered above must appear in exactly one bucket here, and
|
|
11
|
+
* vice-versa, or the generator throws (see drift check). When adding a
|
|
12
|
+
* tool, add the registerTool() call above AND its name to a category
|
|
13
|
+
* here; the docs page picks up both via `pnpm docs:gen-mcp`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const TOOL_CATEGORIES: {
|
|
16
|
+
readonly Customers: readonly ["partner_list_customers", "partner_get_customer", "partner_create_customer", "partner_update_customer", "partner_delete_customer", "partner_bulk_create_customers"];
|
|
17
|
+
readonly Consent: readonly ["partner_get_consent_url", "partner_send_consent_email"];
|
|
18
|
+
readonly Assessments: readonly ["partner_list_assessments", "partner_get_assessment", "partner_get_assessment_report", "partner_trigger_assessment", "partner_get_assessment_status"];
|
|
19
|
+
readonly 'Plan & Billing': readonly ["partner_get_plan_billing", "partner_get_billing", "partner_get_payment_portal_url"];
|
|
20
|
+
readonly Branding: readonly ["partner_get_branding", "partner_update_branding"];
|
|
21
|
+
readonly Members: readonly ["partner_list_members", "partner_invite_member", "partner_update_member", "partner_remove_member", "partner_resend_invite"];
|
|
22
|
+
readonly Webhooks: readonly ["partner_list_webhooks", "partner_create_webhook", "partner_update_webhook", "partner_delete_webhook", "partner_test_webhook", "partner_list_webhook_deliveries"];
|
|
23
|
+
readonly Mail: readonly ["partner_mail_status", "partner_mail_set_mode", "partner_mail_disconnect", "partner_mail_send_test", "partner_mail_set_shared_mailbox", "partner_mail_start_connect"];
|
|
24
|
+
readonly 'API Keys': readonly ["partner_list_keys", "partner_create_key", "partner_revoke_key"];
|
|
25
|
+
readonly 'Pipeline / Leads': readonly ["partner_list_leads", "partner_get_lead", "partner_create_lead", "partner_bulk_create_leads", "partner_update_lead", "partner_delete_lead", "partner_enrich_lead", "partner_set_lead_stage", "partner_list_lead_activity", "partner_send_lead_consent"];
|
|
26
|
+
readonly Distributor: readonly ["distributor_list_partners", "distributor_get_usage"];
|
|
27
|
+
};
|
|
28
|
+
export declare const CATEGORY_ORDER: ReadonlyArray<keyof typeof TOOL_CATEGORIES>;
|
|
29
|
+
/** Optional MDX prose rendered between the category heading and its table. */
|
|
30
|
+
export declare const CATEGORY_NOTES: Partial<Record<keyof typeof TOOL_CATEGORIES, string>>;
|
|
8
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwEH,wBAAgB,gBAAgB,IAAI,IAAI,CAuEvC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;CAyElB,CAAA;AAEV,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,MAAM,OAAO,eAAe,CAYtE,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,eAAe,EAAE,MAAM,CAAC,CAGhF,CAAA"}
|
package/dist/tools/index.js
CHANGED
|
@@ -8,6 +8,9 @@ import { registerTool } from '../registry.js';
|
|
|
8
8
|
import partnerListCustomers from './partner/listCustomers.js';
|
|
9
9
|
import partnerGetCustomer from './partner/getCustomer.js';
|
|
10
10
|
import partnerCreateCustomer from './partner/createCustomer.js';
|
|
11
|
+
import partnerUpdateCustomer from './partner/updateCustomer.js';
|
|
12
|
+
import partnerDeleteCustomer from './partner/deleteCustomer.js';
|
|
13
|
+
import partnerBulkCreateCustomers from './partner/bulkCreateCustomers.js';
|
|
11
14
|
import partnerGetConsentUrl from './partner/getConsentUrl.js';
|
|
12
15
|
import partnerSendConsentEmail from './partner/sendConsentEmail.js';
|
|
13
16
|
import partnerListAssessments from './partner/listAssessments.js';
|
|
@@ -64,10 +67,13 @@ export function registerAllTools() {
|
|
|
64
67
|
if (_registered)
|
|
65
68
|
return;
|
|
66
69
|
_registered = true;
|
|
67
|
-
// Partner (
|
|
70
|
+
// Partner (14)
|
|
68
71
|
registerTool(partnerListCustomers);
|
|
69
72
|
registerTool(partnerGetCustomer);
|
|
70
73
|
registerTool(partnerCreateCustomer);
|
|
74
|
+
registerTool(partnerUpdateCustomer);
|
|
75
|
+
registerTool(partnerDeleteCustomer);
|
|
76
|
+
registerTool(partnerBulkCreateCustomers);
|
|
71
77
|
registerTool(partnerGetConsentUrl);
|
|
72
78
|
registerTool(partnerSendConsentEmail);
|
|
73
79
|
registerTool(partnerListAssessments);
|
|
@@ -121,4 +127,102 @@ export function registerAllTools() {
|
|
|
121
127
|
registerTool(distributorListPartners);
|
|
122
128
|
registerTool(distributorGetUsage);
|
|
123
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Docs grouping. Source of truth for `scripts/gen-mcp-docs.mjs` — every
|
|
132
|
+
* tool name registered above must appear in exactly one bucket here, and
|
|
133
|
+
* vice-versa, or the generator throws (see drift check). When adding a
|
|
134
|
+
* tool, add the registerTool() call above AND its name to a category
|
|
135
|
+
* here; the docs page picks up both via `pnpm docs:gen-mcp`.
|
|
136
|
+
*/
|
|
137
|
+
export const TOOL_CATEGORIES = {
|
|
138
|
+
Customers: [
|
|
139
|
+
'partner_list_customers',
|
|
140
|
+
'partner_get_customer',
|
|
141
|
+
'partner_create_customer',
|
|
142
|
+
'partner_update_customer',
|
|
143
|
+
'partner_delete_customer',
|
|
144
|
+
'partner_bulk_create_customers',
|
|
145
|
+
],
|
|
146
|
+
Consent: [
|
|
147
|
+
'partner_get_consent_url',
|
|
148
|
+
'partner_send_consent_email',
|
|
149
|
+
],
|
|
150
|
+
Assessments: [
|
|
151
|
+
'partner_list_assessments',
|
|
152
|
+
'partner_get_assessment',
|
|
153
|
+
'partner_get_assessment_report',
|
|
154
|
+
'partner_trigger_assessment',
|
|
155
|
+
'partner_get_assessment_status',
|
|
156
|
+
],
|
|
157
|
+
'Plan & Billing': [
|
|
158
|
+
'partner_get_plan_billing',
|
|
159
|
+
'partner_get_billing',
|
|
160
|
+
'partner_get_payment_portal_url',
|
|
161
|
+
],
|
|
162
|
+
Branding: [
|
|
163
|
+
'partner_get_branding',
|
|
164
|
+
'partner_update_branding',
|
|
165
|
+
],
|
|
166
|
+
Members: [
|
|
167
|
+
'partner_list_members',
|
|
168
|
+
'partner_invite_member',
|
|
169
|
+
'partner_update_member',
|
|
170
|
+
'partner_remove_member',
|
|
171
|
+
'partner_resend_invite',
|
|
172
|
+
],
|
|
173
|
+
Webhooks: [
|
|
174
|
+
'partner_list_webhooks',
|
|
175
|
+
'partner_create_webhook',
|
|
176
|
+
'partner_update_webhook',
|
|
177
|
+
'partner_delete_webhook',
|
|
178
|
+
'partner_test_webhook',
|
|
179
|
+
'partner_list_webhook_deliveries',
|
|
180
|
+
],
|
|
181
|
+
Mail: [
|
|
182
|
+
'partner_mail_status',
|
|
183
|
+
'partner_mail_set_mode',
|
|
184
|
+
'partner_mail_disconnect',
|
|
185
|
+
'partner_mail_send_test',
|
|
186
|
+
'partner_mail_set_shared_mailbox',
|
|
187
|
+
'partner_mail_start_connect',
|
|
188
|
+
],
|
|
189
|
+
'API Keys': [
|
|
190
|
+
'partner_list_keys',
|
|
191
|
+
'partner_create_key',
|
|
192
|
+
'partner_revoke_key',
|
|
193
|
+
],
|
|
194
|
+
'Pipeline / Leads': [
|
|
195
|
+
'partner_list_leads',
|
|
196
|
+
'partner_get_lead',
|
|
197
|
+
'partner_create_lead',
|
|
198
|
+
'partner_bulk_create_leads',
|
|
199
|
+
'partner_update_lead',
|
|
200
|
+
'partner_delete_lead',
|
|
201
|
+
'partner_enrich_lead',
|
|
202
|
+
'partner_set_lead_stage',
|
|
203
|
+
'partner_list_lead_activity',
|
|
204
|
+
'partner_send_lead_consent',
|
|
205
|
+
],
|
|
206
|
+
Distributor: [
|
|
207
|
+
'distributor_list_partners',
|
|
208
|
+
'distributor_get_usage',
|
|
209
|
+
],
|
|
210
|
+
};
|
|
211
|
+
export const CATEGORY_ORDER = [
|
|
212
|
+
'Customers',
|
|
213
|
+
'Consent',
|
|
214
|
+
'Assessments',
|
|
215
|
+
'Plan & Billing',
|
|
216
|
+
'Branding',
|
|
217
|
+
'Members',
|
|
218
|
+
'Webhooks',
|
|
219
|
+
'Mail',
|
|
220
|
+
'API Keys',
|
|
221
|
+
'Pipeline / Leads',
|
|
222
|
+
'Distributor',
|
|
223
|
+
];
|
|
224
|
+
/** Optional MDX prose rendered between the category heading and its table. */
|
|
225
|
+
export const CATEGORY_NOTES = {
|
|
226
|
+
'Pipeline / Leads': 'Requires the partner record to have `prospecting` in `enabledFeatures` (admin-granted only — no plan tier auto-includes it).',
|
|
227
|
+
};
|
|
124
228
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,oBAAoB,MAAM,4BAA4B,CAAA;AAC7D,OAAO,kBAAkB,MAAM,0BAA0B,CAAA;AACzD,OAAO,qBAAqB,MAAM,6BAA6B,CAAA;AAC/D,OAAO,oBAAoB,MAAM,4BAA4B,CAAA;AAC7D,OAAO,uBAAuB,MAAM,+BAA+B,CAAA;AACnE,OAAO,sBAAsB,MAAM,8BAA8B,CAAA;AACjE,OAAO,oBAAoB,MAAM,4BAA4B,CAAA;AAC7D,OAAO,0BAA0B,MAAM,kCAAkC,CAAA;AACzE,OAAO,wBAAwB,MAAM,gCAAgC,CAAA;AACrE,OAAO,0BAA0B,MAAM,kCAAkC,CAAA;AACzE,OAAO,qBAAqB,MAAM,6BAA6B,CAAA;AAE/D,sBAAsB;AACtB,OAAO,kBAAkB,MAAM,0BAA0B,CAAA;AACzD,OAAO,qBAAqB,MAAM,6BAA6B,CAAA;AAE/D,qBAAqB;AACrB,OAAO,kBAAkB,MAAM,0BAA0B,CAAA;AACzD,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAC3D,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAC3D,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAC3D,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AAEjE,qBAAqB;AACrB,OAAO,iBAAiB,MAAM,yBAAyB,CAAA;AACvD,OAAO,0BAA0B,M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,EAAE;QAClB,oBAAoB;QACpB,kBAAkB;QAClB,qBAAqB;QACrB,2BAA2B;QAC3B,qBAAqB;QACrB,qBAAqB;QACrB,qBAAqB;QACrB,wBAAwB;QACxB,4BAA4B;QAC5B,2BAA2B;KAC5B;IACD,WAAW,EAAE;QACX,2BAA2B;QAC3B,uBAAuB;KACxB;CACO,CAAA;AAEV,MAAM,CAAC,MAAM,cAAc,GAAgD;IACzE,WAAW;IACX,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,UAAU;IACV,SAAS;IACT,UAAU;IACV,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,aAAa;CACd,CAAA;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAA0D;IACnF,kBAAkB,EAChB,8HAA8H;CACjI,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Tool } from '../../registry.js';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
customers: z.ZodArray<z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
tenantId: z.ZodString;
|
|
7
|
+
email: z.ZodOptional<z.ZodString>;
|
|
8
|
+
receivers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
role: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strict", z.ZodTypeAny, {
|
|
12
|
+
email: string;
|
|
13
|
+
role?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
email: string;
|
|
16
|
+
role?: string | undefined;
|
|
17
|
+
}>]>, "many">>;
|
|
18
|
+
questionnaireRecipients: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
19
|
+
email: z.ZodString;
|
|
20
|
+
role: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
email: string;
|
|
23
|
+
role?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
email: string;
|
|
26
|
+
role?: string | undefined;
|
|
27
|
+
}>]>, "many">>;
|
|
28
|
+
}, "strict", z.ZodTypeAny, {
|
|
29
|
+
name: string;
|
|
30
|
+
tenantId: string;
|
|
31
|
+
email?: string | undefined;
|
|
32
|
+
receivers?: (string | {
|
|
33
|
+
email: string;
|
|
34
|
+
role?: string | undefined;
|
|
35
|
+
})[] | undefined;
|
|
36
|
+
questionnaireRecipients?: (string | {
|
|
37
|
+
email: string;
|
|
38
|
+
role?: string | undefined;
|
|
39
|
+
})[] | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
name: string;
|
|
42
|
+
tenantId: string;
|
|
43
|
+
email?: string | undefined;
|
|
44
|
+
receivers?: (string | {
|
|
45
|
+
email: string;
|
|
46
|
+
role?: string | undefined;
|
|
47
|
+
})[] | undefined;
|
|
48
|
+
questionnaireRecipients?: (string | {
|
|
49
|
+
email: string;
|
|
50
|
+
role?: string | undefined;
|
|
51
|
+
})[] | undefined;
|
|
52
|
+
}>, "many">;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
customers: {
|
|
55
|
+
name: string;
|
|
56
|
+
tenantId: string;
|
|
57
|
+
email?: string | undefined;
|
|
58
|
+
receivers?: (string | {
|
|
59
|
+
email: string;
|
|
60
|
+
role?: string | undefined;
|
|
61
|
+
})[] | undefined;
|
|
62
|
+
questionnaireRecipients?: (string | {
|
|
63
|
+
email: string;
|
|
64
|
+
role?: string | undefined;
|
|
65
|
+
})[] | undefined;
|
|
66
|
+
}[];
|
|
67
|
+
}, {
|
|
68
|
+
customers: {
|
|
69
|
+
name: string;
|
|
70
|
+
tenantId: string;
|
|
71
|
+
email?: string | undefined;
|
|
72
|
+
receivers?: (string | {
|
|
73
|
+
email: string;
|
|
74
|
+
role?: string | undefined;
|
|
75
|
+
})[] | undefined;
|
|
76
|
+
questionnaireRecipients?: (string | {
|
|
77
|
+
email: string;
|
|
78
|
+
role?: string | undefined;
|
|
79
|
+
})[] | undefined;
|
|
80
|
+
}[];
|
|
81
|
+
}>;
|
|
82
|
+
declare const tool: Tool<typeof inputSchema>;
|
|
83
|
+
export default tool;
|
|
84
|
+
//# sourceMappingURL=bulkCreateCustomers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulkCreateCustomers.d.ts","sourceRoot":"","sources":["../../../src/tools/partner/bulkCreateCustomers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAoB7C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQN,CAAA;AAEX,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAalC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getPartnerClient } from '../../sdkCache.js';
|
|
3
|
+
const receiverSchema = z.union([
|
|
4
|
+
z.string().email(),
|
|
5
|
+
z.object({ email: z.string().email(), role: z.string().optional() }).strict(),
|
|
6
|
+
]);
|
|
7
|
+
const customerEntrySchema = z
|
|
8
|
+
.object({
|
|
9
|
+
name: z.string().min(1).max(120),
|
|
10
|
+
tenantId: z
|
|
11
|
+
.string()
|
|
12
|
+
.regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)
|
|
13
|
+
.describe('Microsoft Entra tenant id (GUID).'),
|
|
14
|
+
email: z.string().email().optional(),
|
|
15
|
+
receivers: z.array(receiverSchema).optional(),
|
|
16
|
+
questionnaireRecipients: z.array(receiverSchema).optional(),
|
|
17
|
+
})
|
|
18
|
+
.strict();
|
|
19
|
+
const inputSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
customers: z
|
|
22
|
+
.array(customerEntrySchema)
|
|
23
|
+
.min(1)
|
|
24
|
+
.max(100)
|
|
25
|
+
.describe('Up to 100 customers per request.'),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
const tool = {
|
|
29
|
+
name: 'partner_bulk_create_customers',
|
|
30
|
+
scope: 'partner',
|
|
31
|
+
description: 'Bulk-create up to 100 customers in one request. Per-row failures do NOT fail the whole call — ' +
|
|
32
|
+
'inspect `results[]` for the per-customer outcome (status: "created" | "error", with customerId ' +
|
|
33
|
+
'or error string). Returns total / succeeded / failed counts plus the per-row results array. ' +
|
|
34
|
+
'Use partner_create_customer for one-offs; this is for onboarding spreadsheets / CSV imports.',
|
|
35
|
+
schema: inputSchema,
|
|
36
|
+
async handler(input, ctx) {
|
|
37
|
+
const client = getPartnerClient(ctx.auth.apiKey);
|
|
38
|
+
return client.customers.bulkCreate(input);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export default tool;
|
|
42
|
+
//# sourceMappingURL=bulkCreateCustomers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulkCreateCustomers.js","sourceRoot":"","sources":["../../../src/tools/partner/bulkCreateCustomers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAGpD,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;IAC7B,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IAClB,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CAC9E,CAAC,CAAA;AAEF,MAAM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'../../registry.js';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
customerId: z.ZodString;
|
|
5
|
+
}, "strict", z.ZodTypeAny, {
|
|
6
|
+
customerId: string;
|
|
7
|
+
}, {
|
|
8
|
+
customerId: string;
|
|
9
|
+
}>;
|
|
10
|
+
declare const tool: Tool<typeof inputSchema>;
|
|
11
|
+
export default tool;
|
|
12
|
+
//# sourceMappingURL=deleteCustomer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteCustomer.d.ts","sourceRoot":"","sources":["../../../src/tools/partner/deleteCustomer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,QAAA,MAAM,WAAW;;;;;;EAIN,CAAA;AAEX,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAclC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getPartnerClient } from '../../sdkCache.js';
|
|
3
|
+
const inputSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
customerId: z.string().uuid(),
|
|
6
|
+
})
|
|
7
|
+
.strict();
|
|
8
|
+
const tool = {
|
|
9
|
+
name: 'partner_delete_customer',
|
|
10
|
+
scope: 'partner',
|
|
11
|
+
description: 'Delete a customer. Idempotent — re-deleting returns 404. Past assessments + reports tied to ' +
|
|
12
|
+
'the customer remain queryable through partner_list_assessments / partner_get_assessment_report ' +
|
|
13
|
+
'until their own retention windows expire; only the customer record itself is removed. Granted ' +
|
|
14
|
+
'consents on the Microsoft Entra tenant are NOT revoked here — the customer admin must remove ' +
|
|
15
|
+
'the baref00t app from Enterprise Applications separately.',
|
|
16
|
+
schema: inputSchema,
|
|
17
|
+
async handler(input, ctx) {
|
|
18
|
+
const client = getPartnerClient(ctx.auth.apiKey);
|
|
19
|
+
return client.customers.delete(input.customerId);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default tool;
|
|
23
|
+
//# sourceMappingURL=deleteCustomer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteCustomer.js","sourceRoot":"","sources":["../../../src/tools/partner/deleteCustomer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAGpD,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAC9B,CAAC;KACD,MAAM,EAAE,CAAA;AAEX,MAAM,IAAI,GAA6B;IACrC,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,SAAS;IAChB,WAAW,EACT,8FAA8F;QAC9F,iGAAiG;QACjG,gGAAgG;QAChG,+FAA+F;QAC/F,2DAA2D;IAC7D,MAAM,EAAE,WAAW;IACnB,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;QACtB,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAChD,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IAClD,CAAC;CACF,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Tool } from '../../registry.js';
|
|
3
|
+
declare const inputSchema: z.ZodEffects<z.ZodObject<{
|
|
4
|
+
customerId: z.ZodString;
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
email: z.ZodOptional<z.ZodString>;
|
|
7
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
receivers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
role: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strict", z.ZodTypeAny, {
|
|
12
|
+
email: string;
|
|
13
|
+
role?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
email: string;
|
|
16
|
+
role?: string | undefined;
|
|
17
|
+
}>]>, "many">>;
|
|
18
|
+
questionnaireRecipients: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
19
|
+
email: z.ZodString;
|
|
20
|
+
role: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
email: string;
|
|
23
|
+
role?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
email: string;
|
|
26
|
+
role?: string | undefined;
|
|
27
|
+
}>]>, "many">>;
|
|
28
|
+
consentRecipients: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
29
|
+
email: z.ZodString;
|
|
30
|
+
role: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, "strict", z.ZodTypeAny, {
|
|
32
|
+
email: string;
|
|
33
|
+
role?: string | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
email: string;
|
|
36
|
+
role?: string | undefined;
|
|
37
|
+
}>]>, "many">>;
|
|
38
|
+
emailReportsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
emailConsentEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
emailQuestionnaireEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
status: z.ZodOptional<z.ZodEnum<["active", "archived", "pending"]>>;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
customerId: string;
|
|
44
|
+
status?: "active" | "archived" | "pending" | undefined;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
tenantId?: string | undefined;
|
|
47
|
+
email?: string | undefined;
|
|
48
|
+
emailReportsEnabled?: boolean | undefined;
|
|
49
|
+
emailConsentEnabled?: boolean | undefined;
|
|
50
|
+
emailQuestionnaireEnabled?: boolean | undefined;
|
|
51
|
+
receivers?: (string | {
|
|
52
|
+
email: string;
|
|
53
|
+
role?: string | undefined;
|
|
54
|
+
})[] | undefined;
|
|
55
|
+
questionnaireRecipients?: (string | {
|
|
56
|
+
email: string;
|
|
57
|
+
role?: string | undefined;
|
|
58
|
+
})[] | undefined;
|
|
59
|
+
consentRecipients?: (string | {
|
|
60
|
+
email: string;
|
|
61
|
+
role?: string | undefined;
|
|
62
|
+
})[] | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
customerId: string;
|
|
65
|
+
status?: "active" | "archived" | "pending" | undefined;
|
|
66
|
+
name?: string | undefined;
|
|
67
|
+
tenantId?: string | undefined;
|
|
68
|
+
email?: string | undefined;
|
|
69
|
+
emailReportsEnabled?: boolean | undefined;
|
|
70
|
+
emailConsentEnabled?: boolean | undefined;
|
|
71
|
+
emailQuestionnaireEnabled?: boolean | undefined;
|
|
72
|
+
receivers?: (string | {
|
|
73
|
+
email: string;
|
|
74
|
+
role?: string | undefined;
|
|
75
|
+
})[] | undefined;
|
|
76
|
+
questionnaireRecipients?: (string | {
|
|
77
|
+
email: string;
|
|
78
|
+
role?: string | undefined;
|
|
79
|
+
})[] | undefined;
|
|
80
|
+
consentRecipients?: (string | {
|
|
81
|
+
email: string;
|
|
82
|
+
role?: string | undefined;
|
|
83
|
+
})[] | undefined;
|
|
84
|
+
}>, {
|
|
85
|
+
customerId: string;
|
|
86
|
+
status?: "active" | "archived" | "pending" | undefined;
|
|
87
|
+
name?: string | undefined;
|
|
88
|
+
tenantId?: string | undefined;
|
|
89
|
+
email?: string | undefined;
|
|
90
|
+
emailReportsEnabled?: boolean | undefined;
|
|
91
|
+
emailConsentEnabled?: boolean | undefined;
|
|
92
|
+
emailQuestionnaireEnabled?: boolean | undefined;
|
|
93
|
+
receivers?: (string | {
|
|
94
|
+
email: string;
|
|
95
|
+
role?: string | undefined;
|
|
96
|
+
})[] | undefined;
|
|
97
|
+
questionnaireRecipients?: (string | {
|
|
98
|
+
email: string;
|
|
99
|
+
role?: string | undefined;
|
|
100
|
+
})[] | undefined;
|
|
101
|
+
consentRecipients?: (string | {
|
|
102
|
+
email: string;
|
|
103
|
+
role?: string | undefined;
|
|
104
|
+
})[] | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
customerId: string;
|
|
107
|
+
status?: "active" | "archived" | "pending" | undefined;
|
|
108
|
+
name?: string | undefined;
|
|
109
|
+
tenantId?: string | undefined;
|
|
110
|
+
email?: string | undefined;
|
|
111
|
+
emailReportsEnabled?: boolean | undefined;
|
|
112
|
+
emailConsentEnabled?: boolean | undefined;
|
|
113
|
+
emailQuestionnaireEnabled?: boolean | undefined;
|
|
114
|
+
receivers?: (string | {
|
|
115
|
+
email: string;
|
|
116
|
+
role?: string | undefined;
|
|
117
|
+
})[] | undefined;
|
|
118
|
+
questionnaireRecipients?: (string | {
|
|
119
|
+
email: string;
|
|
120
|
+
role?: string | undefined;
|
|
121
|
+
})[] | undefined;
|
|
122
|
+
consentRecipients?: (string | {
|
|
123
|
+
email: string;
|
|
124
|
+
role?: string | undefined;
|
|
125
|
+
})[] | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
declare const tool: Tool<typeof inputSchema>;
|
|
128
|
+
export default tool;
|
|
129
|
+
//# sourceMappingURL=updateCustomer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateCustomer.d.ts","sourceRoot":"","sources":["../../../src/tools/partner/updateCustomer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAO7C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBb,CAAA;AAEJ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAalC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getPartnerClient } from '../../sdkCache.js';
|
|
3
|
+
const receiverSchema = z.union([
|
|
4
|
+
z.string().email(),
|
|
5
|
+
z.object({ email: z.string().email(), role: z.string().optional() }).strict(),
|
|
6
|
+
]);
|
|
7
|
+
const inputSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
customerId: z.string().uuid(),
|
|
10
|
+
name: z.string().min(1).max(120).optional(),
|
|
11
|
+
email: z.string().email().optional(),
|
|
12
|
+
tenantId: z
|
|
13
|
+
.string()
|
|
14
|
+
.regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Microsoft Entra tenant id (GUID). Rebinds the customer to a different tenant.'),
|
|
17
|
+
receivers: z.array(receiverSchema).optional(),
|
|
18
|
+
questionnaireRecipients: z.array(receiverSchema).optional(),
|
|
19
|
+
consentRecipients: z.array(receiverSchema).optional(),
|
|
20
|
+
emailReportsEnabled: z.boolean().optional(),
|
|
21
|
+
emailConsentEnabled: z.boolean().optional(),
|
|
22
|
+
emailQuestionnaireEnabled: z.boolean().optional(),
|
|
23
|
+
status: z
|
|
24
|
+
.enum(['active', 'archived', 'pending'])
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Customer lifecycle state.'),
|
|
27
|
+
})
|
|
28
|
+
.strict()
|
|
29
|
+
.refine((v) => Object.keys(v).length > 1, {
|
|
30
|
+
message: 'Provide at least one field to update besides customerId',
|
|
31
|
+
});
|
|
32
|
+
const tool = {
|
|
33
|
+
name: 'partner_update_customer',
|
|
34
|
+
scope: 'partner',
|
|
35
|
+
description: 'Update whitelisted fields on an existing customer. Partial — only fields you pass are changed. ' +
|
|
36
|
+
'Note: changing `tenantId` rebinds the customer to a different Microsoft Entra tenant; existing ' +
|
|
37
|
+
'consents tied to the old tenant will not transfer.',
|
|
38
|
+
schema: inputSchema,
|
|
39
|
+
async handler(input, ctx) {
|
|
40
|
+
const { customerId, ...updates } = input;
|
|
41
|
+
const client = getPartnerClient(ctx.auth.apiKey);
|
|
42
|
+
return client.customers.update(customerId, updates);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export default tool;
|
|
46
|
+
//# sourceMappingURL=updateCustomer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateCustomer.js","sourceRoot":"","sources":["../../../src/tools/partner/updateCustomer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAGpD,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;IAC7B,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IAClB,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CAC9E,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,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C,CAAA;QAChD,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;CACF,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baref00t/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Hosted multi-tenant MCP (Model Context Protocol) server for the baref00t Partner + Distributor APIs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/becloudsmart-com/baref00t/tree/main/packages/mcp-server",
|