MCPcopy Index your code
hub / github.com/docker/docker-agent / writeConfigToFile

Function writeConfigToFile

pkg/tools/mcp/gateway.go:93–102  ·  view source on GitHub ↗
(_ context.Context, mcpServerName string, config any)

Source from the content-addressed store, hash-verified

91}
92
93func writeConfigToFile(_ context.Context, mcpServerName string, config any) (string, error) {
94 buf, err := yaml.Marshal(map[string]any{
95 mcpServerName: config,
96 })
97 if err != nil {
98 return "", err
99 }
100
101 return writeTempFile("mcp-config-*", buf)
102}
103
104func writeTempFile(nameTemplate string, content []byte) (string, error) {
105 f, err := os.CreateTemp("", nameTemplate)

Callers 1

NewGatewayToolsetFunction · 0.85

Calls 1

writeTempFileFunction · 0.70

Tested by

no test coverage detected