@storage4everyone/mcp 0.2.0 → 0.2.1
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/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,10 @@ import { Storage4Everyone } from '@storage4everyone/sdk';
|
|
|
5
5
|
import { createServer } from './server.js';
|
|
6
6
|
import { loadEnvFiles } from './env.js';
|
|
7
7
|
// stdout carries the MCP protocol; all diagnostics go to stderr.
|
|
8
|
-
|
|
8
|
+
// Claude Code passes the project folder in CLAUDE_PROJECT_DIR and may start servers elsewhere;
|
|
9
|
+
// other agents (VS Code, Gemini CLI) start them in the project folder.
|
|
10
|
+
const project = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
11
|
+
const rootSetting = process.env.S4E_MCP_ROOT || project;
|
|
9
12
|
let root;
|
|
10
13
|
try {
|
|
11
14
|
root = await realpath(rootSetting);
|
|
@@ -14,8 +17,6 @@ catch {
|
|
|
14
17
|
console.error(`S4E_MCP_ROOT folder not found: ${rootSetting}. Create it or set S4E_MCP_ROOT to an existing folder.`);
|
|
15
18
|
process.exit(1);
|
|
16
19
|
}
|
|
17
|
-
// The agent app starts the server in the project folder, so its .env files can supply the key.
|
|
18
|
-
const project = process.cwd();
|
|
19
20
|
const envFiles = await loadEnvFiles(project);
|
|
20
21
|
if (!process.env.S4E_API_KEY) {
|
|
21
22
|
console.error(`S4E_API_KEY is not set. Add S4E_API_KEY=s4e_live_... to .env.local in ${project}, or pass it in the MCP server env. ` +
|
package/package.json
CHANGED