@tenonhq/dovetail-mcp 0.0.5 → 0.0.7

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.
@@ -0,0 +1 @@
1
+ export declare function loadEnvFile(argv?: string[]): void;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.loadEnvFile = loadEnvFile;
7
+ const dotenv_1 = __importDefault(require("dotenv"));
8
+ const path_1 = __importDefault(require("path"));
9
+ /**
10
+ * Loads integration credentials for the dovetail-mcp stdio server.
11
+ *
12
+ * MCP hosts normally inject env vars through the server's launch config, but a
13
+ * `--env <path>` argument (or the `DOVETAIL_ENV_FILE` env var) lets a host point
14
+ * the server at a specific credential file instead — so one machine can run the
15
+ * server against multiple instances by varying the file.
16
+ *
17
+ * Resolution order: `--env`/`--env-file` argv flag → DOVETAIL_ENV_FILE → cwd .env.
18
+ * dotenv never overrides variables already present in process.env, so a host's
19
+ * injected env always wins over the file.
20
+ */
21
+ function parseEnvFlag(argv) {
22
+ for (var i = 0; i < argv.length; i++) {
23
+ var arg = argv[i];
24
+ var eq = arg.match(/^(--env|--env-file|--envFile)=(.*)$/);
25
+ if (eq && eq[2])
26
+ return eq[2];
27
+ if (arg === "--env" || arg === "--env-file" || arg === "--envFile") {
28
+ var next = argv[i + 1];
29
+ if (typeof next === "string" && next.charAt(0) !== "-")
30
+ return next;
31
+ }
32
+ }
33
+ return undefined;
34
+ }
35
+ function loadEnvFile(argv) {
36
+ var raw = parseEnvFlag(argv || process.argv.slice(2)) || process.env.DOVETAIL_ENV_FILE;
37
+ if (raw) {
38
+ var resolved = path_1.default.isAbsolute(raw) ? raw : path_1.default.resolve(process.cwd(), raw);
39
+ dotenv_1.default.config({ path: resolved });
40
+ return;
41
+ }
42
+ dotenv_1.default.config();
43
+ }
package/dist/server.js CHANGED
@@ -10,6 +10,7 @@ exports.createServer = void 0;
10
10
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
11
11
  const index_1 = require("./index");
12
12
  Object.defineProperty(exports, "createServer", { enumerable: true, get: function () { return index_1.createServer; } });
13
+ const loadEnv_1 = require("./loadEnv");
13
14
  const registry_1 = require("./registry");
14
15
  async function runSmoke() {
15
16
  // List the registered tools and exit. Verifies wiring without a transport.
@@ -27,6 +28,10 @@ async function runStdio() {
27
28
  await server.connect(transport);
28
29
  }
29
30
  async function main() {
31
+ // Load credentials before reading config. `--env <path>` or DOVETAIL_ENV_FILE
32
+ // points the server at a specific file; otherwise the cwd .env is used. A
33
+ // host's injected process.env always wins (dotenv never overrides).
34
+ (0, loadEnv_1.loadEnvFile)();
30
35
  if (process.argv.indexOf("--smoke") !== -1) {
31
36
  await runSmoke();
32
37
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenonhq/dovetail-mcp",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "MCP server exposing read tools for ClickUp / Gmail / Calendar / ServiceNow plus gated ClickUp writes, backed by the Dovetail integration packages.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -22,6 +22,7 @@
22
22
  "@tenonhq/dovetail-google-auth": "^0.0.9",
23
23
  "@tenonhq/dovetail-google-calendar": "^0.0.7",
24
24
  "@tenonhq/dovetail-servicenow": "^0.0.2",
25
+ "dotenv": "^16.3.1",
25
26
  "zod": "^3.23.0"
26
27
  },
27
28
  "devDependencies": {