From 17ac0f3014c2a118e9caa0d209c5034f89c16a49 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Thu, 26 Mar 2026 15:19:27 -0700 Subject: [PATCH] Trim whitespace from token file in CLI Token files with trailing newlines caused gRPC "non-printable ASCII characters" errors in the authorization header. Co-Authored-By: Claude Opus 4.6 (1M context) --- cmd/mcp/dial.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/mcp/dial.go b/cmd/mcp/dial.go index 65e16de..32cd6d9 100644 --- a/cmd/mcp/dial.go +++ b/cmd/mcp/dial.go @@ -6,6 +6,7 @@ import ( "crypto/x509" "fmt" "os" + "strings" mcpv1 "git.wntrmute.dev/kyle/mcp/gen/mcp/v1" "git.wntrmute.dev/kyle/mcp/internal/config" @@ -68,5 +69,5 @@ func loadBearerToken(cfg *config.CLIConfig) (string, error) { if err != nil { return "", fmt.Errorf("read token from %q: %w (run 'mcp login' first)", cfg.Auth.TokenPath, err) } - return string(token), nil + return strings.TrimSpace(string(token)), nil }