feat: namespace parsing validation#218
feat: namespace parsing validation#218aphansal123 wants to merge 41 commits intoremote-verificationfrom
Conversation
… domain verification
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t package structure
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ure/dns-record-verification
Co-authored-by: Trent Jones <57182095+trent-j@users.noreply.github.com>
…ure/dns-record-verification
…e/dns-record-verification
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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 |
| "strings" | ||
|
|
||
| "github.com/santhosh-tekuri/jsonschema/v5" | ||
| jsonschema "github.com/santhosh-tekuri/jsonschema/v5" |
There was a problem hiding this comment.
[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" |
| "strings" | ||
|
|
||
| "github.com/santhosh-tekuri/jsonschema/v5" | ||
| jsonschema "github.com/santhosh-tekuri/jsonschema/v5" |
There was a problem hiding this comment.
[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" |
| // 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.
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.
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.
I am a bit confused by the "legacy format" here - what is this for?
There was a problem hiding this comment.
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.
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 formatsAfter: // 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 formatsThe 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 <aphansal123@users.noreply.github.com>
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/utilityio.github.*patterns still workBreaking Changes
Non-breaking changes:
statusfield is optional and defaults to"active"Future breaking change preparation:
Types of changes
Checklist
Additional context
Key Implementation Details
internal/namespacepackage handles all domain-scoped namespace parsing and validationServerStatusenum withactiveanddeprecatedvalues across models, schemas, and examplesFuture Work
server-name-verification.md)Files Changed