MCPcopy
hub / github.com/docker/docker-agent / newRemoteToolset

Function newRemoteToolset

pkg/tools/mcp/mcp.go:256–279  ·  view source on GitHub ↗
(
	name, urlString, transport string,
	headers map[string]string,
	oauthConfig *latest.RemoteOAuthConfig,
	allowPrivateIPs bool,
	policy ...lifecycle.Policy,
)

Source from the content-addressed store, hash-verified

254}
255
256func newRemoteToolset(
257 name, urlString, transport string,
258 headers map[string]string,
259 oauthConfig *latest.RemoteOAuthConfig,
260 allowPrivateIPs bool,
261 policy ...lifecycle.Policy,
262) *Toolset {
263 slog.Debug("Creating Remote MCP toolset",
264 "url", urlString,
265 "transport", transport,
266 "headers", headers,
267 "allow_private_ips", allowPrivateIPs,
268 )
269
270 desc := buildRemoteDescription(urlString, transport)
271 ts := &Toolset{
272 name: name,
273 mcpClient: newRemoteClient(urlString, transport, headers, NewKeyringTokenStore(), oauthConfig, allowPrivateIPs),
274 logID: urlString,
275 description: desc,
276 }
277 ts.supervisor = newSupervisor(ts, remotePolicy(firstOrZero(policy)))
278 return ts
279}
280
281func remotePolicy(base lifecycle.Policy) lifecycle.Policy {
282 if base.Restart == lifecycle.RestartOnFailure {

Callers 2

NewRemoteToolsetFunction · 0.85

Calls 7

buildRemoteDescriptionFunction · 0.85
newRemoteClientFunction · 0.85
newSupervisorFunction · 0.85
remotePolicyFunction · 0.85
firstOrZeroFunction · 0.85
DebugMethod · 0.80
NewKeyringTokenStoreFunction · 0.70

Tested by

no test coverage detected