@shipstatic/mcp 1.0.0-beta.0 → 1.0.0-beta.2

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
@@ -102,7 +102,7 @@ The hosted endpoint exposes `deployments_upload` only. The local install exposes
102
102
  | Tool | Description | Hosted |
103
103
  |------|-------------|:---:|
104
104
  | `deployments_upload` | Publish files and get a live URL instantly, optionally protected by a password | ✓ |
105
- | `deployments_list` | List all deployments with their URLs, status, labels, and password protection state | |
105
+ | `deployments_list` | List all deployments with their URLs, status, labels, and password protection state. Pages with `limit` and `cursor` | |
106
106
  | `deployments_get` | Get deployment details including URL, status, file count, size, labels, and password protection state | |
107
107
  | `deployments_set` | Update the labels on a deployment for organization and filtering | |
108
108
  | `deployments_delete` | Permanently delete a deployment and all its files | |
@@ -112,7 +112,7 @@ The hosted endpoint exposes `deployments_upload` only. The local install exposes
112
112
  | Tool | Description |
113
113
  |------|-------------|
114
114
  | `domains_set` | Connect a custom domain to your site, switch deployments, or update labels |
115
- | `domains_list` | List all domains with their linked deployment and verification status |
115
+ | `domains_list` | List all domains with their linked deployment and verification status. Pages with `limit` and `cursor` |
116
116
  | `domains_get` | Get domain details including linked deployment, verification status, and labels |
117
117
  | `domains_records` | Get the DNS records you need to configure at your DNS provider |
118
118
  | `domains_dns` | Look up which DNS provider hosts a domain (e.g. Cloudflare, Namecheap) |
@@ -127,6 +127,16 @@ The hosted endpoint exposes `deployments_upload` only. The local install exposes
127
127
  |------|-------------|
128
128
  | `whoami` | Get your account details including email, plan, and usage |
129
129
 
130
+ ### Paging
131
+
132
+ `deployments_list` and `domains_list` accept `limit` and `cursor`. Each response carries a `cursor` — pass it back to fetch the next page; `null` means you are on the last one.
133
+
134
+ ### Retrying a deploy safely
135
+
136
+ `deployments_upload` accepts an `idempotencyKey`. If a deploy times out you cannot tell "it never landed" from "it landed and the response was lost", and retrying without a key creates a second site. Send the same key on the retry and the original deployment is returned instead.
137
+
138
+ Key the *attempt*, not the try — a run id, a commit sha, or a uuid generated before the first call. A key that changes on every retry does nothing.
139
+
130
140
  ## Registry
131
141
 
132
142
  Published to the [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=com.shipstatic/mcp) as `com.shipstatic/mcp`. Registry-aware clients see both the hosted endpoint and the local install and pick the right transport for their environment.
package/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/bin.js ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * THE EXECUTABLE — `dist/bin.js`, the file `npx @shipstatic/mcp` runs. It is
4
+ * the only module here with side effects on import.
5
+ *
6
+ * `index.ts` beside it is a library and stays inert, which is what lets the
7
+ * hosted transport import this package's vocabulary instead of re-authoring
8
+ * it. The two used to be one file: `main` and `bin` in `package.json` both
9
+ * pointed at `index.ts`, so importing the package started a stdio server and,
10
+ * on failure, called `process.exit` in its consumer. Nothing could be shared
11
+ * because there was nothing importable to share. `npm/ship` split the same
12
+ * knot the same way (`bin.ts` executable, `index.ts` library) — a module
13
+ * boundary says the same thing to every caller.
14
+ */
15
+ import { createRequire } from 'node:module';
16
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
17
+ import Ship from '@shipstatic/ship';
18
+ import { createServer } from './server.js';
19
+ // The executable knows its own manifest; the library it drives does not have
20
+ // to. `createServer` takes the version as an argument precisely so no module
21
+ // below this one needs `node:module` in its import graph.
22
+ const { version } = createRequire(import.meta.url)('../package.json');
23
+ async function main() {
24
+ // SHIP_TOKEN is optional — without it, deployments are public (3-day expiry).
25
+ // The SDK coerces empty strings to undefined, so we can pass through directly.
26
+ //
27
+ // One credential slot, any platform token: the value's prefix says what it
28
+ // is (`ship-` API key, `deploy-` deploy token, anything else an opaque
29
+ // bearer) and the server classifies it. MCP never has to know which kind it
30
+ // holds.
31
+ const ship = new Ship({ token: process.env.SHIP_TOKEN });
32
+ const server = createServer(ship, version);
33
+ const transport = new StdioServerTransport();
34
+ await server.connect(transport);
35
+ console.error('ShipStatic MCP Server running on stdio');
36
+ }
37
+ main().catch((error) => {
38
+ console.error('Fatal error:', error);
39
+ process.exit(1);
40
+ });
package/dist/call.d.ts CHANGED
@@ -1,2 +1,41 @@
1
1
  import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- export declare function call<T>(fn: () => Promise<T>): Promise<CallToolResult>;
