Skip to content

fix(mcp-auth): remove console.error for expected auth failures#45

Merged
xiaoyijun merged 1 commit intomasterfrom
xiaoyijun-log-12763-silent-mcp-401-error-in-the-terminal
Jan 20, 2026
Merged

fix(mcp-auth): remove console.error for expected auth failures#45
xiaoyijun merged 1 commit intomasterfrom
xiaoyijun-log-12763-silent-mcp-401-error-in-the-terminal

Conversation

@xiaoyijun
Copy link
Copy Markdown
Contributor

Summary

Remove the console.error call in handleBearerAuth that logs every authentication failure.

This error logging was noisy in production environments because unauthenticated requests (e.g., users before login) are expected behavior in OAuth flows, not actual errors. The errors are already properly handled and returned as HTTP 401 responses via handleError().

This follows the common practice in frameworks like Express and Koa, where libraries should not print to console directly but let the application layer handle logging.

Testing

N/A

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@xiaoyijun xiaoyijun requested a review from a team January 20, 2026 01:40
@xiaoyijun xiaoyijun self-assigned this Jan 20, 2026
@xiaoyijun xiaoyijun merged commit 1cb72d3 into master Jan 20, 2026
5 checks passed
@xiaoyijun xiaoyijun deleted the xiaoyijun-log-12763-silent-mcp-401-error-in-the-terminal branch January 20, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants