@mailkite/mcp 0.8.0 → 0.9.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.
Files changed (3) hide show
  1. package/README.md +77 -85
  2. package/package.json +2 -2
  3. package/spec/api.json +1 -1
package/README.md CHANGED
@@ -1,38 +1,30 @@
1
- # @mailkite/mcp
2
-
3
- [Model Context Protocol](https://modelcontextprotocol.io) server for
4
- [MailKite](https://mailkite.dev). It exposes the MailKite API to LLM agents
5
- (Claude Desktop, Claude Code, Cursor, …) as tools — send mail, manage domains,
6
- webhooks, routes, and inbound messages, all from a chat.
7
-
8
- > **Read-only mirror.** This repo is a generated, release-time mirror of the MailKite
9
- > monorepo (the private source of truth); the source isn't developed here. Install
10
- > `@mailkite/mcp` from npm rather than cloning, and see the docs at
11
- > <https://mailkite.dev/docs/libraries#mcp>.
12
-
13
- It's a **thin layer**. The tools, their input schemas, and validation all come
14
- from the shared SDK contract in [`../spec`](../spec); transport, auth, and error
15
- handling come from the [MailKite Node SDK](https://github.com/mailkite/mailkite-node). Nothing about the API is
16
- duplicated here — update the spec and the MCP follows.
17
-
18
- > ### Hosted vs local — which should I use?
19
- >
20
- > Most users should connect to the **hosted remote MCP** instead of running this
21
- > package: `https://mcp.mailkite.dev/mcp` (Streamable HTTP, one-click **OAuth** — no
22
- > key to copy, no local process). In Claude Code that's the **plugin**
23
- > (`/plugin marketplace add mailkite/claude-code` → `/plugin install mailkite@mailkite`)
24
- > or `claude mcp add --transport http mailkite https://mcp.mailkite.dev/mcp`. See
25
- > <https://mailkite.dev/docs/ai-agents>.
26
- >
27
- > Run **this local server** when you want a **static key** (no browser OAuth), **offline /
28
- > CI** use, a stdio-only client, a custom `MAILKITE_BASE_URL`, or `verifyWebhook` to run
29
- > fully locally. Both expose the exact same tools (same `../spec`).
30
-
31
- ## Install / configure
32
-
33
- Point your MCP client at the server and give it your MailKite credential. The
34
- token is the same one the SDKs take: an `mk_live_…` API key (for sending) or a
35
- management session token.
1
+ <p align="center">
2
+ <a href="https://mailkite.dev">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://mailkite.dev/brand/logo-email-dark.png">
5
+ <img src="https://mailkite.dev/brand/logo-email.png" alt="MailKite" height="56">
6
+ </picture>
7
+ </a>
8
+ </p>
9
+
10
+ <h1 align="center">@mailkite/mcp</h1>
11
+
12
+ <p align="center">
13
+ <b>Email for every product you ship</b> — receive email as a webhook, send over a verified domain, give an AI agent its own inbox.
14
+ <br>The official <a href="https://mailkite.dev">MailKite</a> library for AI agents (MCP).
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="https://mailkite.dev/docs">Docs</a> ·
19
+ <a href="https://mailkite.dev/docs/libraries#mcp">Library guide</a> ·
20
+ <a href="https://mailkite.dev">mailkite.dev</a> ·
21
+ <a href="https://mailkite.dev/docs/ai-agents">AI agents</a>
22
+ </p>
23
+ <p align="center"><a href="https://www.npmjs.com/package/@mailkite/mcp"><img src="https://img.shields.io/npm/v/@mailkite/mcp?color=2563eb&label=npm" alt="npm"></a></p>
24
+
25
+ > **Read-only mirror.** This repo is a generated, release-time mirror of the MailKite monorepo (the private source of truth) — development doesn't happen here. Install from npm and open issues against the [MailKite docs](https://mailkite.dev/docs).
26
+
27
+ ## Install
36
28
 
37
29
  ```json
38
30
  {
@@ -46,63 +38,63 @@ management session token.
46
38
  }
47
39
  ```
48
40
 
49
- | Env var | Required | Default | Notes |
50
- | --- | --- | --- | --- |
51
- | `MAILKITE_API_KEY` | yes | — | Bearer credential (`mk_live_…` API key or session token) |
52
- | `MAILKITE_BASE_URL` | no | `https://api.mailkite.dev` | Override for local/staging |
53
-
54
41
  ## Tools
55
42
 
56
- One tool per MailKite API operation (generated from [`../spec/api.json`](../spec/api.json)):
57
-
58
- | Tool | Operation |
59
- | --- | --- |
60
- | `mailkite_send` | Send a message over a verified domain |
61
- | `mailkite_agent` | Send a message to an inbox agent and get its reply |
62
- | `mailkite_route` | Route a message to a registered route and run its action |
63
- | `mailkite_list_domains` | List your domains |
64
- | `mailkite_create_domain` | Add a domain (returns DNS records) |
65
- | `mailkite_get_domain` | Get one domain with DNS + webhook |
66
- | `mailkite_delete_domain` | Remove a domain |
67
- | `mailkite_verify_domain` | Check DNS and update status |
68
- | `mailkite_set_webhook` | Set/replace the domain catch-all webhook |
69
- | `mailkite_delete_webhook` | Remove the domain webhook |
70
- | `mailkite_test_webhook` | Send a signed test event to the webhook |
71
- | `mailkite_list_routes` | List inbound routing rules |
72
- | `mailkite_create_route` | Create a route (match, action, destination) |
73
- | `mailkite_list_messages` | List stored messages |
74
- | `mailkite_get_message` | Get a message with deliveries + attachments |
75
- | `mailkite_retry_delivery` | Re-deliver a stored message to its webhook |
76
- | `mailkite_verify_webhook` | Verify an `x-mailkite-signature` header (local — no API call) |
77
-
78
- `mailkite_verify_webhook` is a **local** tool: it runs the SDK's `verifyWebhook`
79
- in-process (no credential, no network) and returns `{ "valid": true | false }`.
80
- Every other tool is one MailKite API operation.
81
-
82
- Each tool's input is a flat object with the real field names (e.g.
83
- `mailkite_send` takes `from`, `to`, `subject`, `html`, `text`, …). Required
84
- fields and types are enforced with [`ajv`](https://ajv.js.org) against the same
85
- JSON Schemas in [`../spec/schemas`](../spec/schemas) that the SDKs and
86
- conformance harness use — invalid calls are rejected before any HTTP request.
87
-
88
- ## How it works
43
+ One tool per MailKite API method, generated from the shared contract — including `mailkite_send`, `mailkite_semantic_search`, `mailkite_agent`, domain/route/webhook management, and more. Full list + schemas: **https://mailkite.dev/docs/libraries#mcp**.
89
44
 
90
- ```
91
- api.json ──▶ one MCP tool per method (name, description, input schema)
92
- schemas/* ──▶ ajv validators (validate the call before dispatch)
93
- Node SDK ──▶ MailKite.request(method, path, body) (auth, HTTP, errors)
94
- local methods (verifyWebhook) dispatch in-process — no HTTP
95
- ```
45
+ ## Use it from an AI agent — MCP + Agent connectors
96
46
 
97
- See [`PLAN.md`](./PLAN.md) for the full design.
47
+ MailKite speaks the [Model Context Protocol](https://modelcontextprotocol.io): every API method is a tool your AI assistant (Claude, Cursor, …) can call — send mail, manage domains, search the docs, and give an agent its own inbox. Full guide: **[https://mailkite.dev/docs/ai-agents](https://mailkite.dev/docs/ai-agents)**.
98
48
 
99
- ## Develop
49
+ **Hosted (recommended) — one-click OAuth, no key to copy:**
100
50
 
101
51
  ```bash
102
- npm install
103
- npm test # boots the server over stdio, lists tools, checks validation + wire bytes
52
+ claude mcp add --transport http mailkite https://mcp.mailkite.dev/mcp
53
+ ```
54
+
55
+ In Claude Code you can also install the plugin:
56
+
57
+ ```text
58
+ /plugin marketplace add mailkite/claude-code
59
+ /plugin install mailkite@mailkite
104
60
  ```
105
61
 
106
- ## License
62
+ Any chat/UI agent: *"Add the MCP server at https://mcp.mailkite.dev/mcp and authenticate in the browser when prompted."*
63
+
64
+ **Local (static key, offline / CI):**
65
+
66
+ ```json
67
+ { "mcpServers": { "mailkite": { "command": "npx", "args": ["-y", "@mailkite/mcp"], "env": { "MAILKITE_API_KEY": "mk_live_…" } } } }
68
+ ```
107
69
 
108
- MIT
70
+ **Give an agent its own inbox.** Route inbound mail to a built-in **inbox agent** (the `agent` route action) and it answers, files, or escalates on its own — see [https://mailkite.dev/docs/ai-agents](https://mailkite.dev/docs/ai-agents).
71
+
72
+ ## All MailKite libraries
73
+
74
+ Same contract, every language — pick the one for your stack (full list: [https://mailkite.dev/docs/libraries](https://mailkite.dev/docs/libraries)):
75
+
76
+ | Library | Repo | Distribution |
77
+ | --- | --- | --- |
78
+ | MailKite for Node.js | [`mailkite-node`](https://github.com/mailkite/mailkite-node) | npm |
79
+ | MailKite for Python | [`mailkite-python`](https://github.com/mailkite/mailkite-python) | PyPI |
80
+ | MailKite for Ruby | [`mailkite-ruby`](https://github.com/mailkite/mailkite-ruby) | RubyGems |
81
+ | MailKite for Java | [`mailkite-java`](https://github.com/mailkite/mailkite-java) | Maven Central |
82
+ | MailKite for PHP | [`mailkite-php`](https://github.com/mailkite/mailkite-php) | Packagist |
83
+ | MailKite for Go | [`mailkite-go`](https://github.com/mailkite/mailkite-go) | Go modules |
84
+ | @mailkite/cli | [`mailkite-cli`](https://github.com/mailkite/mailkite-cli) | npm |
85
+ | @mailkite/mcp **(this repo)** | [`mailkite-mcp`](https://github.com/mailkite/mailkite-mcp) | npm |
86
+ | @mailkite/client | [`mailkite-js`](https://github.com/mailkite/mailkite-js) | npm |
87
+ | @mailkite/expo | [`mailkite-expo`](https://github.com/mailkite/mailkite-expo) | npm |
88
+ | MailKiteClient | [`mailkite-swift`](https://github.com/mailkite/mailkite-swift) | Swift Package Manager |
89
+ | dev.mailkite:mailkite-client | [`mailkite-kotlin`](https://github.com/mailkite/mailkite-kotlin) | Maven Central |
90
+ | mailkite_client | [`mailkite-flutter`](https://github.com/mailkite/mailkite-flutter) | pub.dev |
91
+
92
+ ## Docs & links
93
+
94
+ - 📚 **Documentation:** https://mailkite.dev/docs
95
+ - 📦 **This library's guide:** https://mailkite.dev/docs/libraries#mcp
96
+ - 🤖 **AI agents (MCP + inbox agents):** https://mailkite.dev/docs/ai-agents
97
+ - 🌐 **Website:** https://mailkite.dev
98
+ - 🧭 **All libraries:** https://mailkite.dev/docs/libraries
99
+
100
+ <sub>Generated from the shared MailKite API contract. © MailKite.</sub>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailkite/mcp",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Model Context Protocol server for MailKite — exposes the MailKite API to LLM agents as tools. A thin layer over the MailKite Node SDK and the shared sdks/spec contract.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,6 +40,6 @@
40
40
  "dependencies": {
41
41
  "@modelcontextprotocol/sdk": "^1.0.0",
42
42
  "ajv": "^8.17.1",
43
- "mailkite": "^0.8.0"
43
+ "mailkite": "^0.9.0"
44
44
  }
45
45
  }
package/spec/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailkite",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Canonical interface contract for every MailKite SDK. One low-level request() plus one function per endpoint. All languages expose the same shape; only naming adapts to each language's convention (e.g. Go exports PascalCase).",
5
5
  "baseUrl": "https://api.mailkite.dev",
6
6
  "auth": {