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 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. Create a `.env` file in your project root:
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
- 2. Add MCP configuration (Cursor Settings → MCP):
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": "sh",
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 not `npx`?** npm's `npx -y` outputs package installation info to stdout, which conflicts with MCP's stdio protocol. The shell wrapper auto-installs silently and keeps stdout clean.
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 shell wrapper config** in Quick Start instead.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-cos-upload",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "MCP server for uploading files to Tencent Cloud COS",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -56,7 +56,7 @@ const cosUploadInputSchema = {
56
56
 
57
57
  async function main() {
58
58
  const server = new Server(
59
- { name: "mcp-cos-upload", version: "1.1.2" },
59
+ { name: "mcp-cos-upload", version: "1.1.5" },
60
60
  { capabilities: { tools: {} } }
61
61
  );
62
62