feat: implement DNS namespace validation and remote URL uniqueness checks (#306)

## Summary

- Add reverse-DNS namespace format validation for server names
(namespace/name)
- Validate remote URLs match the DNS namespace derived from hostname  
- Prevent duplicate remote URLs across different servers
- Support localhost/development URLs without namespace restrictions
- Add comprehensive test coverage for validation logic
- Update database layer to support remote_url filtering

Fixes #180 by ensuring proper namespace governance and preventing URL
conflicts.

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
adam jones 2025-08-26 23:03:38 +01:00 • committed by GitHub
commit 923b2e07b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,7 +186,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
```json
{
"server": {
"name": "com.example/mcp-fs",
"name": "io.modelcontextprotocol.anonymous/mcp-fs",
"description": "Cloud-hosted MCP filesystem server",
"repository": {
"url": "https://github.com/example/remote-fs",
@ -199,7 +199,7 @@ This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcp
"remotes": [
{
"transport_type": "sse",
"url": "http://mcp-fs.example.com/sse"
"url": "http://mcp-fs.anonymous.modelcontextprotocol.io/sse"
}
]
},
@ -418,7 +418,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
```json
{
"server": {
"name": "com.example/hybrid-mcp",
"name": "io.modelcontextprotocol.anonymous/hybrid-mcp",
"description": "MCP server available as both local package and remote service",
"repository": {
"url": "https://github.com/example/hybrid-mcp",
@ -448,7 +448,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
"remotes": [
{
"transport_type": "sse",
"url": "https://mcp.example.com/sse",
"url": "https://mcp.anonymous.modelcontextprotocol.io/sse",
"headers": [
{
"name": "X-API-Key",
@ -466,7 +466,7 @@ The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6.
},
{
"transport_type": "streamable",
"url": "https://mcp.example.com/http"
"url": "https://mcp.anonymous.modelcontextprotocol.io/http"
}
]
},