@cognilead/mcp-server 0.1.0 → 0.3.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 +27 -15
- package/dist/api-client.d.ts +3 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +8 -2
- package/dist/api-client.js.map +1 -1
- package/dist/auth.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +127 -12
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +24 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +99 -0
- package/dist/prompts.js.map +1 -0
- package/dist/rate-limit.d.ts.map +1 -1
- package/dist/rate-limit.js +0 -1
- package/dist/rate-limit.js.map +1 -1
- package/dist/resources.d.ts +15 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +75 -0
- package/dist/resources.js.map +1 -0
- package/dist/schemas.d.ts +152 -49
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +98 -20
- package/dist/schemas.js.map +1 -1
- package/dist/tools/check-deliverability.d.ts +2 -0
- package/dist/tools/check-deliverability.d.ts.map +1 -0
- package/dist/tools/check-deliverability.js +165 -0
- package/dist/tools/check-deliverability.js.map +1 -0
- package/dist/tools/create-topup-link.d.ts +2 -0
- package/dist/tools/create-topup-link.d.ts.map +1 -0
- package/dist/tools/create-topup-link.js +15 -0
- package/dist/tools/create-topup-link.js.map +1 -0
- package/dist/tools/get-billing-usage.d.ts +2 -0
- package/dist/tools/get-billing-usage.d.ts.map +1 -0
- package/dist/tools/get-billing-usage.js +12 -0
- package/dist/tools/get-billing-usage.js.map +1 -0
- package/dist/tools/get-deliverability.d.ts +2 -0
- package/dist/tools/get-deliverability.d.ts.map +1 -0
- package/dist/tools/get-deliverability.js +12 -0
- package/dist/tools/get-deliverability.js.map +1 -0
- package/dist/tools/get-subscription.d.ts +2 -0
- package/dist/tools/get-subscription.d.ts.map +1 -0
- package/dist/tools/get-subscription.js +12 -0
- package/dist/tools/get-subscription.js.map +1 -0
- package/dist/tools/health.d.ts +2 -0
- package/dist/tools/health.d.ts.map +1 -0
- package/dist/tools/health.js +12 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/ingest-lead.js +1 -1
- package/dist/tools/ingest-lead.js.map +1 -1
- package/dist/tools/list-api-keys.d.ts +2 -0
- package/dist/tools/list-api-keys.d.ts.map +1 -0
- package/dist/tools/list-api-keys.js +13 -0
- package/dist/tools/list-api-keys.js.map +1 -0
- package/dist/tools/list-leads.d.ts +2 -0
- package/dist/tools/list-leads.d.ts.map +1 -0
- package/dist/tools/list-leads.js +19 -0
- package/dist/tools/list-leads.js.map +1 -0
- package/dist/tools/list-sends.d.ts +2 -0
- package/dist/tools/list-sends.d.ts.map +1 -0
- package/dist/tools/list-sends.js +18 -0
- package/dist/tools/list-sends.js.map +1 -0
- package/dist/tools/list-suppressions.d.ts +2 -0
- package/dist/tools/list-suppressions.d.ts.map +1 -0
- package/dist/tools/list-suppressions.js +19 -0
- package/dist/tools/list-suppressions.js.map +1 -0
- package/dist/tools/list-webhooks.d.ts +2 -0
- package/dist/tools/list-webhooks.d.ts.map +1 -0
- package/dist/tools/list-webhooks.js +12 -0
- package/dist/tools/list-webhooks.js.map +1 -0
- package/dist/tools/run-campaign.d.ts.map +1 -1
- package/dist/tools/run-campaign.js +8 -2
- package/dist/tools/run-campaign.js.map +1 -1
- package/dist/tools/score-signal.d.ts.map +1 -1
- package/dist/tools/score-signal.js +0 -1
- package/dist/tools/score-signal.js.map +1 -1
- package/package.json +4 -3
- package/dist/tools/check-registry-flags.d.ts +0 -2
- package/dist/tools/check-registry-flags.d.ts.map +0 -1
- package/dist/tools/check-registry-flags.js +0 -31
- package/dist/tools/check-registry-flags.js.map +0 -1
- package/dist/tools/evidence-export.d.ts +0 -7
- package/dist/tools/evidence-export.d.ts.map +0 -1
- package/dist/tools/evidence-export.js +0 -42
- package/dist/tools/evidence-export.js.map +0 -1
- package/dist/tools/find-companies-with-triggers.d.ts +0 -2
- package/dist/tools/find-companies-with-triggers.d.ts.map +0 -1
- package/dist/tools/find-companies-with-triggers.js +0 -29
- package/dist/tools/find-companies-with-triggers.js.map +0 -1
- package/dist/tools/generate-seo-content.d.ts +0 -2
- package/dist/tools/generate-seo-content.d.ts.map +0 -1
- package/dist/tools/generate-seo-content.js +0 -14
- package/dist/tools/generate-seo-content.js.map +0 -1
- package/dist/tools/get-business-sheet.d.ts +0 -2
- package/dist/tools/get-business-sheet.d.ts.map +0 -1
- package/dist/tools/get-business-sheet.js +0 -24
- package/dist/tools/get-business-sheet.js.map +0 -1
- package/dist/tools/rank-companies-in-vertical.d.ts +0 -2
- package/dist/tools/rank-companies-in-vertical.d.ts.map +0 -1
- package/dist/tools/rank-companies-in-vertical.js +0 -33
- package/dist/tools/rank-companies-in-vertical.js.map +0 -1
- package/dist/tools/score-dd-risk.d.ts +0 -2
- package/dist/tools/score-dd-risk.d.ts.map +0 -1
- package/dist/tools/score-dd-risk.js +0 -22
- package/dist/tools/score-dd-risk.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Model Context Protocol server for [CogniLead](https://cognilead.ai) —
|
|
4
4
|
the managed cold-email deliverability engine for EU/technical B2B (plus AI
|
|
5
|
-
|
|
6
|
-
and any MCP-capable client so you can draft outbound copy
|
|
7
|
-
without leaving your IDE. All generation
|
|
5
|
+
opt-in paid lead enrichment). Exposes fifteen tools to Cursor, Claude Desktop, Windsurf,
|
|
6
|
+
and any MCP-capable client so you can draft outbound copy, run campaigns, and
|
|
7
|
+
read back your pipeline/billing data without leaving your IDE. All generation
|
|
8
|
+
runs on phi-cloud as the LLM provider.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Four tools need no API key: `draft_pitch` and `score_signal` are daily-capped
|
|
11
|
+
local tools, `check_deliverability` is a local DNS check, and `health` probes
|
|
12
|
+
the public API. The other twelve are gated behind a CogniLead API key — when
|
|
13
|
+
the key is absent, the tool returns an inline signup URL so you can fix it in
|
|
14
|
+
seconds.
|
|
12
15
|
|
|
13
16
|
## Install
|
|
14
17
|
|
|
@@ -77,9 +80,9 @@ or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
|
77
80
|
}
|
|
78
81
|
```
|
|
79
82
|
|
|
80
|
-
Omit `COGNILEAD_API_KEY` to run in free-tier mode (only `draft_pitch
|
|
81
|
-
and `
|
|
82
|
-
an inline upgrade URL).
|
|
83
|
+
Omit `COGNILEAD_API_KEY` to run in free-tier mode (only `draft_pitch`,
|
|
84
|
+
`score_signal`, `check_deliverability`, and `health` are callable; the
|
|
85
|
+
gated tools return a 401 with an inline upgrade URL).
|
|
83
86
|
|
|
84
87
|
## Tools
|
|
85
88
|
|
|
@@ -87,12 +90,22 @@ an inline upgrade URL).
|
|
|
87
90
|
|---|---|---|---|
|
|
88
91
|
| `cognilead.draft_pitch` | free | 20/day | Draft a short, personalised outbound pitch from the insight/context you feed it (the product, topic, and target account). |
|
|
89
92
|
| `cognilead.score_signal` | free | 50/day | Score a supplied insight/context for fit against a target product (0-100, deterministic). |
|
|
93
|
+
| `cognilead.check_deliverability` | free | — | Grade a domain's SPF + DMARC via local DNS. No API key. |
|
|
94
|
+
| `cognilead.health` | free | — | Probe the public CogniLead API health endpoint. No API key. |
|
|
90
95
|
| `cognilead.ingest_lead` | gated | — | Register a (customer-supplied) lead in the outbound pipeline. |
|
|
91
|
-
| `cognilead.run_campaign` | gated | — | Kick off an email campaign by id
|
|
96
|
+
| `cognilead.run_campaign` | gated | — | Kick off an email campaign by id (campaign endpoints not yet live — returns a structured "unavailable" error). |
|
|
92
97
|
| `cognilead.suppress` | gated | — | Add an email or domain to the suppression list (honours one-click RFC 8058 unsubscribe). |
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
| `cognilead.create_topup_link` | gated | — | Start a Stripe Checkout to top up an end-customer's prepaid credit balance; returns a `{url}` for the human to pay. |
|
|
99
|
+
| `cognilead.list_leads` | gated | — | List leads in your pipeline (read-only, cursor-paginated). |
|
|
100
|
+
| `cognilead.list_sends` | gated | — | List the send history for a given `lead_id` (read-only, cursor-paginated). |
|
|
101
|
+
| `cognilead.list_suppressions` | gated | — | List suppressed emails/domains (read-only, cursor-paginated). |
|
|
102
|
+
| `cognilead.get_billing_usage` | gated | — | Get current billing-period usage and remaining quota (read-only). |
|
|
103
|
+
| `cognilead.get_subscription` | gated | — | Get subscription plan, status, and limits (read-only). |
|
|
104
|
+
| `cognilead.list_webhooks` | gated | — | List configured webhook endpoints (read-only). |
|
|
105
|
+
| `cognilead.list_api_keys` | gated | — | List API key metadata; secrets/hashes stripped server-side (read-only). |
|
|
106
|
+
|
|
107
|
+
> Note: you supply leads and context yourself; CogniLead runs the
|
|
108
|
+
> deliverability. It does not source or target leads.
|
|
96
109
|
|
|
97
110
|
Free-tier quotas reset at UTC midnight and persist between IDE restarts
|
|
98
111
|
in `~/.cognilead/quota.json`.
|
|
@@ -110,9 +123,8 @@ in `~/.cognilead/quota.json`.
|
|
|
110
123
|
## Get a key
|
|
111
124
|
|
|
112
125
|
[Sign up](https://cognilead.ai/signup?via=mcp) — the free tier ships with
|
|
113
|
-
100 outbound sends per month
|
|
126
|
+
100 outbound sends per month. Paid plans add
|
|
114
127
|
warmed sender pools, the reputation circuit-breaker, and reply/bounce handling.
|
|
115
|
-
(MarketPrior-fed targeting is roadmap, not yet available.)
|
|
116
128
|
|
|
117
129
|
## Local development
|
|
118
130
|
|
package/dist/api-client.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export interface ApiError extends Error {
|
|
|
3
3
|
body: unknown;
|
|
4
4
|
}
|
|
5
5
|
export declare function apiPost(path: string, body: unknown): Promise<unknown>;
|
|
6
|
-
export declare function apiGet(path: string
|
|
6
|
+
export declare function apiGet(path: string, opts?: {
|
|
7
|
+
auth?: boolean;
|
|
8
|
+
}): Promise<unknown>;
|
|
7
9
|
//# sourceMappingURL=api-client.d.ts.map
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,OAAO,CAAA;CACd;AAuBD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAY3E;
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,QAAS,SAAQ,KAAK;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,OAAO,CAAA;CACd;AAuBD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAY3E;AAKD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5B,OAAO,CAAC,OAAO,CAAC,CAclB"}
|
package/dist/api-client.js
CHANGED
|
@@ -35,11 +35,17 @@ export async function apiPost(path, body) {
|
|
|
35
35
|
}
|
|
36
36
|
return data;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
// GET helper mirroring apiPost. By default it sends the Bearer auth headers
|
|
39
|
+
// (used by the gated read-only tools). Pass { auth: false } for public,
|
|
40
|
+
// no-key endpoints like /api/v1/health.
|
|
41
|
+
export async function apiGet(path, opts = {}) {
|
|
39
42
|
const { apiUrl } = loadConfig();
|
|
43
|
+
const auth = opts.auth ?? true;
|
|
40
44
|
const res = await fetch(`${apiUrl}${path}`, {
|
|
41
45
|
method: 'GET',
|
|
42
|
-
headers:
|
|
46
|
+
headers: auth
|
|
47
|
+
? authHeaders()
|
|
48
|
+
: { Accept: 'application/json', 'User-Agent': 'cognilead-mcp/0.2.0' },
|
|
43
49
|
});
|
|
44
50
|
const data = await parseBody(res);
|
|
45
51
|
if (!res.ok) {
|
package/dist/api-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,mDAAmD;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAOxC,SAAS,SAAS,CAAC,MAAc,EAAE,IAAa,EAAE,QAAgB;IAChE,MAAM,OAAO,GACX,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;QACpF,CAAC,CAAC,IAAI,CAAC,KAAK;QACZ,CAAC,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAA;IAC3B,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAa,CAAA;IAC1C,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA;IACnB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;IACf,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAa;IACpC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;IAC7B,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAA;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAa;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,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AAE;YACf,CAAC,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,qBAAqB,EAAE;KACxE,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,CAAA;IACjC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,IAAI,YAAY,GAAG,CAAC,MAAM,GAAG,CAAC,CAAA;IACzE,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/auth.js
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAmDlE,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,KAAK,EAAE,QAAQ,EAiH3B,CAAA;AAiCD,wBAAgB,YAAY,IAAI,MAAM,CAiGrC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @cognilead/mcp-server — stdio entrypoint.
|
|
3
3
|
//
|
|
4
|
-
// Wires the CogniLead tools (
|
|
4
|
+
// Wires the CogniLead tools (4 free, 12 gated) into an MCP server
|
|
5
5
|
// that speaks the stdio transport. Cursor, Claude Desktop and Windsurf
|
|
6
6
|
// all launch this as a child process and exchange JSON-RPC over stdin/
|
|
7
7
|
// stdout.
|
|
@@ -12,23 +12,35 @@
|
|
|
12
12
|
// directly to the developer, which is the canonical acquisition moment.
|
|
13
13
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
14
14
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
15
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
16
|
-
import { DraftPitchJsonSchema, ScoreSignalJsonSchema, IngestLeadJsonSchema, RunCampaignJsonSchema, SuppressJsonSchema,
|
|
15
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
16
|
+
import { DraftPitchJsonSchema, ScoreSignalJsonSchema, IngestLeadJsonSchema, RunCampaignJsonSchema, SuppressJsonSchema, CreateTopupLinkJsonSchema, CheckDeliverabilityJsonSchema, ListLeadsJsonSchema, ListSendsJsonSchema, ListSuppressionsJsonSchema, EmptyJsonSchema, } from './schemas.js';
|
|
17
17
|
import { draftPitch } from './tools/draft-pitch.js';
|
|
18
18
|
import { scoreSignal } from './tools/score-signal.js';
|
|
19
19
|
import { ingestLead } from './tools/ingest-lead.js';
|
|
20
20
|
import { runCampaign } from './tools/run-campaign.js';
|
|
21
21
|
import { suppress } from './tools/suppress.js';
|
|
22
|
-
import {
|
|
22
|
+
import { createTopupLink } from './tools/create-topup-link.js';
|
|
23
|
+
import { checkDeliverability } from './tools/check-deliverability.js';
|
|
24
|
+
import { listLeads } from './tools/list-leads.js';
|
|
25
|
+
import { listSends } from './tools/list-sends.js';
|
|
26
|
+
import { listSuppressions } from './tools/list-suppressions.js';
|
|
27
|
+
import { getBillingUsage } from './tools/get-billing-usage.js';
|
|
28
|
+
import { getSubscription } from './tools/get-subscription.js';
|
|
29
|
+
import { getDeliverability } from './tools/get-deliverability.js';
|
|
30
|
+
import { listWebhooks } from './tools/list-webhooks.js';
|
|
31
|
+
import { listApiKeys } from './tools/list-api-keys.js';
|
|
32
|
+
import { health } from './tools/health.js';
|
|
33
|
+
import { RESOURCES, readResource } from './resources.js';
|
|
34
|
+
import { PROMPTS, getPrompt } from './prompts.js';
|
|
23
35
|
import { McpAuthError, McpQuotaError } from './auth.js';
|
|
24
36
|
const SERVER_INFO = {
|
|
25
37
|
name: 'cognilead-mcp',
|
|
26
|
-
version: '0.
|
|
38
|
+
version: '0.3.0',
|
|
27
39
|
};
|
|
28
40
|
export const TOOLS = [
|
|
29
41
|
{
|
|
30
42
|
name: 'cognilead.draft_pitch',
|
|
31
|
-
description: 'Draft a cold-outbound pitch for a technical company based on a public signal (job post URL, GitHub repo, HN comment).
|
|
43
|
+
description: 'Draft a cold-outbound pitch for a technical company based on a public signal (job post URL, GitHub repo, HN comment). Jurisdiction-aware routing — each recipient is processed in its own region for data residency (e.g. EU recipients via EU-resident inference). Returns subject_line, email_body_markdown, and a technical_hook_verified flag (false ⇒ the signal lacked a citable hook). Free tier capped at 20 calls/day.',
|
|
32
44
|
inputSchema: DraftPitchJsonSchema,
|
|
33
45
|
handler: draftPitch,
|
|
34
46
|
},
|
|
@@ -38,15 +50,21 @@ export const TOOLS = [
|
|
|
38
50
|
inputSchema: ScoreSignalJsonSchema,
|
|
39
51
|
handler: scoreSignal,
|
|
40
52
|
},
|
|
53
|
+
{
|
|
54
|
+
name: 'cognilead.check_deliverability',
|
|
55
|
+
description: 'Check a domain’s email deliverability DNS — SPF and DMARC records, plus a Spamhaus DBL blocklist lookup — and grade them with prioritized findings. Local DNS lookup only; no API key required. Use before sending cold to confirm a domain is configured to land in the inbox. Returns overall_verdict plus per-record verdict, the raw record, findings, and a blocklist section (clean / listed / unknown — unknown never counts as listed).',
|
|
56
|
+
inputSchema: CheckDeliverabilityJsonSchema,
|
|
57
|
+
handler: checkDeliverability,
|
|
58
|
+
},
|
|
41
59
|
{
|
|
42
60
|
name: 'cognilead.ingest_lead',
|
|
43
|
-
description: 'Register a lead in the CogniLead pipeline. Runs through the intersect stage (suppression check, dedup,
|
|
61
|
+
description: 'Register a lead in the CogniLead pipeline. Runs through the intersect stage (suppression check, dedup). Pass campaign_id to continue into personalize → dispatch, and enrich:true to buy the "why now" fact from an enrichment vendor first (billed per enriched lead, only on a citable result). Returns the persisted lead row. Requires a CogniLead API key.',
|
|
44
62
|
inputSchema: IngestLeadJsonSchema,
|
|
45
63
|
handler: ingestLead,
|
|
46
64
|
},
|
|
47
65
|
{
|
|
48
66
|
name: 'cognilead.run_campaign',
|
|
49
|
-
description: 'Kick off a campaign by id, optionally restricted to a set of lead_ids. The hosted API runs the per-step personalize →
|
|
67
|
+
description: 'Kick off a campaign by id, optionally restricted to a set of lead_ids. The hosted API runs the per-step personalize → dispatch pipeline. Returns the dispatch result including send_ids. NOTE: campaign endpoints are not live yet, so this currently returns a structured "unavailable" error. Requires a CogniLead API key.',
|
|
50
68
|
inputSchema: RunCampaignJsonSchema,
|
|
51
69
|
handler: runCampaign,
|
|
52
70
|
},
|
|
@@ -57,10 +75,64 @@ export const TOOLS = [
|
|
|
57
75
|
handler: suppress,
|
|
58
76
|
},
|
|
59
77
|
{
|
|
60
|
-
name: 'cognilead.
|
|
61
|
-
description:
|
|
62
|
-
inputSchema:
|
|
63
|
-
handler:
|
|
78
|
+
name: 'cognilead.create_topup_link',
|
|
79
|
+
description: "Start a Stripe Checkout to top up an end-customer's prepaid credit balance. Provide the customer_id and amount_usd; returns a { url } for the human to pay. On payment the customer's credit_ledger is credited. Requires a CogniLead API key.",
|
|
80
|
+
inputSchema: CreateTopupLinkJsonSchema,
|
|
81
|
+
handler: createTopupLink,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'cognilead.list_leads',
|
|
85
|
+
description: 'List leads in your CogniLead pipeline (read-only). Cursor-paginated — pass optional limit and cursor to page through. Returns { leads, next_cursor }. Requires a CogniLead API key.',
|
|
86
|
+
inputSchema: ListLeadsJsonSchema,
|
|
87
|
+
handler: listLeads,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'cognilead.list_sends',
|
|
91
|
+
description: 'List the send/dispatch history for one lead (read-only). lead_id is REQUIRED. Cursor-paginated via optional limit and cursor. Returns { sends, next_cursor }; each send carries sender_domain and sender_address (the mailbox it went out from, null for relay or unsent steps), and skipped_reason when a step was not sent. Requires a CogniLead API key.',
|
|
92
|
+
inputSchema: ListSendsJsonSchema,
|
|
93
|
+
handler: listSends,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'cognilead.list_suppressions',
|
|
97
|
+
description: 'List suppressed emails/domains on your account (read-only). Cursor-paginated via optional limit and cursor. Requires a CogniLead API key.',
|
|
98
|
+
inputSchema: ListSuppressionsJsonSchema,
|
|
99
|
+
handler: listSuppressions,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'cognilead.get_billing_usage',
|
|
103
|
+
description: 'Get current billing-period usage for your account (sends consumed, quota remaining, etc.) (read-only). Requires a CogniLead API key.',
|
|
104
|
+
inputSchema: EmptyJsonSchema,
|
|
105
|
+
handler: getBillingUsage,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'cognilead.get_subscription',
|
|
109
|
+
description: 'Get your CogniLead subscription details — plan, status, and limits (read-only). Requires a CogniLead API key.',
|
|
110
|
+
inputSchema: EmptyJsonSchema,
|
|
111
|
+
handler: getSubscription,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'cognilead.get_deliverability',
|
|
115
|
+
description: 'Get your sending health for the last 30 days (read-only): the sender domains that carried your mail (status, pause + reason, warm-up days, daily cap), your sending reputation tier (probation or shared) with the sent/bounced/complaint counts that decide it, bounce and complaint rates, and queued steps currently deferred by reason. Requires a CogniLead API key.',
|
|
116
|
+
inputSchema: EmptyJsonSchema,
|
|
117
|
+
handler: getDeliverability,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'cognilead.list_webhooks',
|
|
121
|
+
description: 'List the webhook endpoints configured on your account (read-only). Requires a CogniLead API key.',
|
|
122
|
+
inputSchema: EmptyJsonSchema,
|
|
123
|
+
handler: listWebhooks,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'cognilead.list_api_keys',
|
|
127
|
+
description: 'List API key metadata on your account (read-only). Hashes and secrets are stripped by the server — only id, prefix, label, and timestamps are returned. Requires a CogniLead API key.',
|
|
128
|
+
inputSchema: EmptyJsonSchema,
|
|
129
|
+
handler: listApiKeys,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'cognilead.health',
|
|
133
|
+
description: 'Check CogniLead API health/availability (read-only). Public — no API key required. Use to verify the service is reachable before configuring a key.',
|
|
134
|
+
inputSchema: EmptyJsonSchema,
|
|
135
|
+
handler: health,
|
|
64
136
|
},
|
|
65
137
|
];
|
|
66
138
|
function toolByName(name) {
|
|
@@ -88,6 +160,8 @@ export function createServer() {
|
|
|
88
160
|
const server = new Server(SERVER_INFO, {
|
|
89
161
|
capabilities: {
|
|
90
162
|
tools: {},
|
|
163
|
+
resources: {},
|
|
164
|
+
prompts: {},
|
|
91
165
|
},
|
|
92
166
|
});
|
|
93
167
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
@@ -131,6 +205,47 @@ export function createServer() {
|
|
|
131
205
|
};
|
|
132
206
|
}
|
|
133
207
|
});
|
|
208
|
+
// ─── Resources ──────────────────────────────────────────────────────────
|
|
209
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
210
|
+
resources: RESOURCES.map((r) => ({
|
|
211
|
+
uri: r.uri,
|
|
212
|
+
name: r.name,
|
|
213
|
+
description: r.description,
|
|
214
|
+
mimeType: r.mimeType,
|
|
215
|
+
})),
|
|
216
|
+
}));
|
|
217
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
218
|
+
const { uri } = request.params;
|
|
219
|
+
try {
|
|
220
|
+
return await readResource(uri);
|
|
221
|
+
}
|
|
222
|
+
catch (e) {
|
|
223
|
+
// Surface the curated upgrade/auth message (or other error) as resource
|
|
224
|
+
// text rather than throwing — IDEs render it directly to the developer.
|
|
225
|
+
const payload = formatToolError(e);
|
|
226
|
+
return {
|
|
227
|
+
contents: [
|
|
228
|
+
{
|
|
229
|
+
uri,
|
|
230
|
+
mimeType: 'application/json',
|
|
231
|
+
text: JSON.stringify(payload, null, 2),
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
// ─── Prompts ────────────────────────────────────────────────────────────
|
|
238
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
239
|
+
prompts: PROMPTS.map((p) => ({
|
|
240
|
+
name: p.name,
|
|
241
|
+
description: p.description,
|
|
242
|
+
arguments: p.arguments,
|
|
243
|
+
})),
|
|
244
|
+
}));
|
|
245
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
246
|
+
const { name, arguments: args } = request.params;
|
|
247
|
+
return getPrompt(name, (args ?? {}));
|
|
248
|
+
});
|
|
134
249
|
return server;
|
|
135
250
|
}
|
|
136
251
|
async function main() {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,4CAA4C;AAC5C,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,4CAA4C;AAC5C,EAAE;AACF,kEAAkE;AAClE,uEAAuE;AACvE,uEAAuE;AACvE,UAAU;AACV,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OA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A;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/B,iEAAiE;IACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,mBAAmB,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,OAAO,uBAAuB,CAClF,CAAA;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,kBAAkB,GACtB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;AAExC,IAAI,kBAAkB,EAAE,CAAC;IACvB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA2B,GAAa,CAAC,OAAO,IAAI,CAAC,CAAA;QAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface PromptArg {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
required: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface PromptDef {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
arguments: PromptArg[];
|
|
10
|
+
}
|
|
11
|
+
export declare const PROMPTS: PromptDef[];
|
|
12
|
+
type Args = Record<string, string | undefined>;
|
|
13
|
+
export declare function getPrompt(name: string, args: Args): {
|
|
14
|
+
description?: string;
|
|
15
|
+
messages: {
|
|
16
|
+
role: 'user';
|
|
17
|
+
content: {
|
|
18
|
+
type: 'text';
|
|
19
|
+
text: string;
|
|
20
|
+
};
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,SAAS,EAAE,CAAA;CACvB;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,EA4B9B,CAAA;AAUD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;AAE9C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,EAAE,CAAA;CACtE,CAiEA"}
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// MCP Prompts — reusable, parameterized templates an IDE/agent can invoke.
|
|
2
|
+
//
|
|
3
|
+
// These are pure templates (no network, no API key). They encode CogniLead's
|
|
4
|
+
// opinionated playbooks so an agent produces on-brand, compliance-aware output
|
|
5
|
+
// and knows which CogniLead tools to call next.
|
|
6
|
+
export const PROMPTS = [
|
|
7
|
+
{
|
|
8
|
+
name: 'cold-outbound-sequence',
|
|
9
|
+
description: 'Draft a compliant 3-step cold-outbound email sequence for a product and ICP, ready to load into a CogniLead campaign.',
|
|
10
|
+
arguments: [
|
|
11
|
+
{ name: 'product', description: 'The product being pitched.', required: true },
|
|
12
|
+
{ name: 'icp', description: 'Ideal customer profile / who you are emailing.', required: true },
|
|
13
|
+
{ name: 'tone', description: 'Voice, e.g. "direct technical", "warm". Defaults to direct.', required: false },
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'deliverability-triage',
|
|
18
|
+
description: 'Diagnose why a domain may be landing in spam and produce a prioritized fix list.',
|
|
19
|
+
arguments: [
|
|
20
|
+
{ name: 'domain', description: 'The sending domain to triage.', required: true },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'warmup-plan',
|
|
25
|
+
description: 'Recommend a warmup ramp for a new sending domain before running real campaigns.',
|
|
26
|
+
arguments: [
|
|
27
|
+
{ name: 'domain', description: 'The new sending domain.', required: true },
|
|
28
|
+
{ name: 'target_daily_volume', description: 'Eventual daily send target, e.g. 200.', required: false },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
function userMessage(text) {
|
|
33
|
+
return {
|
|
34
|
+
messages: [
|
|
35
|
+
{ role: 'user', content: { type: 'text', text } },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function getPrompt(name, args) {
|
|
40
|
+
switch (name) {
|
|
41
|
+
case 'cold-outbound-sequence': {
|
|
42
|
+
const product = args.product ?? '<product>';
|
|
43
|
+
const icp = args.icp ?? '<ideal customer profile>';
|
|
44
|
+
const tone = args.tone ?? 'direct, technical';
|
|
45
|
+
return {
|
|
46
|
+
description: `Cold-outbound sequence for ${product}`,
|
|
47
|
+
...userMessage(`Write a compliant 3-step cold-outbound email sequence.
|
|
48
|
+
|
|
49
|
+
Product: ${product}
|
|
50
|
+
ICP: ${icp}
|
|
51
|
+
Tone: ${tone}
|
|
52
|
+
|
|
53
|
+
Rules:
|
|
54
|
+
- Step 1: lead with a specific, verifiable hook about the recipient; one clear ask. Keep under 90 words.
|
|
55
|
+
- Step 2 (follow-up): new angle or proof point, not "just bumping this".
|
|
56
|
+
- Step 3 (break-up): short, low-pressure, easy yes/no.
|
|
57
|
+
- Every email must read as if a human wrote it. No spammy phrasing, no false urgency.
|
|
58
|
+
- Each email must work alongside a one-click unsubscribe footer (CogniLead adds RFC 8058 headers automatically) — do not write your own unsubscribe line.
|
|
59
|
+
- For each step return: subject, body (markdown), and the suggested send delay in days.
|
|
60
|
+
|
|
61
|
+
After drafting, suggest calling the CogniLead "draft_pitch" tool to personalize step 1 per lead, then "ingest_lead" + "run_campaign" to send through the warmed pool.`),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
case 'deliverability-triage': {
|
|
65
|
+
const domain = args.domain ?? '<domain>';
|
|
66
|
+
return {
|
|
67
|
+
description: `Deliverability triage for ${domain}`,
|
|
68
|
+
...userMessage(`Diagnose why mail from "${domain}" might be landing in spam, then give a prioritized fix list.
|
|
69
|
+
|
|
70
|
+
Start by calling the CogniLead "check_deliverability" tool for ${domain} to read its SPF and DMARC records. Then assess, in order:
|
|
71
|
+
1. Authentication: SPF (policy, lookup count, duplicates), DKIM presence, DMARC (policy, rua, pct).
|
|
72
|
+
2. Reputation & infrastructure: domain age, whether it's warmed, shared vs dedicated IP, blacklist exposure.
|
|
73
|
+
3. Content & list hygiene: spam-trigger phrasing, link/image ratio, list quality, suppression of bounces/opt-outs.
|
|
74
|
+
4. Volume pattern: sudden ramps vs gradual warmup.
|
|
75
|
+
|
|
76
|
+
Output a table: issue · severity (high/med/low) · fix. End with the single highest-impact action. Note where CogniLead's warmed pool and reputation circuit-breaker remove the manual work.`),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
case 'warmup-plan': {
|
|
80
|
+
const domain = args.domain ?? '<domain>';
|
|
81
|
+
const vol = args.target_daily_volume ?? '200';
|
|
82
|
+
return {
|
|
83
|
+
description: `Warmup plan for ${domain}`,
|
|
84
|
+
...userMessage(`Produce a warmup ramp for the new sending domain "${domain}" targeting ${vol} emails/day.
|
|
85
|
+
|
|
86
|
+
Cover:
|
|
87
|
+
- Pre-flight: SPF, DKIM, DMARC, custom tracking domain, and a few weeks of domain age before cold sends.
|
|
88
|
+
- A week-by-week volume ramp from a low daily count up to ${vol}/day, with safe step increases and reply-rate / spam-rate guardrails.
|
|
89
|
+
- What to monitor (Google Postmaster reputation, bounce rate, spam-complaint rate) and the thresholds at which to pause.
|
|
90
|
+
- When it's safe to begin real campaigns.
|
|
91
|
+
|
|
92
|
+
Present the ramp as a week-by-week table. Note that CogniLead's managed pool runs peer-to-peer warming and auto-pauses a domain on reputation drift, so this ramp can be delegated rather than hand-run.`),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,gDAAgD;AAchD,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EACT,uHAAuH;QACzH,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9E,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,gDAAgD,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9F,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,6DAA6D,EAAE,QAAQ,EAAE,KAAK,EAAE;SAC9G;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,kFAAkF;QACpF,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE,QA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C;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAA;YACxC,MAAM,GAAG,GAAG,IAAI,CAAC,mBAAmB,IAAI,KAAK,CAAA;YAC7C,OAAO;gBACL,WAAW,EAAE,mBAAmB,MAAM,EAAE;gBACxC,GAAG,WAAW,CACZ,qDAAqD,MAAM,eAAe,GAAG;;;;4DAI3B,GAAG;;;;yMAI0I,CAChM;aACF,CAAA;QACH,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC;AACH,CAAC"}
|
package/dist/rate-limit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../src/rate-limit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../src/rate-limit.ts"],"names":[],"mappings":"AAoBA,UAAU,UAAU;IAElB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAuCD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAmBvF;AAED,iCAAiC;AACjC,wBAAgB,cAAc,IAAI,UAAU,CAE3C"}
|
package/dist/rate-limit.js
CHANGED
package/dist/rate-limit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../src/rate-limit.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,wEAAwE;AACxE,wEAAwE;AACxE,+DAA+D;AAC/D,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa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AQ,CAAC,IAAI,CAAC,CAAA;IACxC,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QAClB,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,CAAA;QAClC,MAAM,IAAI,aAAa,CACrB,iCAAiC,QAAQ,KAAK,KAAK,SAAS;YAC1D,sDAAsD,SAAS,EAAE,CACpE,CAAA;IACH,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,CAAA;IACjC,OAAO,CAAC,KAAK,CAAC,CAAA;IACd,OAAO,EAAE,SAAS,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAA;AAC7D,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,EAAE,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ResourceDef {
|
|
2
|
+
uri: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const RESOURCES: ResourceDef[];
|
|
8
|
+
export declare function readResource(uri: string): Promise<{
|
|
9
|
+
contents: {
|
|
10
|
+
uri: string;
|
|
11
|
+
mimeType: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,SAAS,EAAE,WAAW,EA6BlC,CAAA;AA8BD,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM;;;;;;GAa7C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// MCP Resources — read-only context an IDE/agent can pull in.
|
|
2
|
+
//
|
|
3
|
+
// `cognilead://docs` is static (no network, always available). The rest map
|
|
4
|
+
// to the hosted /api/v1 surface and require a CogniLead API key; reading one
|
|
5
|
+
// without a key throws McpAuthError (via authHeaders) which the index handler
|
|
6
|
+
// renders as the curated upgrade message — the same acquisition moment as the
|
|
7
|
+
// gated tools.
|
|
8
|
+
import { apiGet } from './api-client.js';
|
|
9
|
+
export const RESOURCES = [
|
|
10
|
+
{
|
|
11
|
+
uri: 'cognilead://docs',
|
|
12
|
+
name: 'CogniLead documentation index',
|
|
13
|
+
description: 'Links to the CogniLead docs (architecture, outbound email, deliverability, MCP, API). Use to ground answers about how CogniLead works. No API key required.',
|
|
14
|
+
mimeType: 'application/json',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
uri: 'cognilead://sends/recent',
|
|
18
|
+
name: 'Recent sends',
|
|
19
|
+
description: 'The most recent outbound sends for your tenant with delivery state (delivered, bounced, replied, unsubscribed). Requires a CogniLead API key.',
|
|
20
|
+
mimeType: 'application/json',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
uri: 'cognilead://suppressions',
|
|
24
|
+
name: 'Suppression list',
|
|
25
|
+
description: 'Addresses and domains currently suppressed for your tenant (opt-outs, bounces, complaints). Requires a CogniLead API key.',
|
|
26
|
+
mimeType: 'application/json',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
uri: 'cognilead://pool/mailboxes',
|
|
30
|
+
name: 'Reserved warmed mailboxes',
|
|
31
|
+
description: 'The warmed sender mailboxes reserved by your tenant and their warmup status. Requires a CogniLead API key.',
|
|
32
|
+
mimeType: 'application/json',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const DOCS_INDEX = {
|
|
36
|
+
product: 'CogniLead — global, compliance-first cold-email deliverability',
|
|
37
|
+
site: 'https://cognilead.ai',
|
|
38
|
+
docs: [
|
|
39
|
+
{ slug: 'architecture', url: 'https://cognilead.ai/docs/architecture' },
|
|
40
|
+
{ slug: 'outbound-email', url: 'https://cognilead.ai/docs/outbound-email' },
|
|
41
|
+
{ slug: 'deliverability', url: 'https://cognilead.ai/docs/deliverability' },
|
|
42
|
+
{ slug: 'mcp', url: 'https://cognilead.ai/docs/mcp' },
|
|
43
|
+
{ slug: 'api', url: 'https://cognilead.ai/api/v1/docs' },
|
|
44
|
+
],
|
|
45
|
+
free_tools: [
|
|
46
|
+
'https://cognilead.ai/tools/spf-checker',
|
|
47
|
+
'https://cognilead.ai/tools/dmarc-checker',
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
function asJson(uri, data) {
|
|
51
|
+
return {
|
|
52
|
+
contents: [
|
|
53
|
+
{
|
|
54
|
+
uri,
|
|
55
|
+
mimeType: 'application/json',
|
|
56
|
+
text: JSON.stringify(data, null, 2),
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export async function readResource(uri) {
|
|
62
|
+
switch (uri) {
|
|
63
|
+
case 'cognilead://docs':
|
|
64
|
+
return asJson(uri, DOCS_INDEX);
|
|
65
|
+
case 'cognilead://sends/recent':
|
|
66
|
+
return asJson(uri, await apiGet('/api/v1/sends'));
|
|
67
|
+
case 'cognilead://suppressions':
|
|
68
|
+
return asJson(uri, await apiGet('/api/v1/suppressions'));
|
|
69
|
+
case 'cognilead://pool/mailboxes':
|
|
70
|
+
return asJson(uri, await apiGet('/api/v1/pool/my-mailboxes'));
|
|
71
|
+
default:
|
|
72
|
+
throw new Error(`Unknown resource URI: ${uri}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=resources.js.map
|