googleapis/mcp-toolbox · error

unable to initialize auth service %q: %w

Error message

unable to initialize auth service %q: %w

What it means

Error "unable to initialize auth service %q: %w" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/server.go:146

	for name := range sourcesMap {
		sourceNames = append(sourceNames, name)
	}
	l.InfoContext(ctx, fmt.Sprintf("Initialized %d sources: %s", len(sourcesMap), strings.Join(sourceNames, ", ")))

	// initialize and validate the auth services from configs
	authServicesMap := make(map[string]auth.AuthService)
	for name, sc := range cfg.AuthServiceConfigs {
		a, err := func() (auth.AuthService, error) {
			_, span := instrumentation.Tracer.Start(
				ctx,
				"toolbox/server/auth/init",
				trace.WithAttributes(attribute.String("auth_type", sc.AuthServiceConfigType())),
				trace.WithAttributes(attribute.String("auth_name", name)),
			)
			defer span.End()
			a, err := sc.Initialize()
			if err != nil {
				return nil, fmt.Errorf("unable to initialize auth service %q: %w", name, err)
			}
			return a, nil
		}()
		if err != nil {
			return nil, nil, nil, nil, nil, nil, err
		}
		authServicesMap[name] = a
	}

	authServiceNames := make([]string, 0, len(authServicesMap))
	for name := range authServicesMap {
		authServiceNames = append(authServiceNames, name)
	}
	l.InfoContext(ctx, fmt.Sprintf("Initialized %d authServices: %s", len(authServicesMap), strings.Join(authServiceNames, ", ")))

	// Initialize and validate embedding models from configs.
	embeddingModelsMap := make(map[string]embeddingmodels.EmbeddingModel)
	for name, ec := range cfg.EmbeddingModelConfigs {

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/server.go:146 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/9ae4f0b0eed577c8. Report an issue: GitHub.