diff --git a/packages/coding-agent/src/discovery/claude-plugins.ts b/packages/coding-agent/src/discovery/claude-plugins.ts index 8c3e8ed4b..50d4dea38 100644 --- a/packages/coding-agent/src/discovery/claude-plugins.ts +++ b/packages/coding-agent/src/discovery/claude-plugins.ts @@ -580,9 +580,7 @@ async function loadMCPServers(ctx: LoadContext): Promise> ...(raw.timeout !== undefined && { timeout: raw.timeout }), ...(rooted.command !== undefined && { command: rooted.command }), ...(raw.args !== undefined && { args: substitutePluginRoot(raw.args, root.path) }), - ...(raw.env !== undefined && { - env: expandEnvVarsDeep(substitutePluginRoot(raw.env, root.path)), - }), + ...(raw.env !== undefined && { env: substitutePluginRoot(raw.env, root.path) }), ...(rooted.cwd !== undefined && { cwd: rooted.cwd }), ...(raw.url !== undefined && { url: expandEnvVarsDeep(raw.url) }), ...(raw.headers !== undefined && { headers: expandEnvVarsDeep(raw.headers) }), diff --git a/packages/coding-agent/test/discovery/claude-plugins.test.ts b/packages/coding-agent/test/discovery/claude-plugins.test.ts index ce99e7fcd..aa28719dd 100644 --- a/packages/coding-agent/test/discovery/claude-plugins.test.ts +++ b/packages/coding-agent/test/discovery/claude-plugins.test.ts @@ -527,7 +527,7 @@ describe("listClaudePluginRoots", () => { ); }); - test("expands env placeholders throughout marketplace plugin MCP configuration", async () => { + test("expands env placeholders in marketplace plugin MCP url and headers", async () => { const pluginsDir = path.join(tempDir, ".claude", "plugins"); const pluginPath = path.join(tempDir, "plugins", "context7"); const originalApiKey = process.env.OMP_PLUGIN_MCP_API_KEY; @@ -566,14 +566,6 @@ describe("listClaudePluginRoots", () => { CONTEXT7_API_KEY: envPlaceholder("OMP_PLUGIN_MCP_API_KEY"), }, }, - local: { - type: "stdio", - command: "${CLAUDE_PLUGIN_ROOT}/bin/server", - env: { - API_KEY: envPlaceholder("OMP_PLUGIN_MCP_API_KEY"), - CONFIG_PATH: "${CLAUDE_PLUGIN_ROOT}/config.json", - }, - }, }), ); @@ -585,12 +577,6 @@ describe("listClaudePluginRoots", () => { expect(server?.url).toBe("https://mcp.context7.example/mcp"); expect(server?.headers).toEqual({ CONTEXT7_API_KEY: "ctx7sk-test-key" }); - const localServer = result.all.find(item => item.name === "context7:local"); - expect(localServer?.command).toBe(path.join(pluginPath, "bin", "server")); - expect(localServer?.env).toEqual({ - API_KEY: "ctx7sk-test-key", - CONFIG_PATH: path.join(pluginPath, "config.json"), - }); } finally { if (originalApiKey === undefined) delete process.env.OMP_PLUGIN_MCP_API_KEY; else process.env.OMP_PLUGIN_MCP_API_KEY = originalApiKey;