Troubleshooting Guide
Authentication Errors
"Authentication required: missing OAuth token"
# Make sure you're sending the header
curl -H "Authorization: Bearer <token>" https://server.com/mcpstreamable := mcpserver.NewStreamableHTTPServer(
mcpServer,
mcpserver.WithHTTPContextFunc(oauth.CreateHTTPContextFunc()), // Required!
)✅ Authorization: Bearer eyJhbGc...
❌ Authorization: eyJhbGc... (missing "Bearer ")
❌ authorization: Bearer ... (lowercase - case-sensitive!)"Authentication failed: invalid token"
Configuration Errors
"invalid config: provider is required"
"invalid config: JWTSecret is required for HMAC provider"
"invalid config: Issuer is required for OIDC provider"
"invalid config: proxy mode requires ClientID"
Provider Errors
"Failed to initialize OIDC provider"
Redirect URI Errors
"Invalid redirect URI" (Native Mode)
"redirect_uri_mismatch" (Provider Error)
Token Caching Issues
Tokens Not Being Cached
Runtime Errors
Panic: "invalid memory address or nil pointer dereference"
"Token exchange failed"
Performance Issues
Slow Authentication
Development vs Production
Works Locally, Fails in Production
Debugging Tips
Enable Verbose Logging
Check OAuth Metadata
Decode JWT Token
Test Token Manually
Still Having Issues?
Common Patterns
Multiple OAuth Providers
Custom Token Claims
Getting Help
Last updated
Was this helpful?