Skip to content

Conversation

@peterj
Copy link
Collaborator

@peterj peterj commented Oct 30, 2025

building mcp servers when we run kagent deploy is redundant because those images aren't used anyway when deploying. we create the MCPServer/RemoteMCPServer resource instead.

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Copilot AI review requested due to automatic review settings October 30, 2025 11:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a SkipMCPServers flag to the BuildCfg struct to allow skipping the building of MCP server images during the build process. This is used specifically during deployment to prevent MCP server images from being built when deploying agents.

Key Changes:

  • Added SkipMCPServers boolean field to BuildCfg struct
  • Modified build logic to skip MCP server image building when the flag is set
  • Deploy command now sets SkipMCPServers: true to avoid building MCP servers during deployment

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
go/cli/internal/cli/agent/build.go Added SkipMCPServers field to BuildCfg and updated build logic to conditionally skip MCP server image building based on this flag
go/cli/internal/cli/agent/deploy.go Set SkipMCPServers: true when creating BuildCfg during deployment to prevent MCP server images from being built
Comments suppressed due to low confidence (1)

go/cli/internal/cli/agent/build.go:54

  • The regenerateMcpToolsFile function is called unconditionally when MCP servers exist, even when SkipMCPServers is true. This could cause unnecessary file regeneration during deployment. The regeneration should also be skipped when cfg.SkipMCPServers is true. Consider wrapping this block with !cfg.SkipMCPServers && similar to line 73.
	if manifest != nil && len(manifest.McpServers) > 0 {
		// Regenerate mcp_tools.py to ensure it's up-to-date before building
		if err := regenerateMcpToolsFile(cfg.ProjectDir, manifest, cfg.Config.Verbose); err != nil {
			return fmt.Errorf("failed to regenerate mcp_tools.py: %v", err)
		}
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EItanya EItanya merged commit 8062481 into main Oct 30, 2025
22 checks passed
@EItanya EItanya deleted the peterj/skipmcpbuild branch October 30, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants