MCPcopy
hub / github.com/googleapis/mcp-toolbox / WithClientIP

Function WithClientIP

internal/util/util.go:253–255  ·  view source on GitHub ↗

WithClientIP adds a client IP address into the context as a value

(ctx context.Context, clientIP string)

Source from the content-addressed store, hash-verified

251
252// WithClientIP adds a client IP address into the context as a value
253func WithClientIP(ctx context.Context, clientIP string) context.Context {
254 return context.WithValue(ctx, clientIPKey, clientIP)
255}
256
257// ClientIPFromContext retrieves the client IP address or returns false if not present
258func ClientIPFromContext(ctx context.Context) (string, bool) {

Callers 5

toolsCallHandlerFunction · 0.92
toolsCallHandlerFunction · 0.92
toolsCallHandlerFunction · 0.92
toolsCallHandlerFunction · 0.92

Calls

no outgoing calls

Tested by 1