Skip to content

Add outgoing (elicitation, sampling) request and client response events#386

Open
omouren wants to merge 1 commit into
modelcontextprotocol:mainfrom
FrenchFounders:feature/elicit-lifecycle-events
Open

Add outgoing (elicitation, sampling) request and client response events#386
omouren wants to merge 1 commit into
modelcontextprotocol:mainfrom
FrenchFounders:feature/elicit-lifecycle-events

Conversation

@omouren

@omouren omouren commented Jun 24, 2026

Copy link
Copy Markdown

Introduce OutgoingRequestEvent and ClientResponseEvent to provide full observability over the server's interaction with the client. This includes requests sent by the server (e.g., elicitation, sampling) and the client's replies to those requests.

Additionally, update ResponseEvent and ErrorEvent to be dispatched when a suspended Fiber completes. This ensures that deferred responses from long-running, asynchronous operations are also observable via the existing event mechanisms.

Motivation and Context

We wanted to be able to log every step of our MCP usage, including elicitation.

How Has This Been Tested?

Tested manualy

Breaking Changes

No breaking changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Introduce `OutgoingRequestEvent` and `ClientResponseEvent` to provide full
observability over the server's interaction with the client. This includes
requests sent by the server (e.g., elicitation, sampling) and the client's
replies to those requests.

Additionally, update `ResponseEvent` and `ErrorEvent` to be dispatched when
a suspended Fiber completes. This ensures that deferred responses from
long-running, asynchronous operations are also observable via the existing
event mechanisms.
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