E53F [SEP-1575] changes to introduce Tool Versions by malaykurwa · Pull Request #1602 · modelcontextprotocol/modelcontextprotocol · GitHub
[go: up one dir, main page]

Skip to content

Conversation

malaykurwa
Copy link

This PR adds tool versioning support to the MCP specification as defined in SEP-1575, enabling servers to declare
semantic versions for their tools and allowing clients to specify version constraints when making tool calls.

Motivation and Context

Currently, MCP tools lack versioning support, which can lead to breaking changes when tools are updated. This creates instability for clients that depend on specific tool behaviors. The tool
versioning specification addresses this by:

  • Preventing Breaking Changes: Clients can specify version constraints to ensure compatibility
  • Semantic Versioning: Tools can declare versions following SemVer 2.0.0 standard
  • Backwards Compatibility: Existing un-versioned tools continue to work normally
  • Clear Error Handling: Provides standardized error responses when version requirements cannot be satisfied
    This specification change enables the ecosystem to evolve safely while maintaining stability for existing implementations.

How Has This Been Tested?

The specification changes have been validated through:

  • Schema Validation: JSON Schema validates the new optional fields correctly
  • Implementation Testing: Companion Python SDK implementation demonstrates full functionality Draft PR
  • Documentation Review: Comprehensive examples and usage patterns documented
  • Backwards Compatibility: Verified that existing implementations continue to work without modification
    The companion implementation in the Python SDK includes comprehensive tests covering version parsing, constraint satisfaction, and error handling scenarios.

Breaking Changes

No breaking changes - This specification update is fully backwards compatible:

  • All new fields are optional
  • Existing tools without version fields continue to work normally
  • Legacy clients without version requirements use the latest available version
  • Existing implementations require no modifications
  • New functionality is purely additive

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

Schema Changes

Tool Definition Updates:

  • Added optional version field to Tool schema
  • Field follows Semantic Versioning 2.0.0 standard
  • Supports pre-release versions (e.g., "1.0.0-alpha.1")
    Tool Call Request Updates:
  • Added optional tool_requirements field to tool call requests
  • Supports version constraint operators: ^, ~, >, >=, <, <=, exact versions
  • Follows conventions from modern package managers (npm, pip, etc.)

Version Constraint Syntax

The specification supports familiar version constraint operators:

  • Caret (^): Allows non-breaking updates (^1.2.3>=1.2.3 <2.0.0)
  • Tilde (~): Allows patch-level updates (~1.2.3>=1.2.3 <1.3.0)
  • Comparison Operators: >, >=, <, <=
  • Exact Version: "1.2.3" (no operator)

Files Modified

  • schema/draft/schema.json - Added version fields to Tool and tool call request schemas
  • docs/specification/draft/server/tools.mdx - Updated documentation with versioning examples and usage patterns

Implementation Status

This specification change is accompanied by a complete implementation in the Python SDK that demonstrates:

  • Server-side tool version registration
  • Client-side version constraint handling
  • Error handling for unsatisfied version requirements
  • Comprehensive test coverage
    The specification provides the foundation for tool versioning across all MCP implementations while maintaining full backwards compatibility with existing deployments.

- Add optional 'version' field to Tool schema following SemVer 2.0.0
- Add optional 'tool_requirements' field to tool call requests
- Support version constraint operators (^, ~, >, >=, <, <=, exact)
- Update documentation with tool versioning examples and usage
- Enable clients to specify version requirements for tool calls
- Maintain backwards compatibility with existing implementations
@dsp-ant dsp-ant added proposal SEP proposal without a sponsor. SEP labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal SEP proposal without a sponsor. SEP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0