( name, urlString, transport string, headers map[string]string, oauthConfig *latest.RemoteOAuthConfig, allowPrivateIPs bool, policy ...lifecycle.Policy, )
| 254 | } |
| 255 | |
| 256 | func 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 | |
| 281 | func remotePolicy(base lifecycle.Policy) lifecycle.Policy { |
| 282 | if base.Restart == lifecycle.RestartOnFailure { |
no test coverage detected