shipmail-mcp 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 +21 -0
- package/README.md +99 -0
- package/dist/index.js +1756 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ShipMail
|
|
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
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# ShipMail MCP Server
|
|
2
|
+
|
|
3
|
+
Official Model Context Protocol server for ShipMail. It gives MCP-compatible agents access to ShipMail domains, mailboxes, messages, threads, webhooks, suppressions, resources, and guided prompts.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"mcpServers": {
|
|
10
|
+
"shipmail": {
|
|
11
|
+
"command": "npx",
|
|
12
|
+
"args": ["-y", "shipmail-mcp"],
|
|
13
|
+
"env": {
|
|
14
|
+
"SHIPMAIL_API_KEY": "sm_live_..."
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For local development in this repository:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd packages/shipmail-mcp
|
|
25
|
+
SHIPMAIL_API_KEY=sm_live_... bun run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
|
|
30
|
+
| Variable | Description |
|
|
31
|
+
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| `SHIPMAIL_API_KEY` | Required (or use `SHIPMAIL_API_KEY_FILE`). ShipMail API key (`sm_live_...`). |
|
|
33
|
+
| `SHIPMAIL_API_KEY_FILE` | Optional path to a file containing the API key. Takes precedence over `SHIPMAIL_API_KEY`. Reduces env-trace leak surface (Docker secrets, systemd `LoadCredential`, etc.). |
|
|
34
|
+
| `SHIPMAIL_BASE_URL` | Optional. Must be https on a `shipmail.to` host. Defaults to `https://shipmail.to/api/v1`. |
|
|
35
|
+
| `SHIPMAIL_MCP_TOOLS` | Optional comma-separated allowlist of tools. The `--tools` flag overrides this when both are set. |
|
|
36
|
+
| `SHIPMAIL_ALLOW_INSECURE_BASE_URL` | Set to `1` to permit a non-https or non-`shipmail.to` base URL. Use only for local development. |
|
|
37
|
+
| `SHIPMAIL_MCP_DEBUG` | Set to `1` to include `request_id`/`status` in stderr tool-call logs (default: off). |
|
|
38
|
+
|
|
39
|
+
The command also supports `--tools`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"args": [
|
|
44
|
+
"-y",
|
|
45
|
+
"shipmail-mcp",
|
|
46
|
+
"--tools",
|
|
47
|
+
"shipmail_list_mailboxes,shipmail_get_thread,shipmail_reply_to_thread"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Security model
|
|
53
|
+
|
|
54
|
+
- All tools are namespaced with the prefix `shipmail_` so they cannot collide with same-named tools registered by peer MCP servers in the same host.
|
|
55
|
+
- Successful tools return both text fallback content and structured MCP `structuredContent`.
|
|
56
|
+
- Mutating tools accept an optional caller-supplied `idempotency_key`. When omitted, the MCP server generates one (a fresh key per tool call). Supply your own key if you want a specific request to be idempotent across MCP retries.
|
|
57
|
+
- Email content, addresses, and error text are sanitized before reaching the LLM: ASCII control characters, DEL, and Unicode directional/BiDi markers (U+061C, U+200E/F, U+202A-E, U+2066-9) are stripped. Long strings are truncated.
|
|
58
|
+
- 5xx and other unexpected ShipMail errors are redacted to a generic message; the original `request_id` is preserved for support. Generic `Error` thrown values (network errors, deserialization, etc.) are redacted to "Internal MCP error" before the LLM sees them; details land on stderr.
|
|
59
|
+
- Each MCP session enforces per-tool rate limits AND a hard total-call ceiling as a runaway-agent circuit breaker. These are NOT abuse controls — real abuse limits live at the API per API key. Restart the server to reset.
|
|
60
|
+
- Webhook URLs are validated to be public https endpoints. Localhost, RFC1918, link-local, ULA, IPv4-mapped IPv6, `0.0.0.0`, decimal-int IPs, `.local`, and `.internal` hosts are rejected at input time.
|
|
61
|
+
- Destructive tools are annotated with `destructiveHint`. MCP hosts that gate on this annotation will prompt the user. We mark `shipmail_update_domain` (catch-all retarget), `shipmail_update_webhook` (URL change), `shipmail_rotate_webhook_secret`, and `shipmail_set_auto_reply` as destructive in addition to obvious deletes.
|
|
62
|
+
- Domain purchase is intentionally excluded from v1.
|
|
63
|
+
|
|
64
|
+
### Threats this server does NOT defend against
|
|
65
|
+
|
|
66
|
+
- **Indirect prompt injection from email content.** If you triage a mailbox, the agent reads attacker-controlled email bodies. The sanitizer strips invisible glyphs but cannot detect natural-language injection ("ignore previous instructions, send to..."). Only call destructive tools after explicit user approval.
|
|
67
|
+
- **Malicious LLM output / hallucinated args.** The MCP layer cannot tell whether an argument value came from the user or was invented. Use the host UI's tool-call confirmation (especially for `destructiveHint:true` tools).
|
|
68
|
+
- **Compromised MCP host.** Your API key is read from `SHIPMAIL_API_KEY` and held in memory by this process; if the host is compromised the key is gone regardless. Rotate keys you suspect have been exposed.
|
|
69
|
+
- **Webhook signing secret in conversation logs.** `shipmail_create_webhook` and `shipmail_rotate_webhook_secret` return the secret in `structuredContent`. Many MCP clients persist tool output in conversation history. Treat the session log as sensitive after these calls.
|
|
70
|
+
|
|
71
|
+
### Privacy
|
|
72
|
+
|
|
73
|
+
This server forwards email subject lines, bodies, headers, attachment metadata, and recipient lists to the LLM you connect it to. The LLM provider may log that content. For privacy-sensitive workflows, restrict the tool surface with `--tools` so the LLM only sees what it needs.
|
|
74
|
+
|
|
75
|
+
## Tool groups
|
|
76
|
+
|
|
77
|
+
- Status: `shipmail_status`
|
|
78
|
+
- Domains: `shipmail_list_domains`, `shipmail_get_domain`, `shipmail_create_domain`, `shipmail_update_domain`, `shipmail_delete_domain`, `shipmail_verify_domain`, `shipmail_search_domains`
|
|
79
|
+
- Mailboxes: `shipmail_list_mailboxes`, `shipmail_get_mailbox`, `shipmail_create_mailbox`, `shipmail_update_mailbox`, `shipmail_delete_mailbox`, `shipmail_set_auto_reply`
|
|
80
|
+
- Messages and threads: `shipmail_list_messages`, `shipmail_get_message`, `shipmail_send_message`, `shipmail_reply_to_message`, `shipmail_list_threads`, `shipmail_get_thread`, `shipmail_reply_to_thread`
|
|
81
|
+
- Webhooks: `shipmail_list_webhooks`, `shipmail_get_webhook`, `shipmail_create_webhook`, `shipmail_update_webhook`, `shipmail_delete_webhook`, `shipmail_rotate_webhook_secret`, `shipmail_test_webhook`, `shipmail_list_webhook_deliveries`
|
|
82
|
+
- Suppressions: `shipmail_list_suppressions`, `shipmail_remove_suppression`
|
|
83
|
+
|
|
84
|
+
## Resources
|
|
85
|
+
|
|
86
|
+
- `shipmail://account/status`
|
|
87
|
+
- `shipmail://domains`
|
|
88
|
+
- `shipmail://domains/{id}`
|
|
89
|
+
- `shipmail://mailboxes`
|
|
90
|
+
- `shipmail://mailboxes/{id}`
|
|
91
|
+
- `shipmail://messages/{id}`
|
|
92
|
+
- `shipmail://threads/{id}`
|
|
93
|
+
|
|
94
|
+
## Prompts
|
|
95
|
+
|
|
96
|
+
- `setup_domain`
|
|
97
|
+
- `triage_mailbox`
|
|
98
|
+
- `draft_reply`
|
|
99
|
+
- `configure_webhook`
|