Skip to content

feat: add server/discover model types - #943

Closed
howardjohn wants to merge 1 commit into
modelcontextprotocol:mainfrom
howardjohn:john/sep-2575-server-discover
Closed

feat: add server/discover model types#943
howardjohn wants to merge 1 commit into
modelcontextprotocol:mainfrom
howardjohn:john/sep-2575-server-discover

Conversation

@howardjohn

Copy link
Copy Markdown
Contributor

Motivation and Context

Add the SEP-2575 server/discover request and result model, wire it into the JSON-RPC request/result unions, and cover basic serde routing.

This only handles the basic model currently and does not wire up the server/client implementations, which will take some broader work around fallback to initialize etc.

For #869

How Has This Been Tested?

Tested in Agentgateway

Breaking Changes

None

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

Additional context

@howardjohn
howardjohn requested a review from a team as a code ownerJune 29, 2026 16:13
@github-actionsgithub-actionsBot added T-test Testing related changes T-core Core library changes T-handler Handler implementation changes T-model Model/data structure changes labels Jun 29, 2026
@DaleSeo

Copy link
Copy Markdown
Member

@howardjohn Could you please get CI to green? Thanks!

@howardjohn
howardjohnforce-pushed the john/sep-2575-server-discover branch from 7c0c7f2 to 0f7d76eCompareJuly 1, 2026 16:49
@github-actionsgithub-actionsBot added the T-config Configuration file changes label Jul 1, 2026
@howardjohn
howardjohnforce-pushed the john/sep-2575-server-discover branch from 0f7d76e to 33268aaCompareJuly 1, 2026 16:53
@howardjohn

Copy link
Copy Markdown
ContributorAuthor

Shoudl be good now except the SemverCheck, apparently it needs a new major version to add a new enum 🤔

DaleSeo
DaleSeo previously approved these changes Jul 10, 2026

@DaleSeoDaleSeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @howardjohn, sorry for getting to this late. We needed to wrap up the v2 work before jumping into implmenting the new spec. I left a couple of comments.

Shoudl be good now except the SemverCheck, apparently it needs a new major version to add a new enum 🤔

Can you rebase the branch? If it still fails the SemverCheck, make sure the commit message starts with feat!: and explain the breaking changes in the PR description.

Comment threadcrates/rmcp/src/model.rs Outdated
Comment on lines +820 to +828
pub struct DiscoverResult {
pub supported_versions: Vec<ProtocolVersion>,
pub capabilities: ServerCapabilities,
pub server_info: Implementation,
#[serde(skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
#[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
pub meta: Option<Meta>,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The draft schema shows that this struct needs more fields.

Image

https://modelcontextprotocol.io/specification/draft/schema#discoverresult

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebase onto main and use the ResultType introduced by #915.

implResultType{
pubconstCOMPLETE:Self = Self(Cow::Borrowed("complete"));
pubconstINPUT_REQUIRED:Self = Self(Cow::Borrowed("input_required"));

Comment threadcrates/rmcp/src/model.rs Outdated
const_string!(DiscoverRequestMethod = "server/discover");

/// Sent from the client to discover server identity, capabilities, and supported protocol versions.
pub type DiscoverRequest = Request<DiscoverRequestMethod, EmptyObject>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

EmptyObject would allow:

{
"method": "server/discover",
"params": {}
}

Is this intended?

@DaleSeo
DaleSeo self-requested a review July 10, 2026 13:23
@DaleSeo
DaleSeo dismissed their stale reviewJuly 10, 2026 15:20

need to address feedback

@DaleSeoDaleSeo added this to the 2026-07-28 spec milestone Jul 13, 2026
@DaleSeoDaleSeo removed this from the 2026-07-28 spec milestone Jul 13, 2026
@alexhancock

Copy link
Copy Markdown
Contributor

@howardjohn Do you want to continue on this one? We're trying to get everything lined up for 2026-07-28 support so want to know if this branch will proceed with the edits @DaleSeo mentioned or if we should take over. Let us know either way!

@howardjohn
howardjohnforce-pushed the john/sep-2575-server-discover branch from 33268aa to 72f4733CompareJuly 16, 2026 22:02
@github-actionsgithub-actionsBot removed T-config Configuration file changes T-core Core library changes T-handler Handler implementation changes T-model Model/data structure changes labels Jul 16, 2026
Add the SEP-2575 server/discover request and result model.
Wire it into the JSON-RPC request/result unions and cover basic serde routing.
BREAKING CHANGE: Adds variants to public ClientRequest and ServerResult enums.
Fixesmodelcontextprotocol#869
@howardjohn
howardjohnforce-pushed the john/sep-2575-server-discover branch from 72f4733 to 4ec85e1CompareJuly 16, 2026 22:03
@howardjohn

Copy link
Copy Markdown
ContributorAuthor

obsolete by #973

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

Labels

2026-07-28T-testTesting related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@howardjohn@DaleSeo@alexhancock