Skip to content

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Oct 21, 2025

Summary

Updates pkg/registry/upstream.go and pkg/registry/upstream_conversion.go to match the latest MCP community registry schema format (v1.3.3, 2025-10-17 schema version).

Major Schema Changes

Structure Changes

  • Flattened top-level structure: Removed nested Server object; fields like Name, Description, Version are now directly on UpstreamServerDetail
  • Transport moved into packages: Each package now has its own transport configuration (was previously top-level)
  • Extension metadata reorganized: Changed from x-publisher.x-dev.toolhive to _meta with reverse DNS namespacing

New Fields

  • Schema ($schema) for JSON Schema URI
  • Title for human-readable display name
  • WebsiteURL for documentation links
  • Icons array for UI display
  • Subfolder in repository for monorepo support
  • RegistryBaseURL and Identifier in packages
  • FileSha256 for MCPB package integrity verification

Package Type Support

  • NPM: Fixed scoped package parsing (@scope/name@version)
  • NPM: Fixed unscoped package version parsing ([email protected])
  • NuGet: Added support with dnx:// protocol
  • MCPB: Added support for MCP Bundle packages with URL-based distribution

Bug Fixes

  • Fixed NPM unscoped package parsing (e.g., npx://[email protected])
  • Added missing test coverage for NPM package variants (scoped, unscoped with/without version)

Operator Integration

Updated the Kubernetes operator integration:

  • cmd/thv-operator/pkg/sources/types.go - Uses new flattened structure
  • cmd/thv-operator/pkg/sources/testutils.go - Updated test builders
  • Test utilities and test data updated to match new schema

Testing

  • ✅ All unit tests pass (pkg/registry/... and cmd/thv-operator/pkg/sources/...)
  • ✅ Linter clean (fixed goconst and line length violations)
  • ✅ Added comprehensive test coverage for NPM package variants
  • ✅ Added roundtrip conversion test for unscoped NPM packages

References

🤖 Generated with Claude Code

This updates pkg/registry/upstream.go and pkg/registry/upstream_conversion.go
to match the latest MCP community registry schema format (v1.3.3).

Major schema changes implemented:
- Flattened top-level structure (removed nested Server object)
- Transport configuration moved into each package
- Extension metadata reorganized (_meta with reverse DNS namespacing)
- Added new fields: Schema, Title, WebsiteURL, Icons, Subfolder
- Package structure updated: RegistryName→RegistryType, added RegistryBaseURL,
  Identifier, FileSha256
- Added support for new package types: NuGet (dnx://), MCPB bundles

Bug fixes:
- Fixed NPM unscoped package parsing (e.g., npx://[email protected])
- Added comprehensive test coverage for all NPM package variants

Operator integration:
- Updated cmd/thv-operator/pkg/sources to use new flattened structure
- Updated test utilities and test data to match new schema

Schema reference: https://github.com/modelcontextprotocol/registry/releases/tag/v1.3.3

All tests pass. Linter clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 82.53968% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.40%. Comparing base (a1b5c08) to head (f1e3e21).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/registry/upstream_conversion.go 82.55% 26 Missing and 4 partials ⚠️
cmd/thv-operator/pkg/sources/types.go 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2278      +/-   ##
==========================================
+ Coverage   54.20%   54.40%   +0.20%     
==========================================
  Files         225      227       +2     
  Lines       29866    30171     +305     
==========================================
+ Hits        16188    16414     +226     
- Misses      12513    12576      +63     
- Partials     1165     1181      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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