@@ -14,7 +14,6 @@ import (
1414 "time"
1515
1616 "github.com/docker/cagent/pkg/config"
17- v2 "github.com/docker/cagent/pkg/config/v2"
1817)
1918
2019//go:embed Dockerfile.template
@@ -40,31 +39,6 @@ func BuildDockerImage(ctx context.Context, agentFilePath, dockerImageName string
4039 return err
4140 }
4241
43- // Collect information about MCP servers
44- servers := Servers {
45- MCPServers : map [string ]Server {},
46- }
47-
48- // Make sure the config is compatible with `cagent build`
49- for _ , agent := range cfg .Agents {
50- for i := range agent .Toolsets {
51- toolSet := agent .Toolsets [i ]
52- if toolSet .Type != "mcp" {
53- continue
54- }
55-
56- if toolSet .Command != "" {
57- return fmt .Errorf ("toolset with command \" %s\" can't be used in `cagent build`" , toolSet .Command )
58- }
59-
60- server , err := mcpToolSetToServer (ctx , & toolSet )
61- if err != nil {
62- return err
63- }
64- servers .MCPServers [toolSet .Ref ] = server
65- }
66- }
67-
6842 // Analyze the config to find which secrets are needed
6943 modelNames := config .GatherModelNames (cfg )
7044 mcpServers := config .GatherMCPServerReferences (cfg )
@@ -121,21 +95,3 @@ func BuildDockerImage(ctx context.Context, agentFilePath, dockerImageName string
12195
12296 return buildCmd .Run ()
12397}
124-
125- func mcpToolSetToServer (ctx context.Context , toolSet * v2.Toolset ) (Server , error ) {
126- args , err := mcpServerArgs (ctx , toolSet .Ref , toolSet .Config )
127- if err != nil {
128- return Server {}, err
129- }
130-
131- // TODO(dga): support the config part (probably by appending to the args or by adding env variables)
132- // - type: mcp
133- // ref: docker:ast-grep
134- // config:
135- // path: .
136- // TODO(dga): What's the actual command?
137- return Server {
138- Command : "docker" ,
139- Args : args ,
140- }, nil
141- }
0 commit comments