Skip to content

Commit 73887bf

Browse files
authored
Fix invalid Tavily MCP package name/link in docs and mcp inspect missing servers bug (#24610)
1 parent c816157 commit 73887bf

6 files changed

Lines changed: 36 additions & 15 deletions

File tree

docs/src/content/docs/guides/web-search.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This guide shows how to add web search to workflows using the Tavily Model Conte
99

1010
## Tavily Search
1111

12-
[Tavily](https://tavily.com/) provides AI-optimized search with structured JSON responses, news search capability, and fast response times through the [@tavily/mcp-server](https://github.com/tavily-ai/tavily-mcp-server) MCP server.
12+
[Tavily](https://tavily.com/) provides AI-optimized search with structured JSON responses, news search capability, and fast response times through the [@tavily/mcp](https://github.com/tavily-ai/tavily-mcp) MCP server.
1313

1414
```aw wrap
1515
---
@@ -18,7 +18,7 @@ engine: copilot
1818
mcp-servers:
1919
tavily:
2020
command: npx
21-
args: ["-y", "@tavily/mcp-server"]
21+
args: ["-y", "@tavily/mcp"]
2222
env:
2323
TAVILY_API_KEY: "${{ secrets.TAVILY_API_KEY }}"
2424
allowed: ["search", "search_news"]
@@ -69,6 +69,6 @@ network:
6969
- [AI Engines](/gh-aw/reference/engines/) - Engine capabilities and limitations
7070
- [CLI Commands](/gh-aw/setup/cli/) - CLI commands including `mcp inspect`
7171
- [Model Context Protocol Specification](https://github.com/modelcontextprotocol/specification)
72-
- [Tavily MCP Server](https://github.com/tavily-ai/tavily-mcp-server)
72+
- [Tavily MCP Server](https://github.com/tavily-ai/tavily-mcp)
7373
- [Tavily Documentation](https://tavily.com/)
7474

pkg/cli/mcp_inspect.go

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cli
33
import (
44
"errors"
55
"fmt"
6+
"maps"
67
"os"
78
"os/exec"
89
"path/filepath"
@@ -248,22 +249,36 @@ The command will:
248249
return cmd
249250
}
250251

251-
// buildFrontmatterFromWorkflowData reconstructs a frontmatter map from WorkflowData
252-
// This is used to extract MCP configurations after the compiler has processed imports and merging
252+
// buildFrontmatterFromWorkflowData constructs a fully resolved frontmatter map from WorkflowData.
253+
// It uses RawFrontmatter as the base (for safe-outputs, mcp-scripts, on, etc.) and overlays the
254+
// fully merged tools and mcp-servers so that configurations from imported workflows are included.
255+
// This is critical for `mcp inspect` to display all MCP servers from the main workflow and imports.
253256
func buildFrontmatterFromWorkflowData(workflowData *workflow.WorkflowData) map[string]any {
254-
// Use the parsed frontmatter's ToMap() method if available
255-
// This preserves the original frontmatter structure with imports already merged
256-
if workflowData.ParsedFrontmatter != nil {
257-
return workflowData.ParsedFrontmatter.ToMap()
258-
}
259-
260-
// Fallback to building manually (shouldn't happen in normal cases)
261257
frontmatter := make(map[string]any)
262258

263-
// Add tools section if present
259+
// Start from RawFrontmatter to preserve top-level keys like safe-outputs, mcp-scripts, on, etc.
260+
// Guard against nil (maps.Copy is safe with a nil source, but explicit is clearer).
261+
if workflowData.RawFrontmatter != nil {
262+
maps.Copy(frontmatter, workflowData.RawFrontmatter)
263+
}
264+
265+
// Override tools with the fully merged result (includes built-in tools from imports such as
266+
// github, playwright, and serena). ExtractMCPConfigurations only picks up github/playwright/serena
267+
// from the tools key, so extra user-defined entries here are harmless.
264268
if len(workflowData.Tools) > 0 {
265269
frontmatter["tools"] = workflowData.Tools
266270
}
267271

272+
// Override mcp-servers with the fully merged result (includes user-defined servers from all
273+
// imports). ResolvedMCPServers is set to allMCPServers in processToolsAndMarkdown, which merges
274+
// the main workflow's mcp-servers with every imported workflow's mcp-servers.
275+
if len(workflowData.ResolvedMCPServers) > 0 {
276+
frontmatter["mcp-servers"] = workflowData.ResolvedMCPServers
277+
} else {
278+
// No mcp-servers defined in main workflow or any import; remove any stale key so
279+
// ExtractMCPConfigurations falls through to check tools for built-in MCP tools.
280+
delete(frontmatter, "mcp-servers")
281+
}
282+
268283
return frontmatter
269284
}

pkg/workflow/agent_job_id_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ Test workflow that creates issues.`,
9696

9797
// For workflows with safe-outputs, verify they reference the correct job name
9898
if strings.Contains(tt.workflowContent, "safe-outputs:") {
99-
expectedNeedsLine := "needs: " + tt.expectedJobName
100-
if !strings.Contains(lockContentStr, expectedNeedsLine) {
99+
// The safe_outputs job depends on multiple jobs (activation, agent, detection),
100+
// so the needs value is a YAML list ("- agent") rather than a scalar ("needs: agent").
101+
expectedNeedsItem := "- " + tt.expectedJobName
102+
if !strings.Contains(lockContentStr, expectedNeedsItem) {
101103
t.Errorf("Safe output jobs should depend on '%s' job", tt.expectedJobName)
102104
t.Logf("Lock file content:\n%s", lockContentStr)
103105
}

pkg/workflow/compiler_orchestrator_tools.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var orchestratorToolsLog = logger.New("workflow:compiler_orchestrator_tools")
1616
// toolsProcessingResult holds the results of tools and markdown processing
1717
type toolsProcessingResult struct {
1818
tools map[string]any
19+
resolvedMCPServers map[string]any // fully merged mcp-servers from main workflow and all imports
1920
runtimes map[string]any
2021
toolsTimeout string
2122
toolsStartupTimeout string
@@ -295,6 +296,7 @@ func (c *Compiler) processToolsAndMarkdown(result *parser.FrontmatterResult, cle
295296

296297
return &toolsProcessingResult{
297298
tools: tools,
299+
resolvedMCPServers: allMCPServers,
298300
runtimes: runtimes,
299301
toolsTimeout: toolsTimeout,
300302
toolsStartupTimeout: toolsStartupTimeout,

pkg/workflow/compiler_orchestrator_workflow.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ func (c *Compiler) buildInitialWorkflowData(
209209
SecretMasking: toolsResult.secretMasking,
210210
ParsedFrontmatter: toolsResult.parsedFrontmatter,
211211
RawFrontmatter: result.Frontmatter,
212+
ResolvedMCPServers: toolsResult.resolvedMCPServers,
212213
HasExplicitGitHubTool: toolsResult.hasExplicitGitHubTool,
213214
ActionMode: c.actionMode,
214215
InlinedImports: inlinedImports,

pkg/workflow/compiler_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ type WorkflowData struct {
420420
SecretMasking *SecretMaskingConfig // secret masking configuration
421421
ParsedFrontmatter *FrontmatterConfig // cached parsed frontmatter configuration (for performance optimization)
422422
RawFrontmatter map[string]any // raw parsed frontmatter map (for passing to hash functions without re-parsing)
423+
ResolvedMCPServers map[string]any // fully merged mcp-servers from main workflow and all imports (for mcp inspect)
423424
ActionPinWarnings map[string]bool // cache of already-warned action pin failures (key: "repo@version")
424425
ActionMode ActionMode // action mode for workflow compilation (dev, release, script)
425426
HasExplicitGitHubTool bool // true if tools.github was explicitly configured in frontmatter

0 commit comments

Comments
 (0)