Skip to content

Conversation

Avish34
Copy link
Contributor

@Avish34 Avish34 commented Sep 10, 2025

Adding validation for version and identifier for packages.

Motivation and Context

While debugging a bug, I found out that we need exact version to be there in package to fetch from npm, otherwise we won't be able to parse the response as it returns all versions. Even if we do, we still need to go and figure out which version have the mcpname associated with while iterating over all versions. So, we should make mandatory to have identifier and version present in the given package object if we want to validate package association with registries.

How Has This Been Tested?

UTs.

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

Additional context

@Avish34
Copy link
Contributor Author

Avish34 commented Sep 10, 2025

@domdomegg / @tadasant please review!

Copy link
Member

@domdomegg domdomegg left a comment

Choose a reason for hiding this comment

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

Thank you! I think we should probably have similar validation on some of the other package types - any chance you'd be up for also looking at those? (e.g. PyPi, Nuget, ...)

@domdomegg domdomegg merged commit adfbfaf into modelcontextprotocol:main Sep 10, 2025
3 checks passed
@Avish34
Copy link
Contributor Author

Avish34 commented Sep 10, 2025

@domdomegg - Happy to take it up!!

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