Skip to content

Conversation

@Scra3
Copy link
Member

@Scra3 Scra3 commented Feb 11, 2026

Summary

  • Enhance interceptResponseForErrorLogging to collect response chunks and log the full body when res.statusCode >= 500
  • Catches plain JSON error responses from the MCP SDK that were previously lost (only SSE-format errors were logged)
  • Add unit tests for sse-error-logger.ts covering SSE error logging, HTTP 500 body logging, and passthrough behavior

Test plan

  • All 15 new tests in sse-error-logger.test.ts pass
  • Full @forestadmin/mcp-server test suite passes (502 tests)
  • Lint passes with no new warnings

🤖 Generated with Claude Code

When the MCP SDK writes a 500 response directly (plain JSON, not SSE),
the error details were lost because the existing interceptor only parsed
SSE-format data. This adds chunk collection and HTTP 500+ body logging
so error messages are visible in the logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@qltysh
Copy link

qltysh bot commented Feb 11, 2026

Qlty

Coverage Impact

⬆️ Merging this pull request will increase total coverage on main by 0.05%.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: C Coverage rating: A
packages/mcp-server/src/utils/sse-error-logger.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

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.

1 participant