Skip to content

Conversation

@leehack
Copy link
Owner

@leehack leehack commented Nov 10, 2025

This pull request introduces MCP protocol version 2025-06-18 with major feature updates, improved documentation, and several critical fixes. The most significant addition is support for "elicitation"—server-initiated structured input collection from clients—along with comprehensive documentation enhancements and a critical logging fix to prevent protocol corruption. There are also improvements to test coverage, bug fixes, and API adjustments for better clarity and reliability.

Protocol and Feature Updates

  • Elicitation Support: Adds full support for server-initiated input collection ("elicitation") via the new elicitation/create method, including API methods (McpServer.elicitUserInput()), client handler (Client.onElicitRequest), new types (ElicitRequestParams, ElicitResult, ClientCapabilitiesElicitation), and helpers for common result actions. [1] [2] [3] [4] [5]
  • Protocol Version Update: Updates the protocol version to 2025-06-18 and ensures backward compatibility with previous versions. [1] [2] [3]

Documentation and Examples

  • README Overhaul: Major rewrite of the README.md to clarify the MCP architecture, add detailed guides and documentation links, highlight new features (including elicitation), and provide clearer quick start and platform support information. [1] [2] [3] [4]
  • API Example Updates: Updates code examples to use the new toolInputSchema API and CallToolResult.fromContent for clarity and correctness.

Critical Fixes and Reliability

  • Logger Output Fix: Changes logger output from stdout to stderr to prevent JSON-RPC protocol corruption when using stdio transport. [1] [2]
  • Error Handling Improvements: Ensures that McpError codes are preserved through request handlers and parameter parsing errors are handled correctly. [1] [2]

Test Coverage and Bug Fixes

  • Comprehensive Test Coverage: Adds 203 new tests across multiple protocol phases, increasing overall test coverage from 56.9% to 70.0%.
  • URI Template Bug Fix: Fixes a critical bug involving variable duplication in URI template parsing and expansion, and refactors related code for accuracy. [1] [2] [3] [4]

Minor Improvements

  • Flutter Example Fixes: Corrects usage of DropdownButtonFormField in Flutter client example for proper initial value handling. [1] [2]

These changes collectively bring the SDK up to date with the latest MCP specification, enhance developer experience, and improve overall reliability and maintainability.

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 93.05556% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.01%. Comparing base (1f08bd5) to head (ab9e1bb).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
lib/src/server/mcp.dart 0.00% 7 Missing ⚠️
lib/src/types.dart 98.01% 2 Missing ⚠️
lib/src/shared/uri_template.dart 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #48       +/-   ##
===========================================
+ Coverage   45.55%   70.01%   +24.46%     
===========================================
  Files          15       16        +1     
  Lines        2880     3042      +162     
===========================================
+ Hits         1312     2130      +818     
+ Misses       1568      912      -656     
Flag Coverage Δ
unittests 70.01% <93.05%> (+24.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

leehack and others added 5 commits November 10, 2025 20:08
Achieved +12.1% overall coverage improvement (56.9% → ~69%)

Phase 1: External API Coverage
- Server MCP high-level API: 0% → 56.7% (19 tests)
- URI template system: 0% → 24.3% (55 tests, bug fix included)
- Client elicitation & capability checks (17 tests)
- Server capability assertions (17 tests)

Phase 2: Transport Coverage
- Server stdio transport: 0% → 84.2% (16 tests)
- Server SSE manager: 0% → 66.2% (16 tests)
- Client streamable HTTPS edge cases (6 tests)

Phase 3: Types & Edge Cases
- Types edge cases: 76% → 78% (30 tests)
- Protocol edge cases: 61% → 68% (15 tests)

Total: 191 new tests, all passing (339/339 tests ✅)

Key fixes:
- URI template variable duplication bug
- McpError code preservation in request handlers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 4 completion adds 12 comprehensive tests covering advanced edge cases
and integration scenarios, achieving 70.0% overall coverage (+0.6%).

New Tests Added:
- Protocol Advanced Scenarios (3 tests):
  * Progress notification error handling with invalid token types
  * Request timeout mechanism validation
  * Abort signal cancellation of pending requests

- Streamable HTTPS Integration (9 tests):
  * Exponential backoff reconnection delay calculation
  * Max reconnection attempts preventing infinite retries
  * HTTP request failure handling (500 errors)
  * Network timeout during send operations
  * Authentication flow with missing authProvider
  * Token refresh mechanism validation
  * Malformed SSE data graceful handling
  * Custom reconnection options configuration
  * Unauthorized response handling (401 errors)

Coverage Impact:
- Overall: 69.4% → 70.0% (+0.6%, +17 lines covered)
- Protocol: 68.7% (timeout, abort, progress error handling)
- Client HTTPS: Advanced integration scenarios validated
- Total tests: 351 (all passing ✅)

All Phases Summary:
- Phase 1: External APIs (+108 tests)
- Phase 2: Transport Layer (+38 tests)
- Phase 3: Types & Edge Cases (+45 tests)
- Phase 4: Advanced Scenarios (+12 tests)
- Total improvement: 56.9% → 70.0% (+13.1%, +400 lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@leehack leehack changed the title Elicitation supports v1.0.0 Nov 11, 2025
@leehack leehack merged commit 01dce4e into main Nov 11, 2025
5 checks passed
@leehack leehack deleted the support-elicitation branch November 11, 2025 18:35
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