@shipstatic/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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 shipstatic
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,53 @@
1
+ # @shipstatic/mcp
2
+
3
+ MCP server for [Shipstatic](https://shipstatic.com) — deploy and manage static sites from AI agents.
4
+
5
+ Works with Claude Code, Cursor, VS Code Copilot, and any MCP-compatible client.
6
+
7
+ ## Setup
8
+
9
+ Add to your MCP client configuration:
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "shipstatic": {
15
+ "command": "npx",
16
+ "args": ["@shipstatic/mcp"],
17
+ "env": {
18
+ "SHIP_API_KEY": "ship-..."
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ Get your API key at [my.shipstatic.com](https://my.shipstatic.com).
26
+
27
+ ## Tools
28
+
29
+ ### Deployments
30
+
31
+ | Tool | Description |
32
+ |------|-------------|
33
+ | `deployments_upload` | Upload deployment from directory |
34
+ | `deployments_list` | List all deployments |
35
+ | `deployments_get` | Show deployment information |
36
+ | `deployments_set` | Set deployment labels |
37
+ | `deployments_remove` | Delete deployment permanently |
38
+
39
+ ### Domains
40
+
41
+ | Tool | Description |
42
+ |------|-------------|
43
+ | `domains_set` | Create domain, link to deployment, or update labels |
44
+ | `domains_list` | List all domains |
45
+ | `domains_get` | Show domain information |
46
+ | `domains_records` | Get required DNS records for a domain |
47
+ | `domains_validate` | Check if domain name is valid and available |
48
+ | `domains_verify` | Trigger DNS verification for external domain |
49
+ | `domains_remove` | Delete domain permanently |
50
+
51
+ ## License
52
+
53
+ MIT
package/dist/call.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare function call<T>(fn: () => Promise<T>): Promise<CallToolResult>;
package/dist/call.js ADDED
@@ -0,0 +1,33 @@
1
+ import { isShipError, ErrorType } from '@shipstatic/ship';
2
+ export async function call(fn) {
3
+ try {
4
+ const result = await fn();
5
+ const text = result === undefined
6
+ ? 'Done.'
7
+ : JSON.stringify(result, null, 2);
8
+ return { content: [{ type: 'text', text }] };
9
+ }
10
+ catch (error) {
11
+ return handleError(error);
12
+ }
13
+ }
14
+ function handleError(error) {
15
+ if (isShipError(error)) {
16
+ let message = error.message;
17
+ if (error.isType(ErrorType.Authentication)) {
18
+ message += '\n\nHint: Set the SHIP_API_KEY environment variable in your MCP server configuration.';
19
+ }
20
+ if (error.isType(ErrorType.Validation) && error.details) {
21
+ message += `\n\nDetails: ${JSON.stringify(error.details)}`;
22
+ }
23
+ return {
24
+ content: [{ type: 'text', text: message }],
25
+ isError: true,
26
+ };
27
+ }
28
+ const fallback = error instanceof Error ? error.message : 'An unexpected error occurred';
29
+ return {
30
+ content: [{ type: 'text', text: fallback }],
31
+ isError: true,
32
+ };
33
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createServer } from './server.js';
4
+ if (process.stdin.isTTY) {
5
+ console.error('Shipstatic MCP server v0.1.0');
6
+ console.error('This is a stdio server for MCP clients.\n');
7
+ console.error('Add to your MCP client config:\n');
8
+ console.error(JSON.stringify({
9
+ mcpServers: {
10
+ shipstatic: {
11
+ command: 'npx',
12
+ args: ['@shipstatic/mcp'],
13
+ env: { SHIP_API_KEY: 'ship-...' },
14
+ },
15
+ },
16
+ }, null, 2));
17
+ process.exit(0);
18
+ }
19
+ const server = createServer();
20
+ const transport = new StdioServerTransport();
21
+ await server.connect(transport);
@@ -0,0 +1,3 @@
1
+ import Ship from '@shipstatic/ship';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ export declare function createServer(ship?: Ship): McpServer;
package/dist/server.js ADDED
@@ -0,0 +1,102 @@
1
+ import Ship from '@shipstatic/ship';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ import { call } from './call.js';
5
+ const OPEN_WORLD = { openWorldHint: true };
6
+ const READ = { readOnlyHint: true, idempotentHint: true, ...OPEN_WORLD };
7
+ const WRITE = { idempotentHint: true, ...OPEN_WORLD };
8
+ const DESTRUCTIVE = { destructiveHint: true, idempotentHint: true, ...OPEN_WORLD };
9
+ export function createServer(ship = new Ship()) {
10
+ const server = new McpServer({
11
+ name: 'shipstatic',
12
+ version: '0.1.0',
13
+ }, {
14
+ instructions: 'Deploy a static site to Shipstatic and link it to your domain. To deploy, call deployments_upload with the path to your build output directory. To set up a custom domain, first call domains_validate to check the name, then domains_set to link it to a deployment, then domains_records to get the required DNS records. After DNS is configured, call domains_verify to trigger verification.',
15
+ });
16
+ // Deployments
17
+ server.registerTool('deployments_upload', {
18
+ description: 'Upload deployment from directory',
19
+ annotations: OPEN_WORLD,
20
+ inputSchema: {
21
+ path: z.string().describe('Absolute path to directory or file to deploy'),
22
+ subdomain: z.string().optional().describe('Suggested subdomain'),
23
+ labels: z.array(z.string()).optional().describe('Labels'),
24
+ },
25
+ }, ({ path, subdomain, labels }) => call(() => ship.deployments.upload(path, { subdomain, labels, via: 'mcp' })));
26
+ server.registerTool('deployments_list', {
27
+ description: 'List all deployments',
28
+ annotations: READ,
29
+ }, () => call(() => ship.deployments.list()));
30
+ server.registerTool('deployments_get', {
31
+ description: 'Show deployment information',
32
+ annotations: READ,
33
+ inputSchema: {
34
+ deployment: z.string().describe('Deployment ID (e.g. "happy-cat-abc1234")'),
35
+ },
36
+ }, ({ deployment }) => call(() => ship.deployments.get(deployment)));
37
+ server.registerTool('deployments_set', {
38
+ description: 'Set deployment labels',
39
+ annotations: WRITE,
40
+ inputSchema: {
41
+ deployment: z.string().describe('Deployment ID'),
42
+ labels: z.array(z.string()).describe('New labels for the deployment'),
43
+ },
44
+ }, ({ deployment, labels }) => call(() => ship.deployments.set(deployment, { labels })));
45
+ server.registerTool('deployments_remove', {
46
+ description: 'Delete deployment permanently',
47
+ annotations: DESTRUCTIVE,
48
+ inputSchema: {
49
+ deployment: z.string().describe('Deployment ID to delete'),
50
+ },
51
+ }, ({ deployment }) => call(() => ship.deployments.remove(deployment)));
52
+ // Domains
53
+ server.registerTool('domains_set', {
54
+ description: 'Create domain, link to deployment, or update labels',
55
+ annotations: WRITE,
56
+ inputSchema: {
57
+ domain: z.string().describe('Domain name (e.g. "www.example.com" or "blog.example.com")'),
58
+ deployment: z.string().optional().describe('Deployment ID to link to this domain'),
59
+ labels: z.array(z.string()).optional().describe('Labels'),
60
+ },
61
+ }, ({ domain, deployment, labels }) => call(() => ship.domains.set(domain, { deployment, labels })));
62
+ server.registerTool('domains_list', {
63
+ description: 'List all domains',
64
+ annotations: READ,
65
+ }, () => call(() => ship.domains.list()));
66
+ server.registerTool('domains_get', {
67
+ description: 'Show domain information',
68
+ annotations: READ,
69
+ inputSchema: {
70
+ domain: z.string().describe('Domain name'),
71
+ },
72
+ }, ({ domain }) => call(() => ship.domains.get(domain)));
73
+ server.registerTool('domains_records', {
74
+ description: 'Get required DNS records for a domain',
75
+ annotations: READ,
76
+ inputSchema: {
77
+ domain: z.string().describe('Domain name'),
78
+ },
79
+ }, ({ domain }) => call(() => ship.domains.records(domain)));
80
+ server.registerTool('domains_validate', {
81
+ description: 'Check if domain name is valid and available',
82
+ annotations: READ,
83
+ inputSchema: {
84
+ domain: z.string().describe('Domain name to validate'),
85
+ },
86
+ }, ({ domain }) => call(() => ship.domains.validate(domain)));
87
+ server.registerTool('domains_verify', {
88
+ description: 'Trigger DNS verification for external domain',
89
+ annotations: WRITE,
90
+ inputSchema: {
91
+ domain: z.string().describe('Domain name'),
92
+ },
93
+ }, ({ domain }) => call(() => ship.domains.verify(domain)));
94
+ server.registerTool('domains_remove', {
95
+ description: 'Delete domain permanently',
96
+ annotations: DESTRUCTIVE,
97
+ inputSchema: {
98
+ domain: z.string().describe('Domain name to delete'),
99
+ },
100
+ }, ({ domain }) => call(() => ship.domains.remove(domain)));
101
+ return server;
102
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@shipstatic/mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for Shipstatic — deploy and manage static sites from AI agents",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "shipstatic-mcp": "./dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "keywords": [
16
+ "mcp",
17
+ "shipstatic",
18
+ "model-context-protocol",
19
+ "ai",
20
+ "deploy"
21
+ ],
22
+ "homepage": "https://github.com/shipstatic/mcp",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/shipstatic/mcp.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/shipstatic/mcp/issues"
29
+ },
30
+ "engines": {
31
+ "node": ">=20.0.0"
32
+ },
33
+ "author": "ShipStatic",
34
+ "license": "MIT",
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^1.27.0",
37
+ "@shipstatic/ship": "^0.7.2",
38
+ "zod": "^4.3.6"
39
+ },
40
+ "devDependencies": {
41
+ "@shipstatic/types": "^0.7.1",
42
+ "@types/node": "^20.0.0",
43
+ "typescript": "^5.9.3",
44
+ "vitest": "^3.2.4"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc",
48
+ "clean": "rm -rf dist",
49
+ "test": "vitest"
50
+ }
51
+ }