mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 23:01:08 +00:00
* Agents: run bundle MCP tools in embedded Pi * Plugins: fix bundle MCP path resolution * Plugins: warn on unsupported bundle MCP transports * Commands: add embedded Pi MCP management * Config: move MCP management to top-level config
30 lines
977 B
TypeScript
30 lines
977 B
TypeScript
import type { OpenClawConfig } from "../config/config.js";
|
|
import { normalizeConfiguredMcpServers } from "../config/mcp-config.js";
|
|
import type { BundleMcpDiagnostic, BundleMcpServerConfig } from "../plugins/bundle-mcp.js";
|
|
import { loadEnabledBundleMcpConfig } from "../plugins/bundle-mcp.js";
|
|
|
|
export type EmbeddedPiMcpConfig = {
|
|
mcpServers: Record<string, BundleMcpServerConfig>;
|
|
diagnostics: BundleMcpDiagnostic[];
|
|
};
|
|
|
|
export function loadEmbeddedPiMcpConfig(params: {
|
|
workspaceDir: string;
|
|
cfg?: OpenClawConfig;
|
|
}): EmbeddedPiMcpConfig {
|
|
const bundleMcp = loadEnabledBundleMcpConfig({
|
|
workspaceDir: params.workspaceDir,
|
|
cfg: params.cfg,
|
|
});
|
|
const configuredMcp = normalizeConfiguredMcpServers(params.cfg?.mcp?.servers);
|
|
|
|
return {
|
|
// OpenClaw config is the owner-managed layer, so it overrides bundle defaults.
|
|
mcpServers: {
|
|
...bundleMcp.config.mcpServers,
|
|
...configuredMcp,
|
|
},
|
|
diagnostics: bundleMcp.diagnostics,
|
|
};
|
|
}
|