Remove git MCP server: package doesn't exist on npm, git CLI suffices
@modelcontextprotocol/server-git is not published to npm (it's a Python package). Agents already have git installed and can use it directly, so the MCP wrapper is unnecessary.
This commit is contained in:
@@ -45,7 +45,6 @@ COPY --from=gitea-mcp-builder /usr/local/bin/gitea-mcp /usr/local/bin/gitea-mcp
|
|||||||
RUN npm install -g \
|
RUN npm install -g \
|
||||||
@modelcontextprotocol/server-postgres \
|
@modelcontextprotocol/server-postgres \
|
||||||
@modelcontextprotocol/server-filesystem \
|
@modelcontextprotocol/server-filesystem \
|
||||||
@modelcontextprotocol/server-git \
|
|
||||||
kubernetes-mcp-server
|
kubernetes-mcp-server
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
|
|||||||
@@ -1,10 +1,23 @@
|
|||||||
|
import { existsSync } from "node:fs";
|
||||||
import { mkdir, writeFile } from "node:fs/promises";
|
import { mkdir, writeFile } from "node:fs/promises";
|
||||||
import { join } from "node:path";
|
import { join, resolve } from "node:path";
|
||||||
import { getRawCredentialsByProvider } from "./credentials";
|
import { getRawCredentialsByProvider } from "./credentials";
|
||||||
import type { AgentRuntime } from "./agents";
|
import type { AgentRuntime } from "./agents";
|
||||||
|
|
||||||
const DEFAULT_GITEA_URL = "http://gitea.platform.svc:3000";
|
const DEFAULT_GITEA_URL = "http://gitea.platform.svc:3000";
|
||||||
|
|
||||||
|
/** Resolve the harness MCP server script — prefer compiled bundle, fall back to source + tsx. */
|
||||||
|
function resolveHarnessMcp(): { command: string; args: string[] } {
|
||||||
|
// Compiled bundle from `scripts/build-mcp.mjs` (production)
|
||||||
|
const bundled = resolve(__dirname, "../../dist/mcp-server.mjs");
|
||||||
|
if (existsSync(bundled)) {
|
||||||
|
return { command: "node", args: [bundled] };
|
||||||
|
}
|
||||||
|
// Source file via tsx (development)
|
||||||
|
const source = resolve(__dirname, "../mcp-server.ts");
|
||||||
|
return { command: "npx", args: ["tsx", source] };
|
||||||
|
}
|
||||||
|
|
||||||
interface McpServerDef {
|
interface McpServerDef {
|
||||||
command: string;
|
command: string;
|
||||||
args: string[];
|
args: string[];
|
||||||
@@ -57,10 +70,16 @@ async function buildMcpServers(workDir: string): Promise<Record<string, McpServe
|
|||||||
args: [workDir],
|
args: [workDir],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ── Git: always (scoped to worktree) ──
|
// ── Harness: always (knowledge + task orchestration) ──
|
||||||
servers.git = {
|
const harnessEnv: Record<string, string> = {};
|
||||||
command: "mcp-server-git",
|
if (process.env.DATABASE_URL) harnessEnv.DATABASE_URL = process.env.DATABASE_URL;
|
||||||
args: ["--repository", workDir],
|
if (process.env.HARNESS_KNOWLEDGE_DIR) harnessEnv.HARNESS_KNOWLEDGE_DIR = process.env.HARNESS_KNOWLEDGE_DIR;
|
||||||
|
|
||||||
|
const harnessMcp = resolveHarnessMcp();
|
||||||
|
servers.harness = {
|
||||||
|
command: harnessMcp.command,
|
||||||
|
args: harnessMcp.args,
|
||||||
|
env: harnessEnv,
|
||||||
};
|
};
|
||||||
|
|
||||||
return servers;
|
return servers;
|
||||||
|
|||||||
Reference in New Issue
Block a user