agent-gate-installer 1.2.0 → 1.3.0

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 (2) hide show
  1. package/bin/install.mjs +21 -0
  2. package/package.json +1 -1
package/bin/install.mjs CHANGED
@@ -122,6 +122,21 @@ function mergeHooks(settings, venvPython) {
122
122
  }
123
123
  }
124
124
 
125
+ function writeMcpJson(venvPython, directory) {
126
+ const mcpJsonPath = join(directory, ".mcp.json");
127
+ const config = {
128
+ mcpServers: {
129
+ "agent-gate": {
130
+ type: "stdio",
131
+ command: venvPython,
132
+ args: [join(INSTALL_DIR, "src", "agent_gate", "server.py")],
133
+ },
134
+ },
135
+ };
136
+ writeFileSync(mcpJsonPath, JSON.stringify(config, null, 4) + "\n", "utf8");
137
+ log(` + Wrote .mcp.json to ${directory}`);
138
+ }
139
+
125
140
  function registerMcpServer(settings, venvPython) {
126
141
  settings.mcpServers = settings.mcpServers || {};
127
142
  settings.mcpServers["agent-gate"] = {
@@ -253,6 +268,12 @@ async function install() {
253
268
  registerMcpServer(settings, venvPython);
254
269
  writeSettings(settings);
255
270
 
271
+ writeMcpJson(venvPython, INSTALL_DIR);
272
+ const cwd = process.cwd();
273
+ if (cwd !== INSTALL_DIR && existsSync(join(cwd, "src", "agent_gate"))) {
274
+ writeMcpJson(venvPython, cwd);
275
+ }
276
+
256
277
  const webPatched = patchWebMcpConfigs(venvPython);
257
278
  if (webPatched > 0) {
258
279
  log(` + Patched ${webPatched} web session MCP config(s) in ${tmpdir()}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-gate-installer",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "One-command installer for agent-gate prompt evaluation gate",
5
5
  "type": "module",
6
6
  "bin": {