golutra-mcp 0.1.0 → 0.1.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/.env.example +3 -2
- package/CHANGELOG.md +16 -3
- package/README.md +138 -24
- package/{startup_processmd.md → STARTUP_PROCESS.md} +41 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/context.js +57 -9
- package/dist/lib/context.js.map +1 -1
- package/dist/lib/diagnostics.d.ts +34 -0
- package/dist/lib/diagnostics.js +242 -0
- package/dist/lib/diagnostics.js.map +1 -0
- package/dist/lib/golutra-client.d.ts +2 -1
- package/dist/lib/golutra-client.js +20 -2
- package/dist/lib/golutra-client.js.map +1 -1
- package/dist/lib/package-metadata.d.ts +6 -0
- package/dist/lib/package-metadata.js +21 -0
- package/dist/lib/package-metadata.js.map +1 -0
- package/dist/lib/toolkit.js +123 -50
- package/dist/lib/toolkit.js.map +1 -1
- package/dist/lib/types.d.ts +20 -4
- package/docs/GOLUTRA_DIAGNOSE_EXAMPLES.md +191 -0
- package/package.json +3 -2
package/.env.example
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
# Optional. If unset, mcp
|
|
2
|
-
#
|
|
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,19 @@ 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.1] - 2026-03-21
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Synced `scripts/e2e-smoke.mjs` with the layered `golutra-diagnose` output so self-hosted smoke tests validate the current diagnostic contract
|
|
14
|
+
- Expanded the basic GitHub Actions check workflow to run on Linux, macOS, and Windows so platform-specific regressions surface earlier
|
|
15
|
+
- Included `docs/` in the npm publish file list so packaged users can open the referenced diagnostic example document locally
|
|
16
|
+
- Renamed `startup_processmd.md` to `STARTUP_PROCESS.md` and updated repository links to use a stable public-facing document name
|
|
17
|
+
- Removed stale `mcp-golutra` wording from the bug report template so issue reports match the published package name
|
|
18
|
+
- Stopped hardcoding the MCP server runtime version in source scripts and now read it from `package.json`
|
|
19
|
+
|
|
7
20
|
## [0.1.0] - 2026-03-17
|
|
8
21
|
|
|
9
22
|
### Added
|
|
@@ -14,7 +27,7 @@ The format follows Keep a Changelog, and this project uses Semantic Versioning.
|
|
|
14
27
|
- `golutra-reset-context` and `golutra-diagnose` for runtime troubleshooting
|
|
15
28
|
- ESLint, TypeScript, and Vitest based quality gates
|
|
16
29
|
- CI workflow, contribution guide, security policy, and code of conduct
|
|
17
|
-
- Dedicated `
|
|
30
|
+
- Dedicated `STARTUP_PROCESS.md` for setup/start/build/validation flow
|
|
18
31
|
|
|
19
32
|
### Changed
|
|
20
33
|
|
|
@@ -27,6 +40,6 @@ The format follows Keep a Changelog, and this project uses Semantic Versioning.
|
|
|
27
40
|
- Started tracking the built `dist/` output so GitHub source archives also include runnable server files instead of documentation only
|
|
28
41
|
- Switched the user-facing default profile examples from `dev` to `stable` so published usage aligns with the release app instead of development builds
|
|
29
42
|
- 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 `
|
|
43
|
+
- Moved startup, environment, and local development instructions out of `README.md` into `STARTUP_PROCESS.md`
|
|
31
44
|
- 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 `
|
|
45
|
+
- Moved the remaining reference and operational material from `README.md` into `STARTUP_PROCESS.md`
|
package/README.md
CHANGED
|
@@ -6,6 +6,45 @@
|
|
|
6
6
|
|
|
7
7
|
## English
|
|
8
8
|
|
|
9
|
+
### Install
|
|
10
|
+
|
|
11
|
+
`golutra-mcp` is now published on npm as `golutra-mcp`.
|
|
12
|
+
|
|
13
|
+
Install it as a normal MCP server package:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g golutra-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run it with a published Golutra desktop installation.
|
|
20
|
+
|
|
21
|
+
macOS:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export GOLUTRA_CLI_PATH=/Applications/Golutra.app/Contents/MacOS/golutra-cli
|
|
25
|
+
export GOLUTRA_PROFILE=stable
|
|
26
|
+
export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
27
|
+
golutra-mcp
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Windows PowerShell:
|
|
31
|
+
|
|
32
|
+
```powershell
|
|
33
|
+
$env:GOLUTRA_CLI_PATH="C:\Users\<you>\AppData\Local\Programs\Golutra\golutra-cli.exe"
|
|
34
|
+
$env:GOLUTRA_PROFILE="stable"
|
|
35
|
+
$env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
|
|
36
|
+
golutra-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Linux:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
export GOLUTRA_CLI_PATH=/usr/bin/golutra-cli
|
|
43
|
+
export GOLUTRA_PROFILE=stable
|
|
44
|
+
export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
45
|
+
golutra-mcp
|
|
46
|
+
```
|
|
47
|
+
|
|
9
48
|
### What This Project Is
|
|
10
49
|
|
|
11
50
|
`golutra-mcp` is a Model Context Protocol server that exposes Golutra collaboration capabilities to MCP-compatible hosts through `golutra-cli`.
|
|
@@ -14,7 +53,7 @@ It is not a replacement for Golutra itself, and it does not re-implement Golutra
|
|
|
14
53
|
|
|
15
54
|
### What It Is Today
|
|
16
55
|
|
|
17
|
-
The current project is
|
|
56
|
+
The current project is an installable public MCP server release with its first npm distribution already published.
|
|
18
57
|
|
|
19
58
|
Today it already provides:
|
|
20
59
|
|
|
@@ -24,7 +63,7 @@ Today it already provides:
|
|
|
24
63
|
- skill validation and direct project `SKILL.md` reading for local Golutra skill workflows
|
|
25
64
|
- an open-source project skeleton with contribution, security, CI, and release-facing metadata
|
|
26
65
|
|
|
27
|
-
At the current stage,
|
|
66
|
+
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
67
|
|
|
29
68
|
### Why It Exists
|
|
30
69
|
|
|
@@ -37,6 +76,33 @@ That means this repository is mainly responsible for:
|
|
|
37
76
|
- safe command wrapping
|
|
38
77
|
- diagnostics and integration ergonomics
|
|
39
78
|
|
|
79
|
+
### Runtime Requirements
|
|
80
|
+
|
|
81
|
+
To work correctly, the server still depends on the existing Golutra desktop runtime:
|
|
82
|
+
|
|
83
|
+
- a locally installed Golutra desktop application
|
|
84
|
+
- a reachable `golutra-cli` binary
|
|
85
|
+
- a valid Golutra workspace path
|
|
86
|
+
- the target Golutra desktop app profile running locally, usually `stable`
|
|
87
|
+
|
|
88
|
+
Default CLI discovery by platform:
|
|
89
|
+
|
|
90
|
+
- macOS: `/Applications/Golutra.app/Contents/MacOS/golutra-cli`, then `~/Applications/Golutra.app/Contents/MacOS/golutra-cli`, then `golutra-cli` from `PATH`
|
|
91
|
+
- 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`
|
|
92
|
+
- 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`
|
|
93
|
+
|
|
94
|
+
### Diagnostics
|
|
95
|
+
|
|
96
|
+
Use `golutra-diagnose` when you need to separate:
|
|
97
|
+
|
|
98
|
+
- CLI path problems
|
|
99
|
+
- missing or invalid workspace paths
|
|
100
|
+
- missing user identity for app-backed probes
|
|
101
|
+
- app-not-running or profile-mismatch failures
|
|
102
|
+
- generic app command failures
|
|
103
|
+
|
|
104
|
+
Detailed diagnostic output fields and common `reasonCode` values are documented in `docs/GOLUTRA_DIAGNOSE_EXAMPLES.md`.
|
|
105
|
+
|
|
40
106
|
### Future Direction
|
|
41
107
|
|
|
42
108
|
The next stages should move the project from "basic bridge" to "usable integration product."
|
|
@@ -50,9 +116,9 @@ Likely future work includes:
|
|
|
50
116
|
- tighter documentation around real Golutra collaboration workflows
|
|
51
117
|
- stronger release hardening across installation paths, packaging validation, and end-to-end compatibility checks
|
|
52
118
|
|
|
53
|
-
###
|
|
119
|
+
### Source Development
|
|
54
120
|
|
|
55
|
-
|
|
121
|
+
If you want to run or modify the repository from source instead of installing the npm package:
|
|
56
122
|
|
|
57
123
|
```bash
|
|
58
124
|
npm install
|
|
@@ -62,19 +128,48 @@ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
|
62
128
|
npm run dev
|
|
63
129
|
```
|
|
64
130
|
|
|
65
|
-
|
|
131
|
+
Detailed startup, validation, and client wiring instructions live in `STARTUP_PROCESS.md`.
|
|
132
|
+
|
|
133
|
+
## 中文
|
|
134
|
+
|
|
135
|
+
### 安装方式
|
|
136
|
+
|
|
137
|
+
`golutra-mcp` 现在已经以 `golutra-mcp` 这个包名发布到 npm。
|
|
138
|
+
|
|
139
|
+
按普通 MCP Server 包安装即可:
|
|
66
140
|
|
|
67
141
|
```bash
|
|
68
142
|
npm install -g golutra-mcp
|
|
69
|
-
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
建议配合已安装的 Golutra 桌面应用直接运行。
|
|
146
|
+
|
|
147
|
+
macOS:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
export GOLUTRA_CLI_PATH=/Applications/Golutra.app/Contents/MacOS/golutra-cli
|
|
70
151
|
export GOLUTRA_PROFILE=stable
|
|
71
152
|
export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
72
153
|
golutra-mcp
|
|
73
154
|
```
|
|
74
155
|
|
|
75
|
-
|
|
156
|
+
Windows PowerShell:
|
|
76
157
|
|
|
77
|
-
|
|
158
|
+
```powershell
|
|
159
|
+
$env:GOLUTRA_CLI_PATH="C:\Users\<you>\AppData\Local\Programs\Golutra\golutra-cli.exe"
|
|
160
|
+
$env:GOLUTRA_PROFILE="stable"
|
|
161
|
+
$env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
|
|
162
|
+
golutra-mcp
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Linux:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
export GOLUTRA_CLI_PATH=/usr/bin/golutra-cli
|
|
169
|
+
export GOLUTRA_PROFILE=stable
|
|
170
|
+
export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
171
|
+
golutra-mcp
|
|
172
|
+
```
|
|
78
173
|
|
|
79
174
|
### 这是什么项目
|
|
80
175
|
|
|
@@ -84,7 +179,7 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
|
|
|
84
179
|
|
|
85
180
|
### 当前阶段是什么
|
|
86
181
|
|
|
87
|
-
|
|
182
|
+
当前这个项目已经进入“可下载安装的公开版本”阶段,并且第一版 npm 包已经发布。
|
|
88
183
|
|
|
89
184
|
现阶段已经具备:
|
|
90
185
|
|
|
@@ -94,7 +189,7 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
|
|
|
94
189
|
- 技能校验与项目 `SKILL.md` 直接读取能力,能覆盖本地技能开发链路
|
|
95
190
|
- 基本完整的开源项目骨架,包括贡献规范、安全策略、CI 和发布元数据
|
|
96
191
|
|
|
97
|
-
|
|
192
|
+
但它现在还不是一个“已经经过大规模真实场景验证、长期充分打磨”的成熟公共集成产品。更准确的定位是:一个已经可以下载安装、接入验证、试点使用的 Golutra MCP 集成层。
|
|
98
193
|
|
|
99
194
|
### 这个项目解决什么问题
|
|
100
195
|
|
|
@@ -107,6 +202,33 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
|
|
|
107
202
|
- 对现有 CLI 能力的稳定封装
|
|
108
203
|
- 联通诊断与集成体验
|
|
109
204
|
|
|
205
|
+
### 运行前提
|
|
206
|
+
|
|
207
|
+
这个 MCP Server 运行时依赖现有的 Golutra 本地运行环境:
|
|
208
|
+
|
|
209
|
+
- 本机已安装 Golutra 桌面应用
|
|
210
|
+
- 能访问到 `golutra-cli`
|
|
211
|
+
- 已知的有效工作区路径
|
|
212
|
+
- 本地已启动目标 profile 的 Golutra 桌面应用,通常使用 `stable`
|
|
213
|
+
|
|
214
|
+
按平台的默认 CLI 自动发现顺序:
|
|
215
|
+
|
|
216
|
+
- macOS:`/Applications/Golutra.app/Contents/MacOS/golutra-cli`,然后 `~/Applications/Golutra.app/Contents/MacOS/golutra-cli`,最后回退到 `PATH` 里的 `golutra-cli`
|
|
217
|
+
- Windows:`%LOCALAPPDATA%\Programs\Golutra\golutra-cli.exe`,然后 `%ProgramFiles%\Golutra\golutra-cli.exe`,再然后 `%ProgramFiles(x86)%\Golutra\golutra-cli.exe`,最后回退到 `PATH` 里的 `golutra-cli.exe`
|
|
218
|
+
- 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`
|
|
219
|
+
|
|
220
|
+
### 诊断能力
|
|
221
|
+
|
|
222
|
+
需要排查问题时,可以优先用 `golutra-diagnose` 区分:
|
|
223
|
+
|
|
224
|
+
- CLI 路径问题
|
|
225
|
+
- workspacePath 缺失或非法
|
|
226
|
+
- userId 缺失导致 app 探针跳过
|
|
227
|
+
- 桌面应用未运行或 profile 不匹配
|
|
228
|
+
- 普通 app 命令失败
|
|
229
|
+
|
|
230
|
+
更完整的诊断输出字段和常见 `reasonCode` 说明见 `docs/GOLUTRA_DIAGNOSE_EXAMPLES.md`。
|
|
231
|
+
|
|
110
232
|
### 后续规划
|
|
111
233
|
|
|
112
234
|
后续项目应该从“能桥接”继续推进到“更好用、可发布、可维护”。
|
|
@@ -120,9 +242,9 @@ Detailed startup, validation, and client wiring instructions live in `startup_pr
|
|
|
120
242
|
- 补齐围绕真实 Golutra 协作场景的文档和示例
|
|
121
243
|
- 继续补强跨平台安装路径、自诊断、端到端兼容性验证
|
|
122
244
|
|
|
123
|
-
###
|
|
245
|
+
### 源码开发
|
|
124
246
|
|
|
125
|
-
|
|
247
|
+
如果你要按源码方式运行或参与开发:
|
|
126
248
|
|
|
127
249
|
```bash
|
|
128
250
|
npm install
|
|
@@ -132,22 +254,14 @@ export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
|
132
254
|
npm run dev
|
|
133
255
|
```
|
|
134
256
|
|
|
135
|
-
|
|
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`。
|
|
257
|
+
更完整的启动、验证与客户端接入说明见 `STARTUP_PROCESS.md`。
|
|
146
258
|
|
|
147
259
|
## Documentation
|
|
148
260
|
|
|
149
261
|
- Startup, installation, validation, and MCP client wiring:
|
|
150
|
-
[
|
|
262
|
+
[STARTUP_PROCESS.md](./STARTUP_PROCESS.md)
|
|
263
|
+
- Diagnostic output examples and reason codes:
|
|
264
|
+
[docs/GOLUTRA_DIAGNOSE_EXAMPLES.md](./docs/GOLUTRA_DIAGNOSE_EXAMPLES.md)
|
|
151
265
|
- Contribution guide:
|
|
152
266
|
[CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
153
267
|
- Security policy:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
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,9 @@ 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`
|
|
46
49
|
|
|
47
50
|
### Current Limitations
|
|
48
51
|
|
|
@@ -76,7 +79,7 @@ It still needs more real-world validation across MCP hosts, operating systems, a
|
|
|
76
79
|
## Environment Variables
|
|
77
80
|
|
|
78
81
|
- `GOLUTRA_CLI_PATH`
|
|
79
|
-
Default: auto-discover
|
|
82
|
+
Default: auto-discover a platform-specific `golutra-cli` install when available, otherwise fall back to the platform command name from `PATH`
|
|
80
83
|
- `GOLUTRA_PROFILE`
|
|
81
84
|
Optional Golutra runtime profile: `dev`, `canary`, or `stable`
|
|
82
85
|
- `GOLUTRA_WORKSPACE_PATH`
|
|
@@ -86,6 +89,12 @@ It still needs more real-world validation across MCP hosts, operating systems, a
|
|
|
86
89
|
|
|
87
90
|
Use [.env.example](./.env.example) as the minimal local template.
|
|
88
91
|
|
|
92
|
+
Default CLI discovery order:
|
|
93
|
+
|
|
94
|
+
- macOS: `/Applications/Golutra.app/Contents/MacOS/golutra-cli`, `~/Applications/Golutra.app/Contents/MacOS/golutra-cli`, `golutra-cli`
|
|
95
|
+
- Windows: `%LOCALAPPDATA%\Programs\Golutra\golutra-cli.exe`, `%ProgramFiles%\Golutra\golutra-cli.exe`, `%ProgramFiles(x86)%\Golutra\golutra-cli.exe`, `golutra-cli.exe`
|
|
96
|
+
- 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`
|
|
97
|
+
|
|
89
98
|
## Install Dependencies
|
|
90
99
|
|
|
91
100
|
```bash
|
|
@@ -102,6 +111,35 @@ npm install -g golutra-mcp
|
|
|
102
111
|
|
|
103
112
|
Then configure your MCP client to launch `golutra-mcp` directly.
|
|
104
113
|
|
|
114
|
+
Typical launch examples by platform:
|
|
115
|
+
|
|
116
|
+
macOS:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
export GOLUTRA_CLI_PATH=/Applications/Golutra.app/Contents/MacOS/golutra-cli
|
|
120
|
+
export GOLUTRA_PROFILE=stable
|
|
121
|
+
export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
122
|
+
golutra-mcp
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Windows PowerShell:
|
|
126
|
+
|
|
127
|
+
```powershell
|
|
128
|
+
$env:GOLUTRA_CLI_PATH="C:\Users\<you>\AppData\Local\Programs\Golutra\golutra-cli.exe"
|
|
129
|
+
$env:GOLUTRA_PROFILE="stable"
|
|
130
|
+
$env:GOLUTRA_WORKSPACE_PATH="C:\absolute\path\to\workspace"
|
|
131
|
+
golutra-mcp
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Linux:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
export GOLUTRA_CLI_PATH=/usr/bin/golutra-cli
|
|
138
|
+
export GOLUTRA_PROFILE=stable
|
|
139
|
+
export GOLUTRA_WORKSPACE_PATH=/absolute/path/to/workspace
|
|
140
|
+
golutra-mcp
|
|
141
|
+
```
|
|
142
|
+
|
|
105
143
|
## Local Development
|
|
106
144
|
|
|
107
145
|
Start the MCP server directly from source:
|
|
@@ -205,7 +243,7 @@ Recommended runner prerequisites:
|
|
|
205
243
|
Repository variables:
|
|
206
244
|
|
|
207
245
|
- `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`
|
|
246
|
+
- `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
247
|
- `GOLUTRA_E2E_PROFILE`: optional, defaults to `stable`
|
|
210
248
|
- `GOLUTRA_E2E_USER_ID`: required only when the workflow is run with `app_probe=true`
|
|
211
249
|
|
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 =
|
|
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,
|
|
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,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,mBAAmB,EAAE,CAAC;AAE7E,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,I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
4
|
import { GOLUTRA_PROFILES } from "./types.js";
|
|
5
5
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
6
6
|
const MAX_TIMEOUT_MS = 300_000;
|
|
7
|
-
const DEFAULT_CLI_COMMAND = "golutra-cli";
|
|
8
7
|
function normalizeNonEmptyString(value) {
|
|
9
8
|
const trimmed = value?.trim();
|
|
10
9
|
return trimmed ? trimmed : undefined;
|
|
11
10
|
}
|
|
11
|
+
function uniqueNonEmptyPaths(candidatePaths) {
|
|
12
|
+
const seen = new Set();
|
|
13
|
+
const result = [];
|
|
14
|
+
for (const candidatePath of candidatePaths) {
|
|
15
|
+
const normalizedPath = candidatePath.trim();
|
|
16
|
+
if (!normalizedPath || seen.has(normalizedPath)) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
seen.add(normalizedPath);
|
|
20
|
+
result.push(normalizedPath);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
12
24
|
function normalizeTimeout(value) {
|
|
13
25
|
if (typeof value === "number" && Number.isInteger(value) && value > 0) {
|
|
14
26
|
return Math.min(value, MAX_TIMEOUT_MS);
|
|
@@ -31,15 +43,49 @@ function normalizeProfile(value) {
|
|
|
31
43
|
}
|
|
32
44
|
throw new Error(`Unsupported Golutra profile: ${trimmed}`);
|
|
33
45
|
}
|
|
34
|
-
function
|
|
46
|
+
function getDefaultCliCommand(platform) {
|
|
47
|
+
return platform === "win32" ? "golutra-cli.exe" : "golutra-cli";
|
|
48
|
+
}
|
|
49
|
+
function getPathModule(platform) {
|
|
50
|
+
return platform === "win32" ? path.win32 : path.posix;
|
|
51
|
+
}
|
|
52
|
+
function getDefaultCliCandidates(env, platform, homeDirectory) {
|
|
53
|
+
const pathModule = getPathModule(platform);
|
|
35
54
|
if (platform === "darwin") {
|
|
36
|
-
return [
|
|
55
|
+
return uniqueNonEmptyPaths([
|
|
37
56
|
"/Applications/Golutra.app/Contents/MacOS/golutra-cli",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
];
|
|
57
|
+
pathModule.join(homeDirectory, "Applications", "Golutra.app", "Contents", "MacOS", "golutra-cli"),
|
|
58
|
+
getDefaultCliCommand(platform)
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
if (platform === "win32") {
|
|
62
|
+
const localAppData = normalizeNonEmptyString(env.LOCALAPPDATA) ??
|
|
63
|
+
pathModule.join(homeDirectory, "AppData", "Local");
|
|
64
|
+
const programFiles = normalizeNonEmptyString(env.ProgramFiles);
|
|
65
|
+
const programFilesX86 = normalizeNonEmptyString(env["ProgramFiles(x86)"]);
|
|
66
|
+
const cliName = getDefaultCliCommand(platform);
|
|
67
|
+
return uniqueNonEmptyPaths([
|
|
68
|
+
pathModule.join(localAppData, "Programs", "Golutra", cliName),
|
|
69
|
+
...(programFiles ? [pathModule.join(programFiles, "Golutra", cliName)] : []),
|
|
70
|
+
...(programFilesX86
|
|
71
|
+
? [pathModule.join(programFilesX86, "Golutra", cliName)]
|
|
72
|
+
: []),
|
|
73
|
+
cliName
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
if (platform === "linux") {
|
|
77
|
+
const cliName = getDefaultCliCommand(platform);
|
|
78
|
+
return uniqueNonEmptyPaths([
|
|
79
|
+
pathModule.join(homeDirectory, ".local", "bin", cliName),
|
|
80
|
+
pathModule.join(homeDirectory, ".cargo", "bin", cliName),
|
|
81
|
+
"/usr/local/bin/golutra-cli",
|
|
82
|
+
"/usr/bin/golutra-cli",
|
|
83
|
+
"/opt/Golutra/golutra-cli",
|
|
84
|
+
"/app/bin/golutra-cli",
|
|
85
|
+
cliName
|
|
86
|
+
]);
|
|
41
87
|
}
|
|
42
|
-
return [
|
|
88
|
+
return [getDefaultCliCommand(platform)];
|
|
43
89
|
}
|
|
44
90
|
export function resolveDefaultCliPath(env, options = {}) {
|
|
45
91
|
const explicitCliPath = normalizeNonEmptyString(env.GOLUTRA_CLI_PATH);
|
|
@@ -49,8 +95,10 @@ export function resolveDefaultCliPath(env, options = {}) {
|
|
|
49
95
|
const platform = options.platform ?? process.platform;
|
|
50
96
|
const homeDirectory = options.homeDirectory ?? homedir();
|
|
51
97
|
const pathExists = options.pathExists ?? existsSync;
|
|
52
|
-
const candidates = getDefaultCliCandidates(platform, homeDirectory);
|
|
53
|
-
|
|
98
|
+
const candidates = getDefaultCliCandidates(env, platform, homeDirectory);
|
|
99
|
+
const fallbackCommand = getDefaultCliCommand(platform);
|
|
100
|
+
const pathModule = getPathModule(platform);
|
|
101
|
+
return (candidates.find((candidatePath) => pathModule.isAbsolute(candidatePath) && pathExists(candidatePath)) ?? fallbackCommand);
|
|
54
102
|
}
|
|
55
103
|
export function createInitialContext(env) {
|
|
56
104
|
return {
|
package/dist/lib/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/lib/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAO9C,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,cAAc,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/lib/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAO9C,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,SAAS,uBAAuB,CAAC,KAAyB;IACxD,MAAM,OAAO,GAAG,KAAK,EAAE,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QACJ,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RuntimeContextSnapshot } from "./types.js";
|
|
2
|
+
export type DiagnosisReasonCode = "CLI_PATH_NOT_FOUND" | "CLI_NOT_FOUND" | "CLI_TIMEOUT" | "CLI_PROTOCOL_ERROR" | "CLI_COMMAND_FAILED" | "WORKSPACE_PATH_MISSING" | "WORKSPACE_PATH_NOT_FOUND" | "WORKSPACE_PATH_NOT_DIRECTORY" | "WORKSPACE_PATH_INVALID" | "USER_ID_MISSING" | "APP_NOT_RUNNING_OR_PROFILE_MISMATCH" | "APP_COMMAND_FAILED" | "APP_PROBE_SKIPPED";
|
|
3
|
+
export interface DiagnosisCheck {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
skipped?: boolean;
|
|
6
|
+
reasonCode?: DiagnosisReasonCode;
|
|
7
|
+
message?: string;
|
|
8
|
+
error?: Record<string, unknown>;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare function inspectCliPath(cliPath: string): DiagnosisCheck & {
|
|
12
|
+
cliPath: string;
|
|
13
|
+
source: "explicit-path" | "command-from-path";
|
|
14
|
+
exists?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function inspectWorkspacePath(workspacePath: string | undefined): DiagnosisCheck & {
|
|
17
|
+
workspacePath?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function inspectUserId(userId: string | undefined): DiagnosisCheck & {
|
|
20
|
+
userId?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function classifyCliProbeFailure(error: unknown): DiagnosisCheck & {
|
|
23
|
+
nextSteps: string[];
|
|
24
|
+
};
|
|
25
|
+
export declare function classifyAppProbeFailure(error: unknown, runtimeContext: RuntimeContextSnapshot): DiagnosisCheck & {
|
|
26
|
+
nextSteps: string[];
|
|
27
|
+
};
|
|
28
|
+
export declare function buildSkippedAppProbe(reasonCode: DiagnosisReasonCode, message: string): DiagnosisCheck;
|
|
29
|
+
export declare function summarizeDiagnosis(checks: Record<string, DiagnosisCheck>): {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
status: "ok" | "partial" | "error";
|
|
32
|
+
reasonCodes: DiagnosisReasonCode[];
|
|
33
|
+
};
|
|
34
|
+
export declare function mergeNextSteps(stepLists: string[][]): string[];
|