@stratta/mcp 0.9.2 → 0.9.3

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.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/dist/login.js +33 -17
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -27,9 +27,13 @@ MCP server exposing Swiss engineering norms (SIA / Eurocodes) to Claude clients
27
27
  Add the server — no key needed up front:
28
28
 
29
29
  ```bash
30
- claude mcp add stratta -- npx -y @stratta/mcp
30
+ claude mcp add stratta --scope user -- npx -y @stratta/mcp
31
31
  ```
32
32
 
33
+ `--scope user` registers it for your user, so the tools are there in every
34
+ project. Without it, `claude mcp add` writes to the current folder's config and
35
+ the server exists nowhere else.
36
+
33
37
  Then sign in. This opens stratta.ch in your browser, where you confirm which
34
38
  machine and organisation to authorise; the key comes back to the terminal on
35
39
  its own and is saved to `~/.stratta/config.json` (owner-only, `0600`). You
package/dist/login.js CHANGED
@@ -35,15 +35,31 @@ function promptSecret(query) {
35
35
  * SSH sessions have no browser, so the caller always prints the URL too.
36
36
  */
37
37
  function openBrowser(url) {
38
- const [cmd, args] = process.platform === 'win32'
39
- ? // `start` is a cmd builtin, not an executable, and it treats the first
40
- // quoted argument as a window title — hence the empty one.
41
- ['cmd', ['/c', 'start', '', url]]
42
- : process.platform === 'darwin'
43
- ? ['open', [url]]
44
- : ['xdg-open', [url]];
45
38
  try {
46
- const child = spawn(cmd, args, { stdio: 'ignore', detached: true });
39
+ if (process.platform === 'win32') {
40
+ /**
41
+ * `&` is a command separator in cmd.exe, and this URL always has two of
42
+ * them (`state`, `label`). Passing the URL as an ordinary argument let
43
+ * cmd re-parse it: the browser opened on `…/cli-auth?port=61324`, the
44
+ * page reported an invalid link because `state` was missing, and cmd
45
+ * tried to run the rest as commands.
46
+ *
47
+ * `windowsVerbatimArguments` stops Node from rewriting the arguments,
48
+ * so cmd receives the quotes we wrote and treats what is inside as one
49
+ * token. `start` reads the first quoted argument as a window title,
50
+ * hence the empty pair before the URL.
51
+ */
52
+ const child = spawn('cmd.exe', ['/c', 'start', '""', `"${url}"`], {
53
+ stdio: 'ignore',
54
+ detached: true,
55
+ windowsVerbatimArguments: true,
56
+ });
57
+ child.on('error', () => { });
58
+ child.unref();
59
+ return;
60
+ }
61
+ const cmd = process.platform === 'darwin' ? 'open' : 'xdg-open';
62
+ const child = spawn(cmd, [url], { stdio: 'ignore', detached: true });
47
63
  child.on('error', () => { });
48
64
  child.unref();
49
65
  }
@@ -52,15 +68,15 @@ function openBrowser(url) {
52
68
  }
53
69
  }
54
70
  function page(title, body) {
55
- return `<!doctype html><html lang="fr"><meta charset="utf-8">
56
- <title>${title}</title>
57
- <style>
58
- body{font:16px/1.6 ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
59
- background:#12110f;color:#f5f1e8;display:grid;place-items:center;
60
- min-height:100vh;margin:0;padding:2rem;text-align:center}
61
- .c{max-width:26rem} h1{font-size:1.25rem;margin:0 0 .5rem}
62
- p{margin:0;color:#a8a196}
63
- </style>
71
+ return `<!doctype html><html lang="fr"><meta charset="utf-8">
72
+ <title>${title}</title>
73
+ <style>
74
+ body{font:16px/1.6 ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
75
+ background:#12110f;color:#f5f1e8;display:grid;place-items:center;
76
+ min-height:100vh;margin:0;padding:2rem;text-align:center}
77
+ .c{max-width:26rem} h1{font-size:1.25rem;margin:0 0 .5rem}
78
+ p{margin:0;color:#a8a196}
79
+ </style>
64
80
  <div class="c"><h1>${title}</h1><p>${body}</p></div>`;
65
81
  }
66
82
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stratta/mcp",
3
3
  "mcpName": "ch.stratta/mcp",
4
- "version": "0.9.2",
4
+ "version": "0.9.3",
5
5
  "description": "MCP server exposing the engineering norms your firm is licensed for (SIA / Eurocodes) to any MCP client, via Stratta TreeRAG.",
6
6
  "license": "UNLICENSED",
7
7
  "author": "SmartFlow <hello@stratta.ch>",