mcp-cos-upload 1.1.5 → 1.1.6
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 +30 -6
- package/package.json +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,13 @@ After publishing, team members can use it immediately (see Quick Start below).
|
|
|
37
37
|
|
|
38
38
|
#### Method 1: Project `.env` File (Recommended)
|
|
39
39
|
|
|
40
|
-
1.
|
|
40
|
+
1. Install once:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm i -g mcp-cos-upload
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. Create a `.env` file in your project root:
|
|
41
47
|
|
|
42
48
|
```bash
|
|
43
49
|
# Copy the template
|
|
@@ -54,20 +60,21 @@ COS_KEY_PREFIX=figma-assets
|
|
|
54
60
|
COS_CDN_DOMAIN=cdn.example.com
|
|
55
61
|
```
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
3. Add MCP configuration (Cursor Settings → MCP):
|
|
58
64
|
|
|
59
65
|
```json
|
|
60
66
|
{
|
|
61
67
|
"mcpServers": {
|
|
62
68
|
"mcp-cos-upload": {
|
|
63
|
-
"command": "
|
|
64
|
-
"args": ["-c", "command -v mcp-cos-upload >/dev/null 2>&1 || npm i -g mcp-cos-upload >/dev/null 2>&1; exec mcp-cos-upload"]
|
|
69
|
+
"command": "mcp-cos-upload"
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
```
|
|
69
74
|
|
|
70
|
-
> **Why
|
|
75
|
+
> **Why this is recommended:** MCP startup stays short and predictable. The server only executes the installed binary and does not run npm during startup.
|
|
76
|
+
|
|
77
|
+
> **Why not `npx`?** npm's `npx -y` outputs package installation info to stdout, which conflicts with MCP's stdio protocol.
|
|
71
78
|
|
|
72
79
|
> **Note:** The `.env` file contains secrets — never commit it. Use `.env.example` as a reference template.
|
|
73
80
|
|
|
@@ -82,6 +89,23 @@ It does **not** read:
|
|
|
82
89
|
|
|
83
90
|
Project root is inferred from the current working directory by walking upward and finding common project markers such as `.git`, `package.json`, `pnpm-workspace.yaml`, `.cursor`, or `.mcp.json`. After the root is determined, only that single `.env` file is read.
|
|
84
91
|
|
|
92
|
+
#### Method 2: Auto-Install On First Run (Optional)
|
|
93
|
+
|
|
94
|
+
Use this only if you explicitly want convenience over startup stability:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"mcp-cos-upload": {
|
|
100
|
+
"command": "sh",
|
|
101
|
+
"args": ["-c", "command -v mcp-cos-upload >/dev/null 2>&1 || npm i -g mcp-cos-upload >/dev/null 2>&1; exec mcp-cos-upload"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
This mode installs automatically only when the command is missing. It does **not** auto-update an already installed version.
|
|
108
|
+
|
|
85
109
|
### Environment Variables
|
|
86
110
|
|
|
87
111
|
| Variable | Required | Description |
|
|
@@ -245,7 +269,7 @@ Compression is enabled by default. Use `compress: false` to upload original file
|
|
|
245
269
|
|
|
246
270
|
### `Unexpected token` / JSON parse error on startup
|
|
247
271
|
|
|
248
|
-
This happens when using `npx -y mcp-cos-upload` directly — npm outputs package installation info to stdout, breaking MCP's stdio protocol. **Use the recommended
|
|
272
|
+
This happens when using `npx -y mcp-cos-upload` directly — npm outputs package installation info to stdout, breaking MCP's stdio protocol. **Use the recommended direct command config** in Quick Start instead.
|
|
249
273
|
|
|
250
274
|
### Missing COS_SECRET_ID or COS_SECRET_KEY
|
|
251
275
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED