Skip to content

Conversation

@cliffhall
Copy link
Member

@cliffhall cliffhall commented Oct 10, 2025

Description

  • In everything.ts
    • remove the automatic sampling call in the resource handler for SubscribeRequestSchema

Server Details

  • Server: Everything
  • Changes to: resource subscription behavior

Motivation and Context

Sampling and resource subscription are two different things, and although they might be coupled in some implementation, it does not make sense to do so in the Everything server demo. We are trying to demonstrate everything after all, but not imply a coupling between things that need not be, and in fact probably aren't in real use.

BEFORE: Sample on Subscription Experience

sampling-on-subscribe.mov

This is confusing, because the result of pressing that subscription button leads to a message count on the sampling tab, which you follow like a trained monkey to find a sampling message that seems to be asking the client to let the LLM know you've subscribed to something on the server. Why would the LLM need to know that? It's a head scratcher. And you are set to approve a canned but totally unrelated response. That might be a use-case but it's not the most straightforward one.

AFTER: No Sample on Subscription Experience

no-sampling-on-subscribe.mov

When you hit subscribe, the only thing that changes is the tool call shows up in history followed shortly by server notification about a resource update. This illustrates the two important aspects of subscriptions; when you make them, you start receiving notifications about them when they change. And you can unsubscribe to stop them. All on one page without any mental friction about how sampling is tied in and whether that's something you need to understand to use subscriptions.

How Has This Been Tested?

Locally.

Breaking Changes

Nope.

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 Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

* In everything.ts
  - remove the automatic sampling call in the resource handler for SubscribeRequestSchema
@cliffhall cliffhall requested review from evalstate, felixweinberger, ochafik and olaservo and removed request for ochafik October 10, 2025 20:22
@evalstate evalstate merged commit f2dc09d into modelcontextprotocol:main Oct 12, 2025
19 checks passed
@cliffhall cliffhall deleted the fix/do-not-sample-on-subscribe branch October 12, 2025 21:48
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