Skip to content

fix(mcp): Handle None arguments in tool and prompt handlers - #7387

Merged
alexander-alderman-webb merged 4 commits into
masterfrom
webb/mcp/allow-none-arguments
Sep 7, 2026
Merged

fix(mcp): Handle None arguments in tool and prompt handlers#7387
alexander-alderman-webb merged 4 commits into
masterfrom
webb/mcp/allow-none-arguments

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

Description

Just following the types, arguments can be None. For example:

https://github.com/modelcontextprotocol/python-sdk/blob/d060b36e1d095ef6e93e07ba5d59bb69b2ad449a/src/mcp-types/mcp_types/_types.py#L1449-L1453

The prompt case is recorded in the reported issue.

Issues

Closes #7374

Reminders

@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner September 4, 2026 12:53
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

130572 passed | ⏭️ 7110 skipped | Total: 137682 | Pass Rate: 94.84% | Execution Time: 472m 22s

📊 Comparison with Base Branch

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

➖ Removed Tests (1)

View removed tests
  • test_cache_spans_decorator[True]
    • File: tests.integrations.django.test_cache_module

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2509 uncovered lines.
❌ Project coverage is 90.24%. Comparing base (a5e2c60) to head (feea878).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/mcp.py 100.00% ⚠️ 2 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.27%    90.24%    -0.03%
==========================================
  Files          193       193         —
  Lines        25713     25713         —
  Branches      9494      9494         —
==========================================
+ Hits         23211     23204        -7
- Misses        2502      2509        +7
- Partials      1432      1432         —

Generated by Codecov Action

Base automatically changed from webb/mcp/inline-extract_handler_data_from_args to master September 7, 2026 07:30
Comment thread sentry_sdk/integrations/mcp.py
@alexander-alderman-webb
alexander-alderman-webb merged commit 852b88a into master Sep 7, 2026
164 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/mcp/allow-none-arguments branch September 7, 2026 07:43
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.

MCP integration: prompts/get without arguments crashes with 'NoneType' object has no attribute 'items' (mcp v1 server, positional arguments=None)

2 participants