@a4hgehad/weave-mcp 0.9.7 → 0.9.9

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 +19 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -513,8 +513,15 @@ 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
+ let mcpsToApply;
519
+ if (userMcps && userMcps.length > 0) {
520
+ mcpsToApply = userMcps;
521
+ } else {
522
+ mcpsToApply = getAgentMcpDefaults(agentName);
523
+ }
524
+ if (mcpsToApply.length === 0) {
518
525
  return agentConfig;
519
526
  }
520
527
  const mcpTools = {
@@ -522,7 +529,16 @@ class ConfigHandler {
522
529
  context7: "context7_query_docs",
523
530
  grep_app: "grep_app_search"
524
531
  };
525
- const mcpInfo = this.buildMcpInfoSection(defaults);
532
+ const mcpToolEntries = {};
533
+ for (const mcp of mcpsToApply) {
534
+ const toolName = mcpTools[mcp];
535
+ if (toolName) {
536
+ mcpToolEntries[toolName] = true;
537
+ }
538
+ }
539
+ const existingTools = agentConfig.tools || {};
540
+ const mergedTools = { ...existingTools, ...mcpToolEntries };
541
+ const mcpInfo = this.buildMcpInfoSection(mcpsToApply);
526
542
  let prompt = agentConfig.prompt || "";
527
543
  if (!prompt.includes("<MCPs>")) {
528
544
  prompt = prompt + `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a4hgehad/weave-mcp",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "Weave — lean OpenCode plugin with multi-agent orchestration + MCP support",
5
5
  "author": "3r3bu5",
6
6
  "license": "MIT",