@a4hgehad/weave-mcp 0.9.6 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +17 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -513,11 +513,18 @@ class ConfigHandler {
513
513
  return result;
514
514
  }
515
515
  applyAgentMcpDefaults(agentName, agentConfig) {
516
- const defaults = getAgentMcpDefaults(agentName);
517
- if (defaults.length === 0) {
516
+ const weaveConfig = agentConfig;
517
+ const userMcps = weaveConfig.mcps ?? weaveConfig.mcp;
518
+ const hasUserTools = agentConfig.tools !== undefined;
519
+ let mcpsToApply;
520
+ if (userMcps && userMcps.length > 0) {
521
+ mcpsToApply = userMcps;
522
+ } else if (hasUserTools) {
518
523
  return agentConfig;
524
+ } else {
525
+ mcpsToApply = getAgentMcpDefaults(agentName);
519
526
  }
520
- if (agentConfig.tools !== undefined) {
527
+ if (mcpsToApply.length === 0) {
521
528
  return agentConfig;
522
529
  }
523
530
  const mcpTools = {
@@ -525,14 +532,16 @@ class ConfigHandler {
525
532
  context7: "context7_query_docs",
526
533
  grep_app: "grep_app_search"
527
534
  };
528
- const tools = {};
529
- for (const mcp of defaults) {
535
+ const mcpToolEntries = {};
536
+ for (const mcp of mcpsToApply) {
530
537
  const toolName = mcpTools[mcp];
531
538
  if (toolName) {
532
- tools[toolName] = true;
539
+ mcpToolEntries[toolName] = true;
533
540
  }
534
541
  }
535
- const mcpInfo = this.buildMcpInfoSection(defaults);
542
+ const existingTools = agentConfig.tools || {};
543
+ const mergedTools = { ...existingTools, ...mcpToolEntries };
544
+ const mcpInfo = this.buildMcpInfoSection(mcpsToApply);
536
545
  let prompt = agentConfig.prompt || "";
537
546
  if (!prompt.includes("<MCPs>")) {
538
547
  prompt = prompt + `
@@ -541,7 +550,7 @@ class ConfigHandler {
541
550
  }
542
551
  return {
543
552
  ...agentConfig,
544
- tools: { ...agentConfig.tools || {}, ...tools },
553
+ tools: mergedTools,
545
554
  prompt
546
555
  };
547
556
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4hgehad/weave-mcp",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Weave — lean OpenCode plugin with multi-agent orchestration + MCP support",
5
5
  "author": "3r3bu5",
6
6
  "license": "MIT",