Skip to content

ref(mcp): Replace instance patches with middleware - #6764

Merged
alexander-alderman-webb merged 48 commits into
masterfrom
webb/mcp/use-middleware-5
Aug 5, 2026
Merged

ref(mcp): Replace instance patches with middleware#6764
alexander-alderman-webb merged 48 commits into
masterfrom
webb/mcp/use-middleware-5

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Add a middleware instead of wrapping handlers on registration.
All requests go through the middleware, whereas there are multiple ways to register a handler.

Issues

Closes #6986

Reminders

@alexander-alderman-webb
alexander-alderman-webb changed the base branch from webb/mcp/use-middleware-4 to webb/mcp/prompt-arguments July 7, 2026 09:35
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

98904 passed | ⏭️ 6479 skipped | Total: 105383 | Pass Rate: 93.85% | Execution Time: 358m 55s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests 📈 +1
Failed Tests 📉 -1
Skipped Tests

➖ Removed Tests (1)

View removed tests
  • test_continuous_profiler_auto_start_and_stop_sampled_span_streaming[experiment-thread]
    • File: tests.profiler.test_continuous_profiler

All tests are passing successfully.

✅ Patch coverage is 87.14%. Project has 2504 uncovered lines.
✅ Project coverage is 89.94%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/mcp.py 87.14% ⚠️ 18 Missing and 20 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.92%    89.94%    +0.02%
==========================================
  Files          193       193         —
  Lines        24859     24896       +37
  Branches      8962      8978       +16
==========================================
+ Hits         22354     22392       +38
- Misses        2505      2504        -1
- Partials      1414      1432       +18

Generated by Codecov Action

Comment thread sentry_sdk/integrations/mcp.py
Comment thread sentry_sdk/integrations/mcp.py Outdated
Base automatically changed from webb/mcp/prompt-arguments to master July 28, 2026 11:52
Comment thread sentry_sdk/integrations/mcp.py Outdated
Comment thread sentry_sdk/integrations/mcp.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0f0450b. Configure here.

Comment thread sentry_sdk/integrations/mcp.py
@alexander-alderman-webb
alexander-alderman-webb merged commit 42f6b8e into master Aug 5, 2026
265 of 268 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/mcp/use-middleware-5 branch August 5, 2026 16:36
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
Add middleware instead of wrapping handlers on registration.
All requests go through the middleware, whereas there are multiple ways to register a handler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants