@mailquilt/mcp 0.0.0-stage → 0.5.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 Vishal Lohar
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,87 @@
1
- # Temporary Holding Version
1
+ # @mailquilt/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
+ Model Context Protocol (MCP) server for Mail Quilt. Exposes Mail Quilt's deterministic document engine (`@mailquilt/core`) and email renderer (`@mailquilt/renderer`) over stdio so coding agents can create, edit, check, and render email JSON files safely without a DOM.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -D @mailquilt/mcp
9
+ ```
10
+
11
+ Or run directly with `npx`:
12
+
13
+ ```bash
14
+ npx @mailquilt/mcp --root ./emails
15
+ ```
16
+
17
+ ## Client setup
18
+
19
+ ### Claude Code
20
+
21
+ Add Mail Quilt to `.mcp.json` in your project root (or run `claude mcp add`):
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "mailquilt": {
27
+ "command": "npx",
28
+ "args": ["-y", "@mailquilt/mcp", "--root", "./emails"],
29
+ "env": {
30
+ "MAILQUILT_DEV_URL": "http://127.0.0.1:4173"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ ### Cursor
38
+
39
+ Add Mail Quilt to `.cursor/mcp.json`:
40
+
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "mailquilt": {
45
+ "command": "npx",
46
+ "args": ["-y", "@mailquilt/mcp", "--root", "./emails"],
47
+ "env": {
48
+ "MAILQUILT_DEV_URL": "http://127.0.0.1:4173"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### Codex
56
+
57
+ Add Mail Quilt to `~/.codex/config.toml` (or your project's `.codex/config.toml`):
58
+
59
+ ```toml
60
+ [mcp_servers.mailquilt]
61
+ command = "npx"
62
+ args = ["-y", "@mailquilt/mcp", "--root", "./emails"]
63
+
64
+ [mcp_servers.mailquilt.env]
65
+ MAILQUILT_DEV_URL = "http://127.0.0.1:4173"
66
+ ```
67
+
68
+ ## Tools
69
+
70
+ | Tool | Purpose |
71
+ | --- | --- |
72
+ | `list_block_types` | Returns live `BLOCK_TYPES`, `ROW_LAYOUTS`, and v4 JSON Schemas directly from `@mailquilt/core`. |
73
+ | `create_email` | Creates a validated `BlocksDocument` (blank or with initial settings, style, and Rows) and writes it inside the workspace root or returns JSON. |
74
+ | `read_email` | Reads and validates an email JSON file via `loadDocument()`, returning the document and a structural summary of Row, Column, and Block IDs. |
75
+ | `apply_commands` | Applies an array of Commands atomically via `createEditor()`, rolling back completely if any Command is refused and returning the refusal `code`, `reason`, and `index`. |
76
+ | `render_html` | Renders a file or inline document via `renderEmail()`, returning HTML, UTF-8 byte size, and Gmail 102 KB clipping status. |
77
+ | `render_text` | Renders a file or inline document to plain text via `renderText()`. |
78
+ | `check_email` | Runs `checkEmail()` (with optional `mergeTags`), returning structured Problems and pass/fail status. |
79
+ | `get_preview_url` | Returns the active `mailquilt dev` preview URL when `MAILQUILT_DEV_URL` (or `--dev-url`) is set, or instructions to start it. |
80
+
81
+ ## Security
82
+
83
+ - Every file read and write is restricted to the configured workspace root (`--root`, defaulting to `process.cwd()`). Path traversal (`..`), absolute paths outside the root, and symlinks pointing outside the root are refused.
84
+ - Every document is validated through `loadDocument()` from `@mailquilt/core`; malformed or invalid JSON is refused rather than silently repaired.
85
+ - `apply_commands` executes in memory and writes atomically only after every Command succeeds.
86
+
87
+ [Docs](https://editor.mailquilt.com) · [Playground](https://editor.mailquilt.com/playground) · [Source](https://github.com/mailquilt/editor) · MIT