Skip to content

Commit 790b367

Browse files
authored
Merge pull request #243 from dgageot/stdio-over-tcp
The remote MCP is stdio over TCP, not proper remote
2 parents 07dbc4d + 2486fcf commit 790b367

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ FROM scratch AS cross
4545
COPY --from=builder /binaries .
4646

4747
FROM alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
48+
RUN apk add --no-cache curl socat
4849
ARG TARGETOS TARGETARCH
4950
COPY --from=builder /binaries/cagent-$TARGETOS-$TARGETARCH /cagent
5051
RUN mkdir /data

pkg/teamloader/teamloader.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,7 @@ func getToolsForAgent(ctx context.Context, a *latest.AgentConfig, parentDir stri
305305
case toolset.Type == "mcp" && toolset.Ref != "":
306306
mcpServerName := gateway.ParseServerRef(toolset.Ref)
307307
if mcpServerURL := os.Getenv(mcp.ENV_DOCKER_MCP_URL_PREFIX + mcpServerName); mcpServerURL != "" {
308-
// This MCP server is configured at runtime to be remote. We connect to it directly over http.
309-
toolset, err := mcp.NewToolsetRemote(mcpServerURL, "streaming", nil, toolset.Tools, "")
310-
if err != nil {
311-
return nil, fmt.Errorf("connecting to remote MCP Server: %w", err)
312-
}
313-
t = append(t, toolset)
308+
t = append(t, mcp.NewToolsetCommand("socat", []string{"STDIO", fmt.Sprintf("TCP:mcp-%s:4444", mcpServerName)}, nil, toolset.Tools))
314309
} else {
315310
t = append(t, mcp.NewGatewayToolset(mcpServerName, toolset.Config, toolset.Tools, envProvider))
316311
}

0 commit comments

Comments
 (0)