mcp-inflight 0.2.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/README.md +107 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1711 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# @inflight/mcp-sandbox
|
|
2
|
+
|
|
3
|
+
MCP server for sharing local prototypes via public URLs using CodeSandbox.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
This MCP server provides a `share` tool that:
|
|
8
|
+
|
|
9
|
+
1. Takes a local project directory
|
|
10
|
+
2. Uploads it to a CodeSandbox VM
|
|
11
|
+
3. Installs dependencies and starts the dev server
|
|
12
|
+
4. Returns a public URL where the app is running
|
|
13
|
+
|
|
14
|
+
Supports React, Next.js, Vite, Node.js, and static HTML projects.
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
### 1. Get a CodeSandbox API Key
|
|
19
|
+
|
|
20
|
+
1. Go to https://codesandbox.io and sign in (or create account)
|
|
21
|
+
2. Navigate to https://codesandbox.io/t/api
|
|
22
|
+
3. Click "Create Token"
|
|
23
|
+
4. Copy the token
|
|
24
|
+
|
|
25
|
+
### 2. Configure Claude Code
|
|
26
|
+
|
|
27
|
+
Add to your Claude Code MCP config (`~/.claude/claude_code_config.json`):
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"sandbox": {
|
|
33
|
+
"command": "node",
|
|
34
|
+
"args": ["/path/to/inflight/packages/mcp-sandbox/dist/index.js"],
|
|
35
|
+
"env": {
|
|
36
|
+
"CSB_API_KEY": "your-api-key-here"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or if published to npm:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"mcpServers": {
|
|
48
|
+
"sandbox": {
|
|
49
|
+
"command": "npx",
|
|
50
|
+
"args": ["@inflight/mcp-sandbox"],
|
|
51
|
+
"env": {
|
|
52
|
+
"CSB_API_KEY": "your-api-key-here"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
Once configured, Claude Code can share prototypes:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
User: "Share this React app"
|
|
65
|
+
|
|
66
|
+
Claude: I'll share your project to get a public URL.
|
|
67
|
+
|
|
68
|
+
[Calls share tool]
|
|
69
|
+
|
|
70
|
+
Your project is live at: https://abc123-3000.csb.app
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Tool: share
|
|
74
|
+
|
|
75
|
+
### Parameters
|
|
76
|
+
|
|
77
|
+
| Parameter | Type | Required | Description |
|
|
78
|
+
|-----------|------|----------|-------------|
|
|
79
|
+
| `path` | string | Yes | Absolute path to the project directory |
|
|
80
|
+
| `port` | number | No | Port the dev server runs on (auto-detected) |
|
|
81
|
+
| `command` | string | No | Custom start command (overrides auto-detection) |
|
|
82
|
+
|
|
83
|
+
### Project Type Detection
|
|
84
|
+
|
|
85
|
+
The tool automatically detects project types:
|
|
86
|
+
|
|
87
|
+
- **Next.js**: Has `next` in dependencies → port 3000, `npm run dev`
|
|
88
|
+
- **Vite**: Has `vite` in dependencies → port 5173, `npm run dev`
|
|
89
|
+
- **Create React App**: Has `react-scripts` → port 3000, `npm start`
|
|
90
|
+
- **Node.js**: Has `express`/`fastify`/etc → port 3000, `npm start`
|
|
91
|
+
- **Static**: Has `index.html` without package.json → port 3000, `npx serve .`
|
|
92
|
+
|
|
93
|
+
## Development
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Install dependencies
|
|
97
|
+
pnpm install
|
|
98
|
+
|
|
99
|
+
# Build
|
|
100
|
+
pnpm build
|
|
101
|
+
|
|
102
|
+
# Type check
|
|
103
|
+
pnpm typecheck
|
|
104
|
+
|
|
105
|
+
# Watch mode
|
|
106
|
+
pnpm dev
|
|
107
|
+
```
|
package/dist/index.d.ts
ADDED