Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add cross-harness MCP server manager #4634

Closedm-de-graaff(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/4634/headopened View on GitHub

Showing 30 changed files with 161 additions and 0 deletions (loading 28).

x
0 of 30 viewed, 30 left
161 additions and 0 deletionsapps/server/src/mcpServers/ClaudeMcpConfig.test.tsAdded
View file
@@ -0,0 +1,161 @@
+import * as NodeServices from "@effect/platform-node/NodeServices";
+import { assert, it } from "@effect/vitest";
+import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
+import * as Path from "effect/Path";
+​
+import { readClaudeMcpServers, resolveClaudeMcpConfigFilePath } from "./ClaudeMcpConfig.ts";
+​
+const writeClaudeConfig = Effect.fn(function* (homeDir: string, contents: string) {
+ const fs = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ yield* fs.makeDirectory(homeDir, { recursive: true });
+ yield* fs.writeFileString(path.join(homeDir, ".claude.json"), contents);
+});
+​
+it.layer(NodeServices.layer)("readClaudeMcpServers", (it) => {
+ it.effect("reads declared servers from the instance config directory", () =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-mcp-" });
+ yield* writeClaudeConfig(
+ tempDir,
+ `{
+ "mcpServers": {
+ "codegraph": { "type": "stdio", "command": "codegraph", "args": ["serve", "--mcp"] },
+ "remote": { "type": "http", "url": "https://example.com/mcp" }
+ }
+ }`,
+ );
+​