Skip to content

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Oct 15, 2025

  • Add StreamableMcpAnnotations2IT integration test covering:

    • Tool execution with progress notifications
    • Sampling and elicitation capabilities
    • Structured output support with CallToolResult
    • Resource and prompt handling
    • Completion functionality
    • Logging notifications
    • Client-server bidirectional communication
  • Refactor documentation to use McpSyncRequestContext/McpAsyncRequestContext:

    • Replace McpSyncServerExchange/McpAsyncServerExchange examples
    • Add convenient helper methods (info(), progress(), ping(), elicit(), sample())
    • Update examples to show unified context API usage
    • Document capability checking (elicitEnabled(), sampleEnabled(), rootsEnabled())
  • Add method filtering policies documentation:

    • Explain sync vs async method filtering behavior
    • Document stateful vs stateless filtering rules
    • Provide best practices for method filtering
  • Improve special parameters documentation:

    • Update to show unified request context usage patterns
    • Add examples of accessing progress token via context
    • Document limitations of stateless servers
    • Show capability-aware implementation patterns
    • Note that McpSyncRequestContext/McpAsyncRequestContext work with both stateful and stateless modes

The unified context API provides a cleaner, more intuitive interface for MCP operations and works seamlessly with both stateful and stateless server configurations.

…ation

- Add StreamableMcpAnnotations2IT integration test covering:
  - Tool execution with progress notifications
  - Sampling and elicitation capabilities
  - Structured output support with CallToolResult
  - Resource and prompt handling
  - Completion functionality
  - Logging notifications
  - Client-server bidirectional communication

- Refactor documentation to use McpSyncRequestContext/McpAsyncRequestContext:
  - Replace McpSyncServerExchange/McpAsyncServerExchange examples
  - Add convenient helper methods (info(), progress(), ping(), elicit(), sample())
  - Update examples to show unified context API usage
  - Document capability checking (elicitEnabled(), sampleEnabled(), rootsEnabled())

- Add method filtering policies documentation:
  - Explain sync vs async method filtering behavior
  - Document stateful vs stateless filtering rules
  - Provide best practices for method filtering

- Improve special parameters documentation:
  - Update to show unified request context usage patterns
  - Add examples of accessing progress token via context
  - Document limitations of stateless servers
  - Show capability-aware implementation patterns
  - Note that McpSyncRequestContext/McpAsyncRequestContext work with both stateful and stateless modes

The unified context API provides a cleaner, more intuitive interface for MCP operations
and works seamlessly with both stateful and stateless server configurations.

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov added this to the 1.1.0.M4 milestone Oct 15, 2025
@tzolov tzolov added the MCP label Oct 15, 2025
@ilayaperumalg ilayaperumalg self-assigned this Oct 15, 2025
// Progress notifications
if (progressToken != null) {
context.progress(50); // Simple percentage
Copy link
Member

Choose a reason for hiding this comment

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

This example should be changed to clarify that progress is not necessarily a percentage (eg add total=100)

**Stateless servers do not support bidirectional operations:**

* `roots()` - Not available
* `elicit()` - Not available
Copy link
Member

Choose a reason for hiding this comment

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

I think those should be named elicitation() and sampling() (same for the Enabled variations below)

// Check if elicitation is supported before using it
if (context.elicitEnabled()) {
// Safe to use elicitation
var result = context.elicit(UserInfo.class);
Copy link
Member

Choose a reason for hiding this comment

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

What happens if the client doesn't support elicitation? Could we make it a NOOP (with warning)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will throw runtime exception and propagate it back to the client that called the tool, resource, prompt, complete handler that uses elicit internally.
Also It doesn't make much sense to ignore the elicit call with NOOP. For example a tool call handler may use elicit to get additional info, like user consent to apply some action. The NOOP can provide a default declined response. Is this desired.

Anyway we can make this configurable strategy and have NOOP as an option. But in a follow up issue

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov
Copy link
Contributor Author

tzolov commented Oct 16, 2025

thanks @ericbottard , pushed an update

@ilayaperumalg
Copy link
Member

LGTM, rebased, squashed and merged as 3e6084c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants