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 \
|
||||
@modelcontextprotocol/server-postgres \
|
||||
@modelcontextprotocol/server-filesystem \
|
||||
@modelcontextprotocol/server-git \
|
||||
kubernetes-mcp-server
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { join, resolve } from "node:path";
|
||||
import { getRawCredentialsByProvider } from "./credentials";
|
||||
import type { AgentRuntime } from "./agents";
|
||||
|
||||
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 {
|
||||
command: string;
|
||||
args: string[];
|
||||
@@ -57,10 +70,16 @@ async function buildMcpServers(workDir: string): Promise<Record<string, McpServe
|
||||
args: [workDir],
|
||||
};
|
||||
|
||||
// ── Git: always (scoped to worktree) ──
|
||||
servers.git = {
|
||||
command: "mcp-server-git",
|
||||
args: ["--repository", workDir],
|
||||
// ── Harness: always (knowledge + task orchestration) ──
|
||||
const harnessEnv: Record<string, string> = {};
|
||||
if (process.env.DATABASE_URL) harnessEnv.DATABASE_URL = process.env.DATABASE_URL;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user