metheus-governance-mcp-cli 0.2.28 → 0.2.30
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/README.md +3 -1
- package/cli.mjs +48 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,7 +93,9 @@ Checks:
|
|
|
93
93
|
`setup` auto-registers this server for `codex`, `claude`, `gemini`, `antigravity`, and `cursor` when those CLIs are available.
|
|
94
94
|
|
|
95
95
|
Antigravity note:
|
|
96
|
-
- this CLI manages MCP registration via Antigravity local config
|
|
96
|
+
- this CLI manages MCP registration via Antigravity local config because Antigravity does not provide full `mcp list/get/remove` subcommands.
|
|
97
|
+
- primary config path: `~/.gemini/antigravity/mcp_config.json`
|
|
98
|
+
- legacy mirror path: `%APPDATA%/Antigravity/User/mcp.json` (Windows) for compatibility
|
|
97
99
|
- for compatibility across Antigravity variants, setup writes both `mcpServers` and `servers` keys.
|
|
98
100
|
- proxy stdio now supports both `Content-Length` framed MCP and JSONL input for VS Code-family clients.
|
|
99
101
|
|
package/cli.mjs
CHANGED
|
@@ -86,7 +86,15 @@ function resolveHomeFilePath(relativePath) {
|
|
|
86
86
|
return path.join(home, relativePath);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
function
|
|
89
|
+
function antigravityPrimaryMcpConfigFilePath() {
|
|
90
|
+
const home = String(process.env.USERPROFILE || process.env.HOME || "").trim();
|
|
91
|
+
if (home) {
|
|
92
|
+
return path.join(home, ".gemini", "antigravity", "mcp_config.json");
|
|
93
|
+
}
|
|
94
|
+
return path.resolve(process.cwd(), ".gemini", "antigravity", "mcp_config.json");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function antigravityLegacyMcpConfigFilePath() {
|
|
90
98
|
const home = String(process.env.USERPROFILE || process.env.HOME || "").trim();
|
|
91
99
|
if (process.platform === "win32") {
|
|
92
100
|
const appData = String(process.env.APPDATA || "").trim();
|
|
@@ -110,19 +118,35 @@ function antigravityMcpConfigFilePath() {
|
|
|
110
118
|
return path.resolve(process.cwd(), ".antigravity", "mcp.json");
|
|
111
119
|
}
|
|
112
120
|
|
|
121
|
+
function antigravityMcpConfigFilePaths() {
|
|
122
|
+
const seen = new Set();
|
|
123
|
+
const out = [];
|
|
124
|
+
const pushUnique = (value) => {
|
|
125
|
+
const normalized = String(value || "").trim();
|
|
126
|
+
if (!normalized || seen.has(normalized)) return;
|
|
127
|
+
seen.add(normalized);
|
|
128
|
+
out.push(normalized);
|
|
129
|
+
};
|
|
130
|
+
pushUnique(antigravityPrimaryMcpConfigFilePath());
|
|
131
|
+
pushUnique(antigravityLegacyMcpConfigFilePath());
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
|
|
113
135
|
function loadAntigravityMcpConfig() {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
136
|
+
const candidatePaths = antigravityMcpConfigFilePaths();
|
|
137
|
+
for (const filePath of candidatePaths) {
|
|
138
|
+
try {
|
|
139
|
+
const raw = fs.readFileSync(filePath, "utf8");
|
|
140
|
+
const parsed = tryJsonParse(raw);
|
|
141
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
142
|
+
return { filePath, config: parsed };
|
|
143
|
+
}
|
|
144
|
+
} catch {
|
|
145
|
+
// no-op
|
|
120
146
|
}
|
|
121
|
-
} catch {
|
|
122
|
-
// no-op
|
|
123
147
|
}
|
|
124
148
|
return {
|
|
125
|
-
filePath,
|
|
149
|
+
filePath: candidatePaths[0] || antigravityPrimaryMcpConfigFilePath(),
|
|
126
150
|
config: {
|
|
127
151
|
mcpServers: {},
|
|
128
152
|
servers: {},
|
|
@@ -131,13 +155,24 @@ function loadAntigravityMcpConfig() {
|
|
|
131
155
|
}
|
|
132
156
|
|
|
133
157
|
function saveAntigravityMcpConfig(filePath, config) {
|
|
158
|
+
const primaryPath = String(filePath || "").trim();
|
|
159
|
+
if (!primaryPath) return false;
|
|
160
|
+
const mirrorPaths = antigravityMcpConfigFilePaths().filter((item) => item !== primaryPath);
|
|
134
161
|
try {
|
|
135
|
-
fs.mkdirSync(path.dirname(
|
|
136
|
-
fs.writeFileSync(
|
|
137
|
-
return true;
|
|
162
|
+
fs.mkdirSync(path.dirname(primaryPath), { recursive: true });
|
|
163
|
+
fs.writeFileSync(primaryPath, `${JSON.stringify(config, null, "\t")}\n`, "utf8");
|
|
138
164
|
} catch {
|
|
139
165
|
return false;
|
|
140
166
|
}
|
|
167
|
+
for (const extraPath of mirrorPaths) {
|
|
168
|
+
try {
|
|
169
|
+
fs.mkdirSync(path.dirname(extraPath), { recursive: true });
|
|
170
|
+
fs.writeFileSync(extraPath, `${JSON.stringify(config, null, "\t")}\n`, "utf8");
|
|
171
|
+
} catch {
|
|
172
|
+
// best effort mirror for compatibility
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
141
176
|
}
|
|
142
177
|
|
|
143
178
|
function getAntigravityServerEntry(serverName) {
|