coss-mcp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cal.com, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,68 @@
1
- # Temporary Holding Version
1
+ # coss-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The [Model Context Protocol](https://modelcontextprotocol.io) server for [COSS](https://coss.com). Your
4
+ coding agent can ask "did the welcome email to jane@example.com get delivered?" and get the answer:
5
+ the email, what happened to each recipient and why, and what to do about it.
6
+
7
+ ```sh
8
+ claude mcp add coss -e COSS_API_KEY=coss_test_… -- npx -y coss-mcp
9
+ ```
10
+
11
+ Any MCP client works the same way: run `npx -y coss-mcp` with `COSS_API_KEY` in its environment.
12
+ Setup for Cursor, VS Code and Codex: [coss.com/docs/mcp](https://coss.com/docs/mcp).
13
+
14
+ Published from [cosscom/coss](https://github.com/cosscom/coss) by CI, with
15
+ [provenance](https://docs.npmjs.com/generating-provenance-statements).
16
+
17
+ ## Configuration
18
+
19
+ | Variable | |
20
+ | --- | --- |
21
+ | `COSS_API_KEY` | Required. A `coss_test_…` (development) or `coss_live_…` (production) key; the server sees that key's environment. |
22
+ | `COSS_BASE_URL` | Another API origin, e.g. `http://localhost:3001`. Defaults to `https://api.coss.com`. |
23
+
24
+ Configuration is read from the environment only, never from command-line arguments, which other
25
+ local processes can read.
26
+
27
+ API keys can do everything the API can: through this server the agent can also send email and
28
+ change suppressions and domains. Tools are annotated (`readOnlyHint`, `destructiveHint`) so clients
29
+ can ask before calling the ones that change something.
30
+
31
+ ## Tools
32
+
33
+ | Area | Tools |
34
+ | --- | --- |
35
+ | Email delivery | `diagnose_email`, `find_emails`, `get_email` |
36
+ | Sending | `send_email`, `cancel_email`, `reschedule_email` |
37
+ | Suppressions | `check_suppression`, `list_suppressions`, `add_suppression`, `remove_suppression` |
38
+ | Domains | `list_domains`, `get_domain`, `add_domain`, `verify_domain` |
39
+ | Webhooks | `list_webhook_endpoints`, `list_webhook_deliveries`, `get_webhook_delivery`, `retry_webhook_delivery` |
40
+ | Receiving | `get_inbound_address`, `list_received_emails`, `get_received_email` |
41
+ | Logs | `search_logs`, `get_log` |
42
+ | Account | `get_account_status` |
43
+
44
+ ## As a library
45
+
46
+ `createCossMcpServer` returns the server unconnected, for another transport or an existing client:
47
+
48
+ ```ts
49
+ import { Coss } from "coss";
50
+ import { createCossMcpServer } from "coss-mcp";
51
+
52
+ const apiKey = process.env.COSS_API_KEY;
53
+ const server = createCossMcpServer({ coss: new Coss({ apiKey }), apiKey });
54
+ ```
55
+
56
+ `diagnoseEmail({ email, events, context })` is the pure function behind `diagnose_email`.
57
+
58
+ ## Development
59
+
60
+ ```sh
61
+ bun run --cwd packages/mcp build # tsdown, publint, attw
62
+ bun run --cwd packages/mcp test
63
+ COSS_API_KEY=coss_test_… COSS_BASE_URL=http://localhost:3001 npx @modelcontextprotocol/inspector node packages/mcp/dist/cli.js
64
+ ```
65
+
66
+ ## License
67
+
68
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/cli.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { t as createCossMcpServer } from "./server-BEFSDUL2.js";
3
+ import { serveStdio } from "@modelcontextprotocol/server/stdio";
4
+ import { Coss } from "coss";
5
+ //#region src/cli.ts
6
+ /**
7
+ * `npx coss-mcp`: the COSS MCP server over stdio. Configuration comes from the environment only
8
+ * (never argv, which other local processes can read): COSS_API_KEY, and COSS_BASE_URL to point
9
+ * at another API (e.g. http://localhost:3001). stdout carries the protocol; logs go to stderr.
10
+ */
11
+ const apiKey = process.env.COSS_API_KEY?.trim();
12
+ if (!apiKey) {
13
+ console.error("coss-mcp: set COSS_API_KEY to a COSS API key (create one in the dashboard: https://coss.com/dashboard).");
14
+ process.exit(1);
15
+ }
16
+ const coss = new Coss({
17
+ apiKey,
18
+ baseUrl: process.env.COSS_BASE_URL?.trim() || void 0
19
+ });
20
+ serveStdio(() => createCossMcpServer({
21
+ coss,
22
+ apiKey
23
+ }), { onerror: (error) => console.error("coss-mcp:", error) });
24
+ //#endregion
25
+ export {};
@@ -0,0 +1,86 @@
1
+ import { McpServer } from "@modelcontextprotocol/server";
2
+ import { Coss, Email, EmailEvent, EmailRecipient, EmailSummary, ReputationStatus, Suppression } from "coss";
3
+ //#region src/diagnose.d.ts
4
+ type RecipientOutcome = "delivered" | "in_progress" | "delayed" | "bounced" | "complained" | "suppressed" | "failed" | "scheduled" | "canceled";
5
+ type Verdict = "delivered" | "partially_delivered" | "in_progress" | "scheduled" | "canceled" | "not_delivered";
6
+ interface RecipientDiagnosis {
7
+ address: string;
8
+ type: EmailRecipient["type"];
9
+ status: EmailRecipient["status"];
10
+ outcome: RecipientOutcome;
11
+ explanation: string;
12
+ /** The receiving server's or provider's own words, when there are any. */
13
+ details?: Record<string, unknown>;
14
+ next_steps: string[];
15
+ }
16
+ interface Diagnosis {
17
+ email_id: string;
18
+ subject: string;
19
+ from: string;
20
+ status: Email["status"];
21
+ sandbox: boolean;
22
+ verdict: Verdict;
23
+ summary: string;
24
+ failure: {
25
+ code: string;
26
+ message: string;
27
+ explanation: string;
28
+ next_steps: string[];
29
+ } | null;
30
+ recipients: RecipientDiagnosis[];
31
+ /** Account or setup problems that affect this email or the next ones. */
32
+ warnings: string[];
33
+ timeline: {
34
+ at: string;
35
+ type: string;
36
+ recipient: string | null;
37
+ }[];
38
+ created_at: string;
39
+ sent_at: string | null;
40
+ scheduled_at: string | null;
41
+ }
42
+ interface DiagnosisContext {
43
+ /** Suppression entries of recipient addresses (from `check_suppression`). */
44
+ suppressions?: Record<string, Suppression[]>;
45
+ /** The From address's domain, as COSS has it; `null` when no domain matched. */
46
+ domain?: {
47
+ name: string;
48
+ status: string;
49
+ can_send: boolean;
50
+ } | null;
51
+ reputation?: {
52
+ status: ReputationStatus;
53
+ reason: string | null;
54
+ } | null;
55
+ billing?: {
56
+ status: string;
57
+ holds: {
58
+ reason: string;
59
+ since: string;
60
+ }[];
61
+ } | null;
62
+ }
63
+ export declare function diagnoseEmail(input: {
64
+ email: Email | EmailSummary;
65
+ events: EmailEvent[];
66
+ context?: DiagnosisContext;
67
+ now?: Date;
68
+ }): Diagnosis;
69
+ //#endregion
70
+ //#region src/server.d.ts
71
+ interface CossMcpServerOptions {
72
+ /** The client every tool calls. */
73
+ coss: Coss;
74
+ /** The client's API key, only to tell live from sandbox keys (never sent anywhere else). */
75
+ apiKey?: string;
76
+ /** Overrides `new Date()` (tests). */
77
+ now?: () => Date;
78
+ }
79
+ /** An MCP server exposing COSS's tools over any transport (`coss-mcp` uses stdio). */
80
+ export declare function createCossMcpServer(options: CossMcpServerOptions): McpServer;
81
+ //#endregion
82
+ //#region src/version.d.ts
83
+ /** The package version, sent as the server's version and in the SDK's user agent. */
84
+ export declare const VERSION: string;
85
+ //#endregion
86
+ export type { CossMcpServerOptions, Diagnosis, DiagnosisContext, RecipientDiagnosis, RecipientOutcome, Verdict };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { n as VERSION, t as createCossMcpServer, r as diagnoseEmail } from "./server-BEFSDUL2.js";