Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Claude works next to an enterprise managed-mcp.json #18706

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/18706/headmerged by maria-rcks View on GitHub

Showing 4 changed files with 44 additions and 3 deletions (loading 1).

x
0 of 4 viewed, 4 left
20 additions and 0 deletionsapps/server/src/provider/Drivers/ClaudeHome.tsModified
View file
@@ -1,5 +1,6 @@
import type { ClaudeSettings } from "@t3tools/contracts";
import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
import * as Path from "effect/Path";
import * as Schema from "effect/Schema";
​
@@ -53,6 +54,25 @@
};
});
​
+/**
+ * Whether an administrator installed Claude Code's `managed-mcp.json`. While it
+ * exists Claude refuses `--strict-mcp-config` and exits before initializing,
+ * but it already ignores user, project and `--mcp-config` servers on its own,
+ * so callers that pass the flag for isolation can drop it. Paths match the
+ * ones Claude Code checks.
+ */
+export const hasClaudeManagedMcpConfig = Effect.fn("hasClaudeManagedMcpConfig")(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const platform = yield* HostProcess.Platform;
+ const managedMcpConfigPath =
+ platform === "darwin"
+ ? "/Library/Application Support/ClaudeCode/managed-mcp.json"
+ : platform === "win32"
+ ? "C:\\Program Files\\ClaudeCode\\managed-mcp.json"
+ : "/etc/claude-code/managed-mcp.json";
+ return yield* fileSystem.exists(managedMcpConfigPath).pipe(Effect.orElseSucceed(() => false));
+});