2
+ /**
3
+ * The two error arms that earn a hint. Everything else relays verbatim — a
4
+ * hint on any other type sends the agent chasing a credential that is not the
5
+ * problem.
6
+ *
7
+ * They are ARGUMENTS rather than constants because they are the one part of
8
+ * the mapping that legitimately differs per transport: stdio can name the
9
+ * environment variable it owns, and the hosted endpoint deliberately cannot
10
+ * (it has no configuration of its own, and naming another package's variable
11
+ * is how this pair silently desynchronised once already).
12
+ */
13
+ export interface ErrorHints {
14
+ /** Appended after `Hint: ` when the SDK rejects the credential. */
15
+ authentication: string;
16
+ /** Appended after `Hint: ` when the platform refuses an authenticated call. */
17
+ forbidden: string;
18
+ }
19
+ export interface CallOptions {
20
+ hints: ErrorHints;
21
+ /**
22
+ * Attach a plain-object result as `structuredContent` beside the text.
23
+ * Hosted-only today: it is what feeds the Apps-SDK widget, and the MCP spec
24
+ * pairs it with an `outputSchema`, which is a hand-maintained zod twin of a
25
+ * published type. One such twin is worth it for a widget; fifteen would be a
26
+ * drift surface with no consumer asking for it. See
27
+ * `cloudflare/mcp/CLAUDE.md`, "What deliberately differs".
28
+ */
29
+ structuredContent?: boolean;
30
+ }
31
+ /**
32
+ * Builds the `call()` wrapper both transports use: SDK promise in, MCP
33
+ * `CallToolResult` out.
34
+ *
35
+ * The success envelope, the `'Done.'` sentinel for a void result, the order
36
+ * the error arms are tested in, and the `Details:` appendix are all wire
37
+ * facts an agent observes — so they live here once, rather than in two files
38
+ * kept equal by review.
39
+ */
40
+ export declare function createCall(options: CallOptions): <T>(fn: () => Promise<T>) => Promise<CallToolResult>;
41
+ export declare const call: <T>(fn: () => Promise<T>) => Promise<CallToolResult>;
package/dist/call.js CHANGED
@@ -1,24 +1,48 @@
1
1
  import { ErrorType, isShipError } from '@shipstatic/ship';
