MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / resolveAgentMcpEnv

Function resolveAgentMcpEnv

sdk/src/agents/load-agents.ts:73–81  ·  view source on GitHub ↗
(agent: AgentDefinition)

Source from the content-addressed store, hash-verified

71 * @throws Error if any referenced environment variable is missing
72 */
73export function resolveAgentMcpEnv(agent: AgentDefinition): void {
74 if (!agent.mcpServers) return
75
76 for (const [serverName, config] of Object.entries(agent.mcpServers)) {
77 if ('command' in config && config.env) {
78 config.env = resolveMcpEnv(config.env, agent.id, serverName)
79 }
80 }
81}
82
83/**
84 * Validation error for an agent that failed validation.

Callers 1

loadLocalAgentsFunction · 0.85

Calls 1

resolveMcpEnvFunction · 0.70

Tested by

no test coverage detected