-
Notifications
You must be signed in to change notification settings - Fork 196
feat: namespace parsing validation #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: remote-verification
Are you sure you want to change the base?
feat: namespace parsing validation #218
Conversation
… domain verification
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…t package structure
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ure/dns-record-verification
Co-authored-by: Trent Jones <[email protected]>
…ure/dns-record-verification
…e/dns-record-verification
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements namespace parsing validation for domain-scoped server names (e.g., com.github/my-server
) and adds server status lifecycle management (active
/deprecated
) to the MCP Metaregistry.
- Introduces comprehensive namespace validation with support for reverse domain notation and reserved namespace protection
- Adds server status field across all models, schemas, and examples to track lifecycle state
- Updates tooling to support the new status parameter in publisher CLI and validation utilities
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
internal/namespace/namespace.go | New package implementing domain-scoped namespace parsing, validation, and reserved domain checking |
internal/namespace/namespace_test.go | Comprehensive test suite for namespace parsing and validation functionality |
internal/model/model.go | Adds ServerStatus enum and status field to Server model |
internal/api/handlers/v0/publish.go | Updates publish handler with namespace validation and domain-based authentication logic |
internal/api/handlers/v0/publish_namespace_test.go | Integration tests for namespace validation in publish handler |
tools/publisher/main.go | Enhances publisher CLI tool with status parameter validation and support |
tools/publisher/server.json | Updates template with new status field |
tools/validate-examples/main.go | Updates expected example count and import alias |
tools/validate-schemas/main.go | Updates import alias for consistency |
docs/server-registry-api/openapi.yaml | Adds status field to OpenAPI schema definition |
docs/server-registry-api/examples.md | Updates all examples with status field |
docs/server-json/schema.json | Adds status field to JSON schema |
docs/server-json/examples.md | Updates examples and adds deprecated server example |
@@ -14,15 +14,15 @@ import ( | |||
"regexp" | |||
"strings" | |||
|
|||
"github.com/santhosh-tekuri/jsonschema/v5" | |||
jsonschema "github.com/santhosh-tekuri/jsonschema/v5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The import alias jsonschema
is redundant since the package name is already jsonschema
. Consider using a more specific alias like schema
or remove the alias entirely to use the default package name.
jsonschema "github.com/santhosh-tekuri/jsonschema/v5" | |
"github.com/santhosh-tekuri/jsonschema/v5" |
Copilot uses AI. Check for mistakes.
@@ -13,7 +13,7 @@ import ( | |||
"path/filepath" | |||
"strings" | |||
|
|||
"github.com/santhosh-tekuri/jsonschema/v5" | |||
jsonschema "github.com/santhosh-tekuri/jsonschema/v5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The import alias jsonschema
is redundant since the package name is already jsonschema
. Consider using a more specific alias like schema
or remove the alias entirely to use the default package name.
jsonschema "github.com/santhosh-tekuri/jsonschema/v5" | |
"github.com/santhosh-tekuri/jsonschema/v5" |
Copilot uses AI. Check for mistakes.
// as the domain might be newly registered or not yet propagated | ||
// This is just a basic sanity check for obvious invalid domains | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DNS lookups can be slow and may block execution. Consider removing this network call during validation or making it optional/async, especially since the comment indicates it's a soft validation that doesn't affect the result.
Copilot uses AI. Check for mistakes.
internal/api/handlers/v0/publish.go
Outdated
http.Error(w, "Invalid namespace: "+err.Error(), http.StatusBadRequest) | ||
return | ||
} | ||
// For legacy formats, we'll allow them to pass through for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused by the "legacy format" here - what is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a skim to me here, it seems like it's referring to "legacy" as Legacy io.github format
, but I agree that's odd; it's not legacy, we intend to support it indefinitely (and in fact have a mechanism to potentially extend it to also support e.g. com.gitlab.{user}
etc. So I'd call it something more like Psuedo-domain io.github format
or Borrowed domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense that this isn't a legacy format, @claude Please fix the comment here to reflect that this is a pseudo-domain io.github format/borrowed domain.
@claude Can you please fix the comment on line 65 in publish.go to reflect that this is a pseudo-domain io.github format/borrowed domain? |
Claude finished @aphansal123's task —— View job I'll help you fix the comment on line 65 in publish.go to properly reflect that this is a pseudo-domain io.github format rather than a legacy format. Todo List
Progress DetailsCompleted! ✅ I've successfully updated the comment on lines 65-66 in Before: // For legacy formats, we'll allow them to pass through for now
// This provides backward compatibility while encouraging new domain-scoped formats After: // For pseudo-domain io.github format/borrowed domain, we'll allow them to pass through
// This provides support for the borrowed io.github domain while encouraging new domain-scoped formats The comment now accurately reflects that Changes committed and pushed to the |
The comment on line 65-66 in publish.go has been updated to clarify that io.github is a pseudo-domain/borrowed domain format rather than a legacy format, as it's intended to be supported indefinitely. Co-authored-by: Ameya Phansalkar <[email protected]>
Closes #22238
Namespace Parsing Validation and Server Status Management
This PR implements namespace parsing validation for domain-scoped server names and adds server status lifecycle management functionality to the MCP Metaregistry.
Motivation and Context
The MCP Metaregistry needs to support domain-scoped namespaces (e.g.,
com.github/my-server
) to prevent namespace squatting and provide better organization. This change introduces:active
/deprecated
) to help users identify maintained vs. unmaintained serverslocalhost
,example
,test
, etc.How Has This Been Tested?
internal/namespace/namespace_test.go
)internal/api/handlers/v0/publish_namespace_test.go
)com.github/my-server
,org.apache.commons/utility
io.github.*
patterns still workBreaking Changes
Non-breaking changes:
status
field is optional and defaults to"active"
Future breaking change preparation:
Types of changes
Checklist
Additional context
Key Implementation Details
internal/namespace
package handles all domain-scoped namespace parsing and validationServerStatus
enum withactive
anddeprecated
values across models, schemas, and examplesFuture Work
server-name-verification.md
)Files Changed