2
- export async function call(fn) {
3
- try {
4
- const result = await fn();
5
- const text = result === undefined ? 'Done.' : JSON.stringify(result, null, 2);
6
- return { content: [{ type: 'text', text }] };
7
- }
8
- catch (error) {
9
- return handleError(error);
10
- }
2
+ /**
3
+ * Builds the `call()` wrapper both transports use: SDK promise in, MCP
4
+ * `CallToolResult` out.
5
+ *
6
+ * The success envelope, the `'Done.'` sentinel for a void result, the order
7
+ * the error arms are tested in, and the `Details:` appendix are all wire
8
+ * facts an agent observes — so they live here once, rather than in two files
9
+ * kept equal by review.
10
+ */
11
+ export function createCall(options) {
12
+ const { hints, structuredContent = false } = options;
13
+ return async function call(fn) {
14
+ try {
15
+ const result = await fn();
16
+ // A void SDK method has nothing to serialize; every other result is the
17
+ // wire shape verbatim, because an agent reads exactly what the API sent.
18
+ if (result === undefined) {
19
+ return { content: [{ type: 'text', text: 'Done.' }] };
20
+ }
21
+ const text = JSON.stringify(result, null, 2);
22
+ const structured = structuredContent && isPlainObject(result)
23
+ ? result
24
+ : undefined;
25
+ return {
26
+ content: [{ type: 'text', text }],
27
+ ...(structured ? { structuredContent: structured } : {}),
28
+ };
29
+ }
30
+ catch (error) {
31
+ return toErrorResult(error, hints);
32
+ }
33
+ };
34
+ }
35
+ function isPlainObject(value) {
36
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
11
37
  }
12
- function handleError(error) {
38
+ function toErrorResult(error, hints) {
13
39
  if (isShipError(error)) {
14
40
  let message = error.message;
15
41
  if (error.isType(ErrorType.Authentication)) {
16
- message +=
17
- '\n\nHint: Set a free SHIP_TOKEN environment variable in your MCP server configuration.';
42
+ message += `\n\nHint: ${hints.authentication}`;
18
43
  }
19
44
  if (error.isType(ErrorType.Forbidden)) {
20
- message +=
21
- '\n\nHint: This action is not permitted. Likely cause: plan limits reached or the account is terminated. Stop retrying — the user needs to upgrade or contact support at https://my.shipstatic.com.';
45
+ message += `\n\nHint: ${hints.forbidden}`;
22
46
  }
23
47
  if (error.isType(ErrorType.Validation) && error.details) {
24
48
  message += `\n\nDetails: ${safeStringify(error.details)}`;
@@ -42,3 +66,9 @@ function safeStringify(value) {
42
66
  return String(value);
43
67
  }
44
68
  }
69
+ /** stdio's hints: this package owns `SHIP_TOKEN` and is the only side that may name it. */
70
+ const STDIO_HINTS = {
71
+ authentication: 'Set a free SHIP_TOKEN environment variable in your MCP server configuration.',
72
+ forbidden: 'This action is not permitted. Likely cause: plan limits reached or the account is terminated. Stop retrying — the user needs to upgrade or contact support at https://my.shipstatic.com.',
73
+ };
74
+ export const call = createCall({ hints: STDIO_HINTS });
package/dist/index.d.ts CHANGED
@@ -1,2 +1,20 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ /**
2
+ * The library entry — importing this file has NO side effects.
3
+ *
4
+ * That is the whole point of it: `bin.ts` is the executable, and this is what
5
+ * a consumer imports. Today there is exactly one such consumer, the hosted
6
+ * Streamable-HTTP transport in the platform's private `cloudflare/mcp`, which
7
+ * takes the vocabulary below rather than re-authoring the strings an agent
8
+ * reads. "One product, two transports" is only true if one of them can import
9
+ * the other.
10
+ *
11
+ * **The surface is curated, not swept.** Every export here is a deliberate
12
+ * public commitment under semver; the modules behind it hold plenty that is
13
+ * not (`toErrorResult`, `safeStringify`, the INSTRUCTIONS template, every tool
14
+ * registration). `export *` would publish implementation detail and make the
15
+ * next refactor a breaking change. `tests/index.test.ts` fences both
16
+ * directions — nothing missing, nothing extra.
17
+ */
18
+ export { type CallOptions, call, createCall, type ErrorHints } from './call.js';
19
+ export { createServer } from './server.js';
20
+ export { ANNOTATIONS, PARAM_DESCRIPTIONS } from './vocabulary.js';
package/dist/index.js CHANGED
@@ -1,22 +1,20 @@
1
- #!/usr/bin/env node
2
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import Ship from '@shipstatic/ship';
4
- import { createServer } from './server.js';
5
- async function main() {
6
- // SHIP_TOKEN is optional without it, deployments are public (3-day expiry).
7
- // The SDK coerces empty strings to undefined, so we can pass through directly.
8
- //
9
- // One credential slot, any platform token: the value's prefix says what it
10
- // is (`ship-` API key, `deploy-` deploy token, anything else an opaque
11
- // bearer) and the server classifies it. MCP never has to know which kind it
12
- // holds.
13
- const ship = new Ship({ token: process.env.SHIP_TOKEN });
14
- const server = createServer(ship);
15
- const transport = new StdioServerTransport();
16
- await server.connect(transport);
17
- console.error('ShipStatic MCP Server running on stdio');
18
- }
19
- main().catch((error) => {
20
- console.error('Fatal error:', error);
21
- process.exit(1);
22
- });
1
+ /**
2
+ * The library entry — importing this file has NO side effects.
3
+ *
4
+ * That is the whole point of it: `bin.ts` is the executable, and this is what
5
+ * a consumer imports. Today there is exactly one such consumer, the hosted
6
+ * Streamable-HTTP transport in the platform's private `cloudflare/mcp`, which
7
+ * takes the vocabulary below rather than re-authoring the strings an agent
8
+ * reads. "One product, two transports" is only true if one of them can import
9
+ * the other.
10
+ *
11
+ * **The surface is curated, not swept.** Every export here is a deliberate
12
+ * public commitment under semver; the modules behind it hold plenty that is
13
+ * not (`toErrorResult`, `safeStringify`, the INSTRUCTIONS template, every tool
14
+ * registration). `export *` would publish implementation detail and make the
15
+ * next refactor a breaking change. `tests/index.test.ts` fences both
16
+ * directions — nothing missing, nothing extra.
17
+ */
18
+ export { call, createCall } from './call.js';
19
+ export { createServer } from './server.js';
20
+ export { ANNOTATIONS, PARAM_DESCRIPTIONS } from './vocabulary.js';
package/dist/server.d.ts CHANGED
@@ -1,3 +1,11 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type Ship from '@shipstatic/ship';
3
- export declare function createServer(ship: Ship): McpServer;
3
+ /**
4
+ * Builds the stdio server's full 15-tool surface over an injected client.
5
+ *
6
+ * `version` is a parameter rather than something this module reads for itself:
7
+ * the executable knows its own package manifest, a library must not assume it
8
+ * has one, and reaching for `node:module` here would put a Node builtin in the
9
+ * import graph of a module the Workers-hosted transport also loads.
10
+ */
11
+ export declare function createServer(ship: Ship, version: string): McpServer;
package/dist/server.js CHANGED
@@ -1,29 +1,37 @@
1
- import { createRequire } from 'node:module';
2
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
- import { LABEL_CONSTRAINTS, PASSWORD_CONSTRAINTS } from '@shipstatic/ship';
2
+ import { IDEMPOTENCY_KEY_CONSTRAINTS } from '@shipstatic/ship';
4
3
  import { z } from 'zod';
5
4
  import { call } from './call.js';
6
- const { version } = createRequire(import.meta.url)('../package.json');
7
- const OPEN_WORLD = { openWorldHint: true };
8
- const READ = {
9
- readOnlyHint: true,
10
- destructiveHint: false,
11
- idempotentHint: true,
12
- ...OPEN_WORLD,
13
- };
14
- const CREATE = { readOnlyHint: false, destructiveHint: false, ...OPEN_WORLD };
15
- const WRITE = {
16
- readOnlyHint: false,
17
- destructiveHint: false,
18
- idempotentHint: true,
19
- ...OPEN_WORLD,
20
- };
21
- const DESTRUCTIVE = {
22
- readOnlyHint: false,
23
- destructiveHint: true,
24
- idempotentHint: true,
25
- ...OPEN_WORLD,
5
+ import { ANNOTATIONS, PARAM_DESCRIPTIONS } from './vocabulary.js';
6
+ // Destructured so the fifteen registrations below read as they always have.
7
+ // The definitions live in `vocabulary.ts` because the hosted transport speaks
8
+ // the same ones — that file records what is shared, what is not, and why.
9
+ const { READ, CREATE, WRITE, DESTRUCTIVE } = ANNOTATIONS;
10
+ /**
11
+ * The pagination surface, shared by every list tool because it is one
12
+ * contract, not two. A list answers `{<collection>, cursor}` and nothing
13
+ * else `cursor` carries the whole has-more signal and is null on the last
14
+ * page, so there is no `total` to ask for and no has-more boolean.
15
+ *
16
+ * No upper bound is stated here on purpose. The API clamps an unusable
17
+ * `limit` server-side and owns that number; restating a cap in the tool
18
+ * schema would give one fact two owners and let them drift. `min(1)` is not
19
+ * a cap — it rejects a value that could never mean anything.
20
+ */
21
+ const PAGINATION_INPUT = {
22
+ limit: z
23
+ .number()
24
+ .int()
25
+ .min(1)
26
+ .optional()
27
+ .describe('Maximum number of items to return in one page. Omit for the server default.'),
28
+ cursor: z
29
+ .string()
30
+ .optional()
31
+ .describe("Opaque position from the previous response's `cursor` field; omit for the first page."),
26
32
  };
33
+ /** Appended to every list tool's description — the paging contract, stated once. */
34
+ const PAGING_NOTE = " The response's `cursor` is null on the last page; pass it back as `cursor` to fetch the next.";
27
35
  const INSTRUCTIONS = `ShipStatic deploys static websites instantly. Free, no account required.
28
36
 
29
37
  To deploy: call deployments_upload with the build output directory path. The site is live immediately. To make the site private, pass \`password\` — visitors must unlock before viewing, including on any custom domains pointing at it.
@@ -37,7 +45,15 @@ Concepts:
37
45
  - Domain: a custom domain (e.g. www.example.com) pointing to a deployment. Optional. Subdomains only — not apex domains.
38
46
 
39
47
  To add a custom domain: domains_validate → domains_set → domains_records (show DNS records to user) → user configures DNS → domains_verify.`;
40
- export function createServer(ship) {
48
+ /**
49
+ * Builds the stdio server's full 15-tool surface over an injected client.
50
+ *
51
+ * `version` is a parameter rather than something this module reads for itself:
52
+ * the executable knows its own package manifest, a library must not assume it
53
+ * has one, and reaching for `node:module` here would put a Node builtin in the
54
+ * import graph of a module the Workers-hosted transport also loads.
55
+ */
56
+ export function createServer(ship, version) {
41
57
  const server = new McpServer({
42
58
  name: 'shipstatic',
43
59
  version,
@@ -52,20 +68,19 @@ export function createServer(ship) {
52
68
  path: z
53
69
  .string()
54
70
  .describe('Absolute path to the build output directory to deploy (e.g. "/Users/me/project/dist")'),
55
- labels: z
56
- .array(z.string())
57
- .optional()
58
- .describe(`Labels for organizing deployments (e.g. ["production", "v1.2"]). Lowercase, ${LABEL_CONSTRAINTS.MIN_LENGTH}-${LABEL_CONSTRAINTS.MAX_LENGTH} chars, allows . _ - separators.`),
59
- password: z
71
+ labels: z.array(z.string()).optional().describe(PARAM_DESCRIPTIONS.labels),
72
+ password: z.string().optional().describe(PARAM_DESCRIPTIONS.password),
73
+ idempotencyKey: z
60
74
  .string()
61
75
  .optional()
62
- .describe(`Optional password to gate the deployment behind an unlock prompt (${PASSWORD_CONSTRAINTS.MIN_LENGTH}–${PASSWORD_CONSTRAINTS.MAX_LENGTH} characters; whitespace significant). Visitors must enter this password before viewing the site, including on any custom domains pointing at it.`),
76
+ .describe(`Makes this deploy replayable instead of repeatable. A deploy is not naturally idempotent: if a call times out you cannot tell "it never landed" from "it landed and the response was lost", and retrying creates a second deployment. Send the same key on the retry and the original deployment is replayed instead (within ${IDEMPOTENCY_KEY_CONSTRAINTS.WINDOW_SECONDS / 3600} hours). Key the ATTEMPT a run id, a commit sha, a uuid minted before the first try — never one minted fresh on each retry, which would defeat the point.`),
63
77
  },
64
- }, ({ path, labels, password }) => call(() => ship.deployments.upload(path, { labels, password, via: 'mcp' })));
78
+ }, ({ path, labels, password, idempotencyKey }) => call(() => ship.deployments.upload(path, { labels, password, idempotencyKey, via: 'mcp' })));
65
79
  server.registerTool('deployments_list', {
66
- description: 'List all deployments with their URLs, status, labels, and password protection state.',
80
+ description: `List all deployments with their URLs, status, labels, and password protection state.${PAGING_NOTE}`,
67
81
  annotations: READ,
68
- }, () => call(() => ship.deployments.list()));
82
+ inputSchema: PAGINATION_INPUT,
83
+ }, ({ limit, cursor }) => call(() => ship.deployments.list({ limit, cursor })));
69
84
  server.registerTool('deployments_get', {
70
85
  description: 'Get deployment details including URL, status, file count, size, labels, and password protection state.',
71
86
  annotations: READ,
@@ -113,9 +128,10 @@ export function createServer(ship) {
113
128
  },
114
129
  }, ({ domain, deployment, labels }) => call(() => ship.domains.set(domain, { deployment, labels })));
115
130
  server.registerTool('domains_list', {
116
- description: 'List all domains with their URLs, linked deployment, and verification status.',
131
+ description: `List all domains with their URLs, linked deployment, and verification status.${PAGING_NOTE}`,
117
132
  annotations: READ,
118
- }, () => call(() => ship.domains.list()));
133
+ inputSchema: PAGINATION_INPUT,
134
+ }, ({ limit, cursor }) => call(() => ship.domains.list({ limit, cursor })));
119
135
  server.registerTool('domains_get', {
120
136
  description: 'Get domain details including URL, linked deployment, verification status, and labels.',
121
137
  annotations: READ,
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The vocabulary both transports speak.
3
+ *
4
+ * `@shipstatic/mcp` (stdio) and the hosted Streamable-HTTP server are one
5
+ * product with two doors in. Everything an agent observes that is NOT forced
6
+ * apart by the transport lives here and is IMPORTED by both — because a fact
7
+ * with two owners is a fact that drifts. This pair kept ten such strings
8
+ * byte-identical by hand for a year, and the hand slipped: a tool description
9
+ * diverged unnoticed, a one-word correction had to be applied at three sites,
10
+ * and a test mock invented constraint numbers production never used. A
11
+ * coordination table written in prose is a specification for drift, not a
12
+ * defence against it.
13
+ *
14
+ * What belongs here: anything true of a ShipStatic deploy regardless of how
15
+ * the bytes arrived. What does not, and why:
16
+ *
17
+ * - **The file-input schema.** A filesystem path here, inline content there:
18
+ * Workers has no filesystem. Structurally forced apart.
19
+ * - **Tool descriptions.** Deliberately rewritten hosted-side for an
20
+ * Apps-SDK caller that must be told not to base64-encode text — a failure
21
+ * mode the filesystem path does not have.
22
+ * - **Anything Apps-SDK** (widget, `_meta`, `outputSchema`): hosted-only by
23
+ * nature.
24
+ *
25
+ * Each of those is recorded in `cloudflare/mcp/CLAUDE.md`'s divergence table.
26
+ * Everything else should be here, and adding a shared fact anywhere else is
27
+ * how the next year's drift starts.
28
+ */
29
+ /**
30
+ * MCP tool annotations by kind of operation. An agent reads these to decide
31
+ * whether it may call speculatively (`readOnlyHint`), whether a retry is free
32
+ * (`idempotentHint`), and whether it must confirm with the user first
33
+ * (`destructiveHint`).
34
+ *
35
+ * **`CREATE` carries no `idempotentHint`, deliberately.** A deploy creates a
36
+ * new deployment on every call. `idempotencyKey` makes a retry replay the
37
+ * original instead — but that property is conditional on an argument the
38
+ * caller may not pass, while the annotation is static per tool. Advertising it
39
+ * would promise every agent that any retry is free, which is exactly false for
40
+ * the keyless caller, and an annotation an agent trusts wrongly is worse than
41
+ * one it never reads.
42
+ */
43
+ export declare const ANNOTATIONS: {
44
+ readonly READ: {
45
+ readonly openWorldHint: true;
46
+ readonly readOnlyHint: true;
47
+ readonly destructiveHint: false;
48
+ readonly idempotentHint: true;
49
+ };
50
+ readonly CREATE: {
51
+ readonly openWorldHint: true;
52
+ readonly readOnlyHint: false;
53
+ readonly destructiveHint: false;
54
+ };
55
+ readonly WRITE: {
56
+ readonly openWorldHint: true;
57
+ readonly readOnlyHint: false;
58
+ readonly destructiveHint: false;
59
+ readonly idempotentHint: true;
60
+ };
61
+ readonly DESTRUCTIVE: {
62
+ readonly openWorldHint: true;
63
+ readonly readOnlyHint: false;
64
+ readonly destructiveHint: true;
65
+ readonly idempotentHint: true;
66
+ };
67
+ };
68
+ /**
69
+ * Deploy-parameter descriptions shared by both transports.
70
+ *
71
+ * The numbers interpolate from `@shipstatic/types` rather than being written
72
+ * out, so a platform constraint change reaches every agent-facing string
73
+ * without anyone editing prose — the same reason the API and the SDK import
74
+ * them instead of restating them.
75
+ */
76
+ export declare const PARAM_DESCRIPTIONS: {
77
+ readonly labels: "Labels for organizing deployments (e.g. [\"production\", \"v1.2\"]). Lowercase, 3-25 chars, allows . _ - separators. Up to 10.";
78
+ readonly password: "Optional password to gate the deployment behind an unlock prompt (6–128 characters; whitespace significant). Visitors must enter this password before viewing the site, including on any custom domains pointing at it.";
79
+ };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The vocabulary both transports speak.
3
+ *
4
+ * `@shipstatic/mcp` (stdio) and the hosted Streamable-HTTP server are one
5
+ * product with two doors in. Everything an agent observes that is NOT forced
6
+ * apart by the transport lives here and is IMPORTED by both — because a fact
7
+ * with two owners is a fact that drifts. This pair kept ten such strings
8
+ * byte-identical by hand for a year, and the hand slipped: a tool description
9
+ * diverged unnoticed, a one-word correction had to be applied at three sites,
10
+ * and a test mock invented constraint numbers production never used. A
11
+ * coordination table written in prose is a specification for drift, not a
12
+ * defence against it.
13
+ *
14
+ * What belongs here: anything true of a ShipStatic deploy regardless of how
15
+ * the bytes arrived. What does not, and why:
16
+ *
17
+ * - **The file-input schema.** A filesystem path here, inline content there:
18
+ * Workers has no filesystem. Structurally forced apart.
19
+ * - **Tool descriptions.** Deliberately rewritten hosted-side for an
20
+ * Apps-SDK caller that must be told not to base64-encode text — a failure
21
+ * mode the filesystem path does not have.
22
+ * - **Anything Apps-SDK** (widget, `_meta`, `outputSchema`): hosted-only by
23
+ * nature.
24
+ *
25
+ * Each of those is recorded in `cloudflare/mcp/CLAUDE.md`'s divergence table.
26
+ * Everything else should be here, and adding a shared fact anywhere else is
27
+ * how the next year's drift starts.
28
+ */
29
+ import { LABEL_CONSTRAINTS, PASSWORD_CONSTRAINTS } from '@shipstatic/ship';
30
+ const OPEN_WORLD = { openWorldHint: true };
31
+ /**
32
+ * MCP tool annotations by kind of operation. An agent reads these to decide
33
+ * whether it may call speculatively (`readOnlyHint`), whether a retry is free
34
+ * (`idempotentHint`), and whether it must confirm with the user first
35
+ * (`destructiveHint`).
36
+ *
37
+ * **`CREATE` carries no `idempotentHint`, deliberately.** A deploy creates a
38
+ * new deployment on every call. `idempotencyKey` makes a retry replay the
39
+ * original instead — but that property is conditional on an argument the
40
+ * caller may not pass, while the annotation is static per tool. Advertising it
41
+ * would promise every agent that any retry is free, which is exactly false for
42
+ * the keyless caller, and an annotation an agent trusts wrongly is worse than
43
+ * one it never reads.
44
+ */
45
+ export const ANNOTATIONS = {
46
+ READ: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, ...OPEN_WORLD },
47
+ CREATE: { readOnlyHint: false, destructiveHint: false, ...OPEN_WORLD },
48
+ WRITE: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, ...OPEN_WORLD },
49
+ DESTRUCTIVE: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, ...OPEN_WORLD },
50
+ };
51
+ /**
52
+ * Deploy-parameter descriptions shared by both transports.
53
+ *
54
+ * The numbers interpolate from `@shipstatic/types` rather than being written
55
+ * out, so a platform constraint change reaches every agent-facing string
56
+ * without anyone editing prose — the same reason the API and the SDK import
57
+ * them instead of restating them.
58
+ */
59
+ export const PARAM_DESCRIPTIONS = {
60
+ labels: `Labels for organizing deployments (e.g. ["production", "v1.2"]). Lowercase, ${LABEL_CONSTRAINTS.MIN_LENGTH}-${LABEL_CONSTRAINTS.MAX_LENGTH} chars, allows . _ - separators. Up to ${LABEL_CONSTRAINTS.MAX_COUNT}.`,
61
+ password: `Optional password to gate the deployment behind an unlock prompt (${PASSWORD_CONSTRAINTS.MIN_LENGTH}–${PASSWORD_CONSTRAINTS.MAX_LENGTH} characters; whitespace significant). Visitors must enter this password before viewing the site, including on any custom domains pointing at it.`,
62
+ };
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@shipstatic/mcp",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.2",
4
4
  "mcpName": "com.shipstatic/mcp",
5
5
  "description": "ShipStatic MCP — deploy static websites from AI agents. Full toolset incl. custom domains. Free hosted endpoint at mcp.shipstatic.com — no install.",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
9
16
  "bin": {
10
- "shipstatic-mcp": "./dist/index.js"
17
+ "shipstatic-mcp": "./dist/bin.js"
11
18
  },
12
19
  "scripts": {
13
20
  "build": "tsc",