export async function listConfiguredMcpServers(): Promise<ConfigMcpReadResult> { const snapshot = await readSourceConfigSnapshot(); if (!snapshot.valid) { return {
ok: false,
path: snapshot.path,
error: "Config file is invalid; fix it before using MCP config commands.",
};
} const sourceConfig = snapshot.sourceConfig ?? snapshot.resolved; return {
ok: true,
path: snapshot.path,
config: structuredClone(sourceConfig),
mcpServers: normalizeConfiguredMcpServers(sourceConfig.mcp?.servers),
baseHash: snapshot.hash,
};
}
export async function setConfiguredMcpServer(params: {
name: string;
server: unknown;
}): Promise<ConfigMcpWriteResult> { const name = params.name.trim(); if (!name) { return { ok: false, path: "", error: "MCP server name is required." };
} if (!isRecord(params.server)) { return { ok: false, path: "", error: "MCP server config must be a JSON object." };
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.