golutra-mcp 0.1.0 → 0.1.2

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/.env.example CHANGED
@@ -1,5 +1,6 @@
1
- # Optional. If unset, mcp-golutra first tries the macOS app-bundled CLI path
2
- # and then falls back to resolving `golutra-cli` from PATH.
1
+ # Optional. If unset, golutra-mcp first tries platform-specific default
2
+ # install paths for `golutra-cli`, then falls back to the platform command
3
+ # name from PATH (`golutra-cli.exe` on Windows, `golutra-cli` elsewhere).
3
4
  GOLUTRA_CLI_PATH=golutra-cli
4
5
  GOLUTRA_PROFILE=stable
5
6
  GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
package/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format follows Keep a Changelog, and this project uses Semantic Versioning.
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.2] - 2026-03-22
10
+
11
+ ### Changed
12
+
13
+ - Clarified the runtime `workspacePath` contract so per-tool `workspacePath` input is treated as a one-time override, while `golutra-set-context` remains the only way to persist a new default workspace
14
+ - Added regression tests to lock the workspace context behavior at both `ContextStore` level and workspace-aware tool level
15
+ - Expanded README and `STARTUP_PROCESS.md` so AI hosts can understand the recommended runtime flow for diagnostics, workspace switching, and normal tool execution
16
+ - Added `docs/WORKSPACE_CONTEXT_EXAMPLES.md` with concrete examples for stored defaults, one-off workspace overrides, recommended tool order, and a real chat flow
17
+ - Updated the diagnostic examples to explain that a `workspacePath` passed to `golutra-diagnose` affects only that call and does not mutate the stored default context
18
+
19
+ ## [0.1.1] - 2026-03-21
20
+
21
+ ### Changed
22
+
23
+ - Synced `scripts/e2e-smoke.mjs` with the layered `golutra-diagnose` output so self-hosted smoke tests validate the current diagnostic contract
24
+ - Expanded the basic GitHub Actions check workflow to run on Linux, macOS, and Windows so platform-specific regressions surface earlier
25
+ - Included `docs/` in the npm publish file list so packaged users can open the referenced diagnostic example document locally
26
+ - Renamed `startup_processmd.md` to `STARTUP_PROCESS.md` and updated repository links to use a stable public-facing document name
27
+ - Removed stale `mcp-golutra` wording from the bug report template so issue reports match the published package name
28
+ - Stopped hardcoding the MCP server runtime version in source scripts and now read it from `package.json`
29
+
7
30
  ## [0.1.0] - 2026-03-17
8
31
 
9
32
  ### Added
@@ -14,7 +37,7 @@ The format follows Keep a Changelog, and this project uses Semantic Versioning.
14
37
  - `golutra-reset-context` and `golutra-diagnose` for runtime troubleshooting
15
38
  - ESLint, TypeScript, and Vitest based quality gates
16
39
  - CI workflow, contribution guide, security policy, and code of conduct
17
- - Dedicated `startup_processmd.md` for setup/start/build/validation flow
40
+ - Dedicated `STARTUP_PROCESS.md` for setup/start/build/validation flow
18
41
 
19
42
  ### Changed
20
43
 
@@ -27,6 +50,6 @@ The format follows Keep a Changelog, and this project uses Semantic Versioning.
27
50
  - Started tracking the built `dist/` output so GitHub source archives also include runnable server files instead of documentation only
28
51
  - Switched the user-facing default profile examples from `dev` to `stable` so published usage aligns with the release app instead of development builds
29
52
  - Reworked `README.md` into a project-introduction document focused on purpose, architecture, tool surface, and design boundaries
30
- - Moved startup, environment, and local development instructions out of `README.md` into `startup_processmd.md`
53
+ - Moved startup, environment, and local development instructions out of `README.md` into `STARTUP_PROCESS.md`
31
54
  - Replaced `README.md` again with a bilingual project-homepage version that explains what the project is, what it is today, and the future direction in English and Chinese
32
- - Moved the remaining reference and operational material from `README.md` into `startup_processmd.md`
55
+ - Moved the remaining reference and operational material from `README.md` into `STARTUP_PROCESS.md`
package/README.md CHANGED
@@ -1,10 +1,85 @@
1
- # golutra-mcp
1
+ <p align="center">
2
+ <a href="https://www.golutra.com/" target="_blank" rel="noopener noreferrer">
3
+ <img
4
+ width="96"
5
+ src="./assets/readme/golutra-logo.png"
6
+ alt="golutra logo"
7
+ />
8
+ </a>
9
+ </p>
10
+
11
+ <h1 align="center">golutra-mcp</h1>
12
+
13
+ <p align="center">
14
+ MCP bridge for Golutra via golutra-cli. <br />
15
+ 通过 golutra-cli 暴露 Golutra 能力的 MCP 桥接层。
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://www.npmjs.com/package/golutra-mcp"><img src="https://img.shields.io/npm/v/golutra-mcp?label=npm" alt="npm version"></a>
20
+ <a href="https://www.npmjs.com/package/golutra-mcp"><img src="https://img.shields.io/npm/dm/golutra-mcp?label=downloads" alt="npm downloads"></a>
21
+ <a href="https://github.com/golutra/golutra-mcp/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/golutra/golutra-mcp/ci.yml?branch=main&label=ci" alt="ci"></a>
22
+ <a href="https://www.npmjs.com/package/golutra-mcp"><img src="https://img.shields.io/badge/node-%3E%3D20.11-2f7af8" alt="node version"></a>
23
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-ff9f1a" alt="license"></a>
24
+ </p>
25
+
26
+ <p align="center">
27
+ <a href="#english">English</a> ·
28
+ <a href="#中文">中文</a> ·
29
+ <a href="https://www.npmjs.com/package/golutra-mcp">npm</a> ·
30
+ <a href="https://github.com/golutra/golutra-mcp">GitHub</a> ·
31
+ <a href="./STARTUP_PROCESS.md">Startup Process</a> ·
32
+ <a href="./docs/WORKSPACE_CONTEXT_EXAMPLES.md">Workspace Examples</a> ·
33
+ <a href="./docs/GOLUTRA_DIAGNOSE_EXAMPLES.md">Diagnose Examples</a>
34
+ </p>
35
+
36
+ <p align="center">
37
+ Keep Golutra as the app runtime. Use golutra-cli as the stable boundary. Expose the workflow through MCP. <br />
38
+ 保留 Golutra 作为桌面运行时,以 golutra-cli 作为稳定边界,再通过 MCP 暴露给外部 AI 宿主。
39
+ </p>
40
+
41
+ ---
2
42
 
3
- `golutra-mcp` is an MCP bridge project for Golutra.
43
+ ## English
4
44
 
5
- `golutra-mcp` 是一个面向 Golutra 的 MCP 桥接项目。
45
+ ### Install
6
46
 
7
- ## English
47
+ `golutra-mcp` is now published on npm as `golutra-mcp`.
48
+
49
+ Install it as a normal MCP server package:
50
+
51
+ ```bash
52
+ npm install -g golutra-mcp
53
+ ```
54
+
55
+ Run it with a published Golutra desktop installation.
56
+
57
+ macOS:
58
+
59
+ ```bash
60
+ export GOLUTRA_CLI_PATH=/Applications/Golutra.app/Contents/MacOS/golutra-cli
61
+ export GOLUTRA_PROFILE=stable
62
+ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
63
+ golutra-mcp
64
+ ```
65
+
66
+ Windows PowerShell:
67
+
68
+ ```powershell
69
+ $env:GOLUTRA_CLI_PATH="C:\Users\<you>\AppData\Local\Programs\Golutra\golutra-cli.exe"
70
+ $env:GOLUTRA_PROFILE="stable"
71
+ $env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
72
+ golutra-mcp
73
+ ```
74
+
75
+ Linux:
76
+
77
+ ```bash
78
+ export GOLUTRA_CLI_PATH=/usr/bin/golutra-cli
79
+ export GOLUTRA_PROFILE=stable
80
+ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
81
+ golutra-mcp
82
+ ```
8
83
 
9
84
  ### What This Project Is
10
85
 
@@ -14,7 +89,7 @@ It is not a replacement for Golutra itself, and it does not re-implement Golutra
14
89
 
15
90
  ### What It Is Today
16
91
 
17
- The current project is a usable engineering preview, not yet a fully mature public integration product.
92
+ The current project is an installable public MCP server release with its first npm distribution already published.
18
93
 
19
94
  Today it already provides:
20
95
 
@@ -24,7 +99,7 @@ Today it already provides:
24
99
  - skill validation and direct project `SKILL.md` reading for local Golutra skill workflows
25
100
  - an open-source project skeleton with contribution, security, CI, and release-facing metadata
26
101
 
27
- At the current stage, the project should be understood as a focused integration layer that can already be downloaded and evaluated, but still needs broader real-world validation before it should be treated as a fully mature public MCP distribution.
102
+ At the current stage, it should be understood as a real downloadable integration package that is ready for evaluation, pilot usage, and downstream MCP wiring, but still needs broader real-world validation before it should be treated as a fully hardened long-term public integration product.
28
103
 
29
104
  ### Why It Exists
30
105
 
@@ -37,6 +112,49 @@ That means this repository is mainly responsible for:
37
112
  - safe command wrapping
38
113
  - diagnostics and integration ergonomics
39
114
 
115
+ ### Runtime Requirements
116
+
117
+ To work correctly, the server still depends on the existing Golutra desktop runtime:
118
+
119
+ - a locally installed Golutra desktop application
120
+ - a reachable `golutra-cli` binary
121
+ - a valid Golutra workspace path
122
+ - the target Golutra desktop app profile running locally, usually `stable`
123
+
124
+ Default CLI discovery by platform:
125
+
126
+ - macOS: `/Applications/Golutra.app/Contents/MacOS/golutra-cli`, then `~/Applications/Golutra.app/Contents/MacOS/golutra-cli`, then `golutra-cli` from `PATH`
127
+ - Windows: `%LOCALAPPDATA%\Programs\Golutra\golutra-cli.exe`, then `%ProgramFiles%\Golutra\golutra-cli.exe`, then `%ProgramFiles(x86)%\Golutra\golutra-cli.exe`, then `golutra-cli.exe` from `PATH`
128
+ - Linux: `~/.local/bin/golutra-cli`, then `~/.cargo/bin/golutra-cli`, then `/usr/local/bin/golutra-cli`, `/usr/bin/golutra-cli`, `/opt/Golutra/golutra-cli`, `/app/bin/golutra-cli`, then `golutra-cli` from `PATH`
129
+
130
+ ### Diagnostics
131
+
132
+ Use `golutra-diagnose` when you need to separate:
133
+
134
+ - CLI path problems
135
+ - missing or invalid workspace paths
136
+ - missing user identity for app-backed probes
137
+ - app-not-running or profile-mismatch failures
138
+ - generic app command failures
139
+
140
+ Detailed diagnostic output fields and common `reasonCode` values are documented in `docs/GOLUTRA_DIAGNOSE_EXAMPLES.md`.
141
+
142
+ ### What An AI Host Should Do
143
+
144
+ If an AI system or MCP-compatible host sees this repository, the intended usage is:
145
+
146
+ 1. Launch `golutra-mcp` as a local `stdio` MCP server, not as an HTTP service.
147
+ 2. Provide `GOLUTRA_CLI_PATH`, `GOLUTRA_PROFILE`, and usually `GOLUTRA_WORKSPACE_PATH`.
148
+ 3. Call `golutra-get-context` or `golutra-diagnose` first to confirm runtime readiness.
149
+ 4. Use the structured tool flow instead of inventing a custom transport:
150
+ `golutra-list-conversations` -> `golutra-list-messages` / `golutra-send-message` / `golutra-read-roadmap` / `golutra-update-roadmap`.
151
+ 5. Treat `golutra-cli` as the stable boundary. Do not bypass this project by directly calling Golutra local socket IPC unless you intentionally want to maintain a separate integration layer.
152
+ 6. When switching workspaces for a single request, pass `workspacePath` on that tool call. Use `golutra-set-context` only when you want to persist a new default for later calls.
153
+
154
+ In short: start with diagnostics, keep workspace and profile explicit, and use the provided MCP tools as the integration contract.
155
+
156
+ For concrete workspace switching and chat flow examples, see `docs/WORKSPACE_CONTEXT_EXAMPLES.md`.
157
+
40
158
  ### Future Direction
41
159
 
42
160
  The next stages should move the project from "basic bridge" to "usable integration product."
@@ -50,9 +168,9 @@ Likely future work includes:
50
168
  - tighter documentation around real Golutra collaboration workflows
51
169
  - stronger release hardening across installation paths, packaging validation, and end-to-end compatibility checks
52
170
 
53
- ### Getting Started
171
+ ### Source Development
54
172
 
55
- Try from source first:
173
+ If you want to run or modify the repository from source instead of installing the npm package:
56
174
 
57
175
  ```bash
58
176
  npm install
@@ -62,19 +180,48 @@ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
62
180
  npm run dev
63
181
  ```
64
182
 
65
- Use the npm package after you are ready to consume it as a normal MCP server distribution:
183
+ Detailed startup, validation, and client wiring instructions live in `STARTUP_PROCESS.md`.
184
+
185
+ ## 中文
186
+
187
+ ### 安装方式
188
+
189
+ `golutra-mcp` 现在已经以 `golutra-mcp` 这个包名发布到 npm。
190
+
191
+ 按普通 MCP Server 包安装即可:
66
192
 
67
193
  ```bash
68
194
  npm install -g golutra-mcp
69
- export GOLUTRA_CLI_PATH=/absolute/path/to/golutra-cli
195
+ ```
196
+
197
+ 建议配合已安装的 Golutra 桌面应用直接运行。
198
+
199
+ macOS:
200
+
201
+ ```bash
202
+ export GOLUTRA_CLI_PATH=/Applications/Golutra.app/Contents/MacOS/golutra-cli
70
203
  export GOLUTRA_PROFILE=stable
71
204
  export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
72
205
  golutra-mcp
73
206
  ```
74
207
 
75
- Detailed startup, validation, and client wiring instructions live in `startup_processmd.md`.
208
+ Windows PowerShell:
76
209
 
77
- ## 中文
210
+ ```powershell
211
+ $env:GOLUTRA_CLI_PATH="C:\Users\<you>\AppData\Local\Programs\Golutra\golutra-cli.exe"
212
+ $env:GOLUTRA_PROFILE="stable"
213
+ $env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
214
+ golutra-mcp
215
+ ```
216
+
217
+ Linux:
218
+
219
+ ```bash
220
+ export GOLUTRA_CLI_PATH=/usr/bin/golutra-cli
221
+ export GOLUTRA_PROFILE=stable
222
+ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
223
+ golutra-mcp
224
+ ```
78
225
 
79
226
  ### 这是什么项目
80
227
 
@@ -84,7 +231,7 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
84
231
 
85
232
  ### 当前阶段是什么
86
233
 
87
- 当前这个项目已经进入“可下载试用的工程化预发布”阶段,但还不能算“完全成熟、长期稳定的公共 MCP 成品”。
234
+ 当前这个项目已经进入“可下载安装的公开版本”阶段,并且第一版 npm 包已经发布。
88
235
 
89
236
  现阶段已经具备:
90
237
 
@@ -94,7 +241,7 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
94
241
  - 技能校验与项目 `SKILL.md` 直接读取能力,能覆盖本地技能开发链路
95
242
  - 基本完整的开源项目骨架,包括贡献规范、安全策略、CI 和发布元数据
96
243
 
97
- 但它现在还不是一个“已经经过广泛真实场景验证的完整 Golutra 远程集成产品”,更准确的定位是:一个已经能下载试用、也具备基本发布骨架的 MCP 集成底座。
244
+ 但它现在还不是一个“已经经过大规模真实场景验证、长期充分打磨”的成熟公共集成产品。更准确的定位是:一个已经可以下载安装、接入验证、试点使用的 Golutra MCP 集成层。
98
245
 
99
246
  ### 这个项目解决什么问题
100
247
 
@@ -107,6 +254,49 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
107
254
  - 对现有 CLI 能力的稳定封装
108
255
  - 联通诊断与集成体验
109
256
 
257
+ ### 运行前提
258
+
259
+ 这个 MCP Server 运行时依赖现有的 Golutra 本地运行环境:
260
+
261
+ - 本机已安装 Golutra 桌面应用
262
+ - 能访问到 `golutra-cli`
263
+ - 已知的有效工作区路径
264
+ - 本地已启动目标 profile 的 Golutra 桌面应用,通常使用 `stable`
265
+
266
+ 按平台的默认 CLI 自动发现顺序:
267
+
268
+ - macOS:`/Applications/Golutra.app/Contents/MacOS/golutra-cli`,然后 `~/Applications/Golutra.app/Contents/MacOS/golutra-cli`,最后回退到 `PATH` 里的 `golutra-cli`
269
+ - Windows:`%LOCALAPPDATA%\Programs\Golutra\golutra-cli.exe`,然后 `%ProgramFiles%\Golutra\golutra-cli.exe`,再然后 `%ProgramFiles(x86)%\Golutra\golutra-cli.exe`,最后回退到 `PATH` 里的 `golutra-cli.exe`
270
+ - Linux:`~/.local/bin/golutra-cli`,然后 `~/.cargo/bin/golutra-cli`、`/usr/local/bin/golutra-cli`、`/usr/bin/golutra-cli`、`/opt/Golutra/golutra-cli`、`/app/bin/golutra-cli`,最后回退到 `PATH` 里的 `golutra-cli`
271
+
272
+ ### 诊断能力
273
+
274
+ 需要排查问题时,可以优先用 `golutra-diagnose` 区分:
275
+
276
+ - CLI 路径问题
277
+ - workspacePath 缺失或非法
278
+ - userId 缺失导致 app 探针跳过
279
+ - 桌面应用未运行或 profile 不匹配
280
+ - 普通 app 命令失败
281
+
282
+ 更完整的诊断输出字段和常见 `reasonCode` 说明见 `docs/GOLUTRA_DIAGNOSE_EXAMPLES.md`。
283
+
284
+ ### AI 看到这个项目后应该怎么做
285
+
286
+ 如果一个 AI 系统或支持 MCP 的宿主看到这个仓库,推荐按下面方式接入:
287
+
288
+ 1. 把 `golutra-mcp` 当作本地 `stdio` MCP Server 启动,不要把它当成 HTTP 服务。
289
+ 2. 提供 `GOLUTRA_CLI_PATH`、`GOLUTRA_PROFILE`,通常还需要提供 `GOLUTRA_WORKSPACE_PATH`。
290
+ 3. 先调用 `golutra-get-context` 或 `golutra-diagnose`,确认运行时上下文和联通状态。
291
+ 4. 按现有工具面走标准调用链路,不要自造传输协议:
292
+ `golutra-list-conversations` -> `golutra-list-messages` / `golutra-send-message` / `golutra-read-roadmap` / `golutra-update-roadmap`。
293
+ 5. 把 `golutra-cli` 视为稳定边界。除非你明确准备长期维护另一套集成层,否则不要绕过这个项目去直连 Golutra 本地 socket IPC。
294
+ 6. 如果只是某一次调用切换工作区,就在该次 tool 调用里显式传 `workspacePath`。只有在你希望后续调用默认都改到新工作区时,才使用 `golutra-set-context`。
295
+
296
+ 一句话概括:先诊断,再显式设置 workspace/profile,然后把 README 里提供的 MCP tools 当作正式集成契约来用。
297
+
298
+ 如果你想看“工作区切换”和“真实聊天链路”的具体调用示例,直接看 `docs/WORKSPACE_CONTEXT_EXAMPLES.md`。
299
+
110
300
  ### 后续规划
111
301
 
112
302
  后续项目应该从“能桥接”继续推进到“更好用、可发布、可维护”。
@@ -120,9 +310,9 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
120
310
  - 补齐围绕真实 Golutra 协作场景的文档和示例
121
311
  - 继续补强跨平台安装路径、自诊断、端到端兼容性验证
122
312
 
123
- ### 开始使用
313
+ ### 源码开发
124
314
 
125
- 建议先从源码试用:
315
+ 如果你要按源码方式运行或参与开发:
126
316
 
127
317
  ```bash
128
318
  npm install
@@ -132,22 +322,16 @@ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
132
322
  npm run dev
133
323
  ```
134
324
 
135
- 确认链路符合预期后,再按普通 MCP 包的方式安装:
136
-
137
- ```bash
138
- npm install -g golutra-mcp
139
- export GOLUTRA_CLI_PATH=/absolute/path/to/golutra-cli
140
- export GOLUTRA_PROFILE=stable
141
- export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
142
- golutra-mcp
143
- ```
144
-
145
- 更完整的启动、验证与客户端接入说明见 `startup_processmd.md`。
325
+ 更完整的启动、验证与客户端接入说明见 `STARTUP_PROCESS.md`。
146
326
 
147
327
  ## Documentation
148
328
 
149
329
  - Startup, installation, validation, and MCP client wiring:
150
- [startup_processmd.md](./startup_processmd.md)
330
+ [STARTUP_PROCESS.md](./STARTUP_PROCESS.md)
331
+ - Workspace override and stored default examples:
332
+ [docs/WORKSPACE_CONTEXT_EXAMPLES.md](./docs/WORKSPACE_CONTEXT_EXAMPLES.md)
333
+ - Diagnostic output examples and reason codes:
334
+ [docs/GOLUTRA_DIAGNOSE_EXAMPLES.md](./docs/GOLUTRA_DIAGNOSE_EXAMPLES.md)
151
335
  - Contribution guide:
152
336
  [CONTRIBUTING.md](./CONTRIBUTING.md)
153
337
  - Security policy:
@@ -1,4 +1,4 @@
1
- # startup_processmd
1
+ # STARTUP_PROCESS
2
2
 
3
3
  This document contains the setup, startup, build, validation, local integration steps, and the detailed operational notes previously kept in `README.md`.
4
4
 
@@ -43,6 +43,18 @@ This repository focuses on protocol translation, context management, diagnostics
43
43
  - `golutra-set-context` updates defaults for later tool calls
44
44
  - `golutra-reset-context` restores defaults from the process environment used at startup
45
45
  - `golutra-diagnose` verifies `golutra-cli` reachability and, when both `workspacePath` and `userId` are available, probes app connectivity with `chat.conversations.list`
46
+ - `golutra-diagnose` now returns layered checks for `cliPath`, `cliCommand`, `workspace`, `userId`, and `appConnection`
47
+ - `golutra-diagnose` also returns `summary.status` (`ok`, `partial`, `error`), `reasonCodes`, and `nextSteps`
48
+ - Detailed output examples and common `reasonCode` values live in `docs/GOLUTRA_DIAGNOSE_EXAMPLES.md`
49
+
50
+ ### Workspace Override Contract
51
+
52
+ - Passing `workspacePath` in a tool call is a one-time override for that call only
53
+ - `golutra-set-context` is the explicit operation that persists a new default `workspacePath` for later calls
54
+ - If an AI host switches workspaces frequently, prefer passing `workspacePath` per call instead of mutating shared defaults
55
+ - 如果只是某一次调用临时切换工作区,直接在该次 tool 输入里传 `workspacePath`
56
+ - 如果希望后续调用默认都切到新工作区,再使用 `golutra-set-context`
57
+ - Concrete request sequences are documented in `docs/WORKSPACE_CONTEXT_EXAMPLES.md`
46
58
 
47
59
  ### Current Limitations
48
60
 
@@ -76,7 +88,7 @@ It still needs more real-world validation across MCP hosts, operating systems, a
76
88
  ## Environment Variables
77
89
 
78
90
  - `GOLUTRA_CLI_PATH`
79
- Default: auto-discover the macOS app-bundled CLI when available, otherwise `golutra-cli`
91
+ Default: auto-discover a platform-specific `golutra-cli` install when available, otherwise fall back to the platform command name from `PATH`
80
92
  - `GOLUTRA_PROFILE`
81
93
  Optional Golutra runtime profile: `dev`, `canary`, or `stable`
82
94
  - `GOLUTRA_WORKSPACE_PATH`
@@ -86,6 +98,12 @@ It still needs more real-world validation across MCP hosts, operating systems, a
86
98
 
87
99
  Use [.env.example](./.env.example) as the minimal local template.
88
100
 
101
+ Default CLI discovery order:
102
+
103
+ - macOS: `/Applications/Golutra.app/Contents/MacOS/golutra-cli`, `~/Applications/Golutra.app/Contents/MacOS/golutra-cli`, `golutra-cli`
104
+ - Windows: `%LOCALAPPDATA%\Programs\Golutra\golutra-cli.exe`, `%ProgramFiles%\Golutra\golutra-cli.exe`, `%ProgramFiles(x86)%\Golutra\golutra-cli.exe`, `golutra-cli.exe`
105
+ - Linux: `~/.local/bin/golutra-cli`, `~/.cargo/bin/golutra-cli`, `/usr/local/bin/golutra-cli`, `/usr/bin/golutra-cli`, `/opt/Golutra/golutra-cli`, `/app/bin/golutra-cli`, `golutra-cli`
106
+
89
107
  ## Install Dependencies
90
108
 
91
109
  ```bash
@@ -102,6 +120,75 @@ npm install -g golutra-mcp
102
120
 
103
121
  Then configure your MCP client to launch `golutra-mcp` directly.
104
122
 
123
+ Typical launch examples by platform:
124
+
125
+ macOS:
126
+
127
+ ```bash
128
+ export GOLUTRA_CLI_PATH=/Applications/Golutra.app/Contents/MacOS/golutra-cli
129
+ export GOLUTRA_PROFILE=stable
130
+ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
131
+ golutra-mcp
132
+ ```
133
+
134
+ Windows PowerShell:
135
+
136
+ ```powershell
137
+ $env:GOLUTRA_CLI_PATH="C:\Users\<you>\AppData\Local\Programs\Golutra\golutra-cli.exe"
138
+ $env:GOLUTRA_PROFILE="stable"
139
+ $env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
140
+ golutra-mcp
141
+ ```
142
+
143
+ Linux:
144
+
145
+ ```bash
146
+ export GOLUTRA_CLI_PATH=/usr/bin/golutra-cli
147
+ export GOLUTRA_PROFILE=stable
148
+ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
149
+ golutra-mcp
150
+ ```
151
+
152
+ ## Quick Verification After Install
153
+
154
+ Use this sequence when you want to confirm that the published package and the local Golutra runtime are wired correctly.
155
+
156
+ 1. Confirm the package is visible from npm:
157
+
158
+ ```bash
159
+ npm view golutra-mcp version
160
+ ```
161
+
162
+ 2. Confirm the binary can start with your local Golutra runtime settings:
163
+
164
+ macOS/Linux:
165
+
166
+ ```bash
167
+ export GOLUTRA_CLI_PATH=/absolute/path/to/golutra-cli
168
+ export GOLUTRA_PROFILE=stable
169
+ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
170
+ golutra-mcp
171
+ ```
172
+
173
+ Windows PowerShell:
174
+
175
+ ```powershell
176
+ $env:GOLUTRA_CLI_PATH="C:\absolute\path\to\golutra-cli.exe"
177
+ $env:GOLUTRA_PROFILE="stable"
178
+ $env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
179
+ golutra-mcp
180
+ ```
181
+
182
+ 3. If your MCP host can call tools immediately, run `golutra-get-context` or `golutra-diagnose`.
183
+
184
+ What to expect:
185
+
186
+ - `golutra-get-context` should return the resolved `cliPath`, `profile`, `workspacePath`, and `timeoutMs`
187
+ - `golutra-diagnose` should report `checks.cliPath.ok = true` and `checks.cliCommand.ok = true`
188
+ - If you also provide a valid workspace `userId`, `golutra-diagnose` should attempt the app-backed `chat.conversations.list` probe
189
+
190
+ If installation succeeds but runtime access still fails, use `golutra-diagnose` first and then compare the output with `docs/GOLUTRA_DIAGNOSE_EXAMPLES.md`.
191
+
105
192
  ## Local Development
106
193
 
107
194
  Start the MCP server directly from source:
@@ -187,6 +274,43 @@ npm pack --dry-run
187
274
 
188
275
  `prepack` is configured to build the project before npm packaging.
189
276
 
277
+ ## Publish To npm
278
+
279
+ Use this flow for a normal public npm release:
280
+
281
+ 1. Confirm you are in the repository root and that checks pass:
282
+
283
+ ```bash
284
+ cd /path/to/golutra-mcp
285
+ npm run check
286
+ npm pack
287
+ ```
288
+
289
+ 2. Confirm your npm CLI session is authenticated:
290
+
291
+ ```bash
292
+ npm whoami
293
+ ```
294
+
295
+ 3. Publish the package:
296
+
297
+ ```bash
298
+ npm publish
299
+ ```
300
+
301
+ 4. Verify the published result:
302
+
303
+ ```bash
304
+ npm view golutra-mcp version
305
+ npm view golutra-mcp
306
+ ```
307
+
308
+ Release notes:
309
+
310
+ - If `npm publish` reports that the version already exists, bump `package.json` to the next version and publish again
311
+ - If npm requires browser or OTP confirmation, complete that flow and wait for the CLI to print `+ golutra-mcp@<version>`
312
+ - `npm pack` creates a local `.tgz` artifact in the repository root; this is useful for pre-publish inspection or private file distribution
313
+
190
314
  ## Self-Hosted E2E CI
191
315
 
192
316
  The repository includes a dedicated GitHub Actions workflow for real MCP smoke tests on a macOS self-hosted runner:
@@ -205,7 +329,7 @@ Recommended runner prerequisites:
205
329
  Repository variables:
206
330
 
207
331
  - `GOLUTRA_E2E_WORKSPACE_PATH`: required unless provided as a workflow input
208
- - `GOLUTRA_E2E_CLI_PATH`: optional, defaults to `/Applications/Golutra.app/Contents/MacOS/golutra-cli`
332
+ - `GOLUTRA_E2E_CLI_PATH`: optional, defaults to the same platform-specific discovery rules as runtime startup; macOS runners commonly use `/Applications/Golutra.app/Contents/MacOS/golutra-cli`
209
333
  - `GOLUTRA_E2E_PROFILE`: optional, defaults to `stable`
210
334
  - `GOLUTRA_E2E_USER_ID`: required only when the workflow is run with `app_probe=true`
211
335
 
Binary file
package/dist/index.js CHANGED
@@ -4,9 +4,9 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
4
4
  import { NodeCliJsonRunner } from "./lib/cli-runner.js";
5
5
  import { ContextStore, createInitialContext } from "./lib/context.js";
6
6
  import { GolutraCliGateway } from "./lib/golutra-client.js";
7
+ import { readPackageMetadata } from "./lib/package-metadata.js";
7
8
  import { registerTools } from "./lib/toolkit.js";
8
- const SERVER_NAME = "golutra-mcp";
9
- const SERVER_VERSION = "0.1.0";
9
+ const { name: SERVER_NAME, version: SERVER_VERSION } = readPackageMetadata();
10
10
  async function main() {
11
11
  const server = new McpServer({
12
12
  name: SERVER_NAME,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAE/D,kDAAkD;IAClD,aAAa,CAAC,MAAM,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AO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,qBAAqB,OAAO,IAAI,CAAC,CAAC;IACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -11,6 +11,7 @@ export declare class ContextStore {
11
11
  constructor(initialContext: RuntimeContextSnapshot);
12
12
  getSnapshot(): RuntimeContextSnapshot;
13
13
  reset(): RuntimeContextSnapshot;
14
+ private mergeContext;
14
15
  update(nextValues: CommandContextInput): RuntimeContextSnapshot;
15
16
  resolveCommandContext(nextValues?: CommandContextInput): RuntimeContextSnapshot;
16
17
  requireWorkspacePath(nextValues?: CommandContextInput): string;