@mailloom/mcp 0.1.0 → 0.1.1

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 CHANGED
@@ -20,15 +20,15 @@ API auth runs in the Supabase Edge Function `mailloom-api` (service role never l
20
20
  "args": ["-y", "@mailloom/mcp"],
21
21
  "env": {
22
22
  "MAILLOOM_API_KEY": "ml_live_…",
23
- "MAILLOOM_API_BASE": "http://localhost:3847/api/v1"
23
+ "MAILLOOM_API_BASE": "https://<project>.supabase.co/functions/v1/mailloom-api",
24
+ "MAILLOOM_ANON_KEY": "<supabase-anon-key>"
24
25
  }
25
26
  }
26
27
  }
27
28
  }
28
29
  ```
29
30
 
30
- Production Next: `https://your-host/api/v1`.
31
- Edge Function only (CRUD, no HTML export): `https://<project>.supabase.co/functions/v1/mailloom-api`.
31
+ Account settings copies this snippet for you. For HTML `export_template`, point `MAILLOOM_API_BASE` at your app `/api/v1` instead (proxies to the Edge Function).
32
32
 
33
33
  ### Local package (unpublished)
34
34
 
@@ -58,7 +58,8 @@ npm run build
58
58
  | Variable | Required | Default | Purpose |
59
59
  | --- | --- | --- | --- |
60
60
  | `MAILLOOM_API_KEY` | yes | — | `ml_live_…` from Account settings |
61
- | `MAILLOOM_API_BASE` | no | `http://localhost:3847/api/v1` | API origin including `/api/v1` |
61
+ | `MAILLOOM_API_BASE` | no | Mailloom Edge Function URL | Edge Function or Next `/api/v1` |
62
+ | `MAILLOOM_ANON_KEY` | for Edge Function | — | Public Supabase anon key (`apikey` header) |
62
63
 
63
64
  ## Tools
64
65
 
package/dist/client.d.ts CHANGED
@@ -2,12 +2,14 @@
2
2
  * Thin Mailloom API client for MCP.
3
3
  * Auth: Authorization Bearer ml_live_…
4
4
  *
5
- * Prefer Next /api/v1 (proxies to the mailloom-api Edge Function + HTML export).
6
- * Or point at https://<project>.supabase.co/functions/v1/mailloom-api for CRUD only.
5
+ * Default base is the mailloom-api Edge Function (no local Next required).
6
+ * Optional MAILLOOM_ANON_KEY (public) is sent as `apikey` for the Supabase gateway.
7
+ * For HTML export, point MAILLOOM_API_BASE at your app `/api/v1` instead.
7
8
  */
8
9
  export type ApiConfig = {
9
10
  baseUrl: string;
10
11
  apiKey: string;
12
+ anonKey?: string;
11
13
  };
12
14
  export declare function loadConfig(): ApiConfig;
13
15
  export declare function apiRequest(config: ApiConfig, method: string, path: string, opts?: {
package/dist/client.js CHANGED
@@ -2,10 +2,11 @@
2
2
  * Thin Mailloom API client for MCP.
3
3
  * Auth: Authorization Bearer ml_live_…
4
4
  *
5
- * Prefer Next /api/v1 (proxies to the mailloom-api Edge Function + HTML export).
6
- * Or point at https://<project>.supabase.co/functions/v1/mailloom-api for CRUD only.
5
+ * Default base is the mailloom-api Edge Function (no local Next required).
6
+ * Optional MAILLOOM_ANON_KEY (public) is sent as `apikey` for the Supabase gateway.
7
+ * For HTML export, point MAILLOOM_API_BASE at your app `/api/v1` instead.
7
8
  */
8
- const DEFAULT_BASE = 'http://localhost:3847/api/v1';
9
+ const DEFAULT_BASE = 'https://siqcxhwcklmtoazielus.supabase.co/functions/v1/mailloom-api';
9
10
  export function loadConfig() {
10
11
  const apiKey = (process.env.MAILLOOM_API_KEY || '').trim();
11
12
  if (!apiKey) {
@@ -15,7 +16,8 @@ export function loadConfig() {
15
16
  throw new Error('MAILLOOM_API_KEY must start with ml_live_');
16
17
  }
17
18
  const baseUrl = (process.env.MAILLOOM_API_BASE || DEFAULT_BASE).replace(/\/$/, '');
18
- return { baseUrl, apiKey };
19
+ const anonKey = (process.env.MAILLOOM_ANON_KEY || '').trim() || undefined;
20
+ return { baseUrl, apiKey, anonKey };
19
21
  }
20
22
  export async function apiRequest(config, method, path, opts) {
21
23
  const url = new URL(path.startsWith('http') ? path : `${config.baseUrl}${path.startsWith('/') ? path : `/${path}`}`);
@@ -30,6 +32,10 @@ export async function apiRequest(config, method, path, opts) {
30
32
  Authorization: `Bearer ${config.apiKey}`,
31
33
  Accept: 'application/json',
32
34
  };
35
+ // Supabase Functions gateway expects the project anon key even when verify_jwt is off.
36
+ if (config.anonKey) {
37
+ headers.apikey = config.anonKey;
38
+ }
33
39
  if (opts?.body !== undefined) {
34
40
  headers['Content-Type'] = 'application/json';
35
41
  }
package/dist/index.js CHANGED
@@ -3,8 +3,9 @@
3
3
  * Official Mailloom MCP server — templates, brand kits, assets for AI hosts.
4
4
  *
5
5
  * Env:
6
- * MAILLOOM_API_KEY required — ml_live_…
7
- * MAILLOOM_API_BASE optional — default http://localhost:3847/api/v1
6
+ * MAILLOOM_API_KEY required — ml_live_…
7
+ * MAILLOOM_API_BASE optional — Edge Function URL (default) or Next /api/v1
8
+ * MAILLOOM_ANON_KEY optional — public Supabase anon key (needed for Edge Function)
8
9
  *
9
10
  * Write tools require Account settings → Allow MCP / API write access (default on).
10
11
  * When disabled, mutating tools return 403 write_disabled; reads still work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailloom/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Official Mailloom MCP server — manage email templates, brand kits, and assets via the Mailloom API.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,5 +46,8 @@
46
46
  "email",
47
47
  "templates"
48
48
  ],
49
+ "publishConfig": {
50
+ "access": "public"
51
+ },
49
52
  "license": "MIT"
50
53
  }