proton-drive-mcp 1.0.25 → 1.0.26
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 +7 -4
- package/dist/utils/isMainModule.js +18 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { DriveService } from "./services/drive.js";
|
|
7
|
+
import { isMainModule } from "./utils/isMainModule.js";
|
|
7
8
|
import { checkCliAvailable } from "./utils/subprocess.js";
|
|
8
9
|
import { DriveCliNotFoundError, DriveCliError, DriveNotAuthenticatedError, DriveParseError, } from "./utils/errors.js";
|
|
9
10
|
import { validateRemotePath, validateLocalPath, validateEmail, validateMessage } from "./utils/validation.js";
|
|
@@ -822,7 +823,9 @@ export async function main() {
|
|
|
822
823
|
await server.connect(transport);
|
|
823
824
|
logger.info(`proton-drive-mcp v${VERSION} running`);
|
|
824
825
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
826
|
+
if (isMainModule(import.meta.url)) {
|
|
827
|
+
main().catch((err) => {
|
|
828
|
+
logger.error("Fatal:", err);
|
|
829
|
+
process.exit(1);
|
|
830
|
+
});
|
|
831
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
/**
|
|
3
|
+
* Returns true when this module is the direct entry point (i.e. the script
|
|
4
|
+
* passed to `node`), false when it is being imported as a library.
|
|
5
|
+
*
|
|
6
|
+
* Equivalent to `require.main === module` in CommonJS.
|
|
7
|
+
*/
|
|
8
|
+
export function isMainModule(importMetaUrl) {
|
|
9
|
+
const entryPoint = process.argv[1];
|
|
10
|
+
if (!entryPoint)
|
|
11
|
+
return false;
|
|
12
|
+
try {
|
|
13
|
+
return fileURLToPath(importMetaUrl) === entryPoint;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proton-drive-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "MCP server and CLI that gives Claude full access to Proton Drive — upload, download, share, and manage your end-to-end encrypted files without leaving the conversation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
+
"./services/drive": "./dist/services/drive.js",
|
|
9
10
|
"./package.json": "./package.json"
|
|
10
11
|
},
|
|
11
12
|
"bin": {
|