Repository navigation
Implement flattened _meta format for server extensions - #331
Conversation
Replace the confusing wrapper format (server + x-* extensions) with a clean flattened format using structured _meta fields. This provides better developer ergonomics while maintaining extensibility and MCP compliance. Key changes: - Move from wrapper format to flattened ServerJSON with _meta field - Use structured ServerMeta with known fields (publisher, registry metadata) - Simplify PostgreSQL to simple id/value table for easier management - Update all APIs, validation, and services to use flattened format - Migrate seed data and examples to new format - Add migration 003_simplify_to_key_value.sql Publishers now maintain a single server.json file instead of separate files, improving the developer experience significantly. Fixes #284 🏠 Remote-Dev: homespace
|
Also see discussion in https://discord.com/channels/1358869848138059966/1369487942862504016/1412049130615996608 |
🏠 Remote-Dev: homespace
|
@claude please review this |
|
Claude finished @jerome3o-anthropic's task —— View job PR Review: Flattened _meta Format ImplementationComprehensive code review complete. Todo List
✅ Excellent architectural improvement with clean implementationSummaryThis PR successfully implements the flattened Key Strengths🏗️ Clean Architecture
💾 Smart Database Migration
🔧 Implementation Quality
Technical ReviewAPI Types ( type ServerMeta struct {
Publisher map[string]interface{} `json:"publisher,omitempty"`
IOModelContextProtocolRegistry *RegistryExtensions `json:"io.modelcontextprotocol.registry,omitempty"`
}✅ Well-structured with proper JSON tags and typed registry extensions Database Operations (
Schema Compliance (
Minor ConsiderationsError Handling: Database operations have appropriate error wrapping and context timeouts Backward Compatibility: While this is a breaking change in data format, the migration approach is clean and necessary for the architectural improvement Performance: New JSONB structure with targeted indexes should perform well for typical query patterns Test Coverage Analysis
ConclusionThis is a high-quality refactoring that significantly improves the codebase architecture. The flattened format is more intuitive, MCP-compliant, and easier to work with. The database migration strategy is sound, and test coverage is comprehensive. Recommendation: ✅ APPROVE - Ready to merge pending CI checks. |
Summary
This PR implements the flattened
_metaformat for server extensions as discussed in #284, replacing the confusing wrapper format with a clean single-file approach.Before (wrapper format):
{ "server": { "name": "my-server", "description": "..." }, "x-publisher": { "build_info": "..." }, "x-io.modelcontextprotocol.registry": { "id": "...", "published_at": "..." } }After (flattened format):
{ "name": "my-server", "description": "...", "_meta": { "publisher": { "build_info": "..." }, "io.modelcontextprotocol.registry": { "id": "...", "published_at": "..." } } }Key Changes
ServerJSONfile with structured_metafield_metamechanism instead ofx-*prefixesid, valuetable structureServerMetawith known extension fieldsDatabase Migration
Added migration
003_simplify_to_key_value.sqlthat drops the complex relational structure and creates a simple key-value table. This significantly simplifies database management.Testing
Fixes #284