@@ -12,6 +12,8 @@ type CatalogRestEntityType string
1212const (
1313 RestEntityCatalogModel CatalogRestEntityType = "CatalogModel"
1414 RestEntityCatalogArtifact CatalogRestEntityType = "CatalogArtifact"
15+ RestEntityMcpServer CatalogRestEntityType = "McpServer"
16+ RestEntityMcpServerTool CatalogRestEntityType = "McpServerTool"
1517)
1618
1719// catalogEntityMappings implements EntityMappingFunctions for the catalog package
@@ -27,6 +29,8 @@ func (c *catalogEntityMappings) GetMLMDEntityType(restEntityType filter.RestEnti
2729 switch restEntityType {
2830 case filter .RestEntityType (RestEntityCatalogArtifact ):
2931 return filter .EntityTypeArtifact
32+ case filter .RestEntityType (RestEntityMcpServerTool ):
33+ return filter .EntityTypeArtifact
3034 default :
3135 return filter .EntityTypeContext
3236 }
@@ -67,6 +71,20 @@ func (c *catalogEntityMappings) GetPropertyDefinitionForRestEntity(restEntityTyp
6771 }
6872 }
6973
74+ if restEntityType == filter .RestEntityType (RestEntityMcpServer ) {
75+ if _ , isWellKnown := mcpServerProperties [propertyName ]; isWellKnown {
76+ // Use the well-known property definition
77+ return mcpServerProperties [propertyName ]
78+ }
79+ }
80+
81+ if restEntityType == filter .RestEntityType (RestEntityMcpServerTool ) {
82+ if _ , isWellKnown := mcpServerToolProperties [propertyName ]; isWellKnown {
83+ // Use the well-known property definition
84+ return mcpServerToolProperties [propertyName ]
85+ }
86+ }
87+
7088 // Not a well-known property for this entity type, treat as custom
7189 return filter.PropertyDefinition {
7290 Location : filter .Custom ,
@@ -119,3 +137,53 @@ var catalogArtifactProperties = map[string]filter.PropertyDefinition{
119137 // Artifact type (stored in type_id but we can filter by string representation)
120138 "artifactType" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "artifactType" },
121139}
140+
141+ // mcpServerProperties defines the allowed properties for McpServer entities.
142+ // This follows the same pattern as catalogModelProperties - only properties that are:
143+ // 1. Entity table columns (required for core identity)
144+ // 2. Key filterable dimensions that need explicit type handling (arrays, bools)
145+ // 3. Common properties shared with CatalogModel for consistency
146+ // All other properties can be queried via custom property fallback.
147+ var mcpServerProperties = map [string ]filter.PropertyDefinition {
148+ // Common Context properties (Entity Table - required)
149+ "id" : {Location : filter .EntityTable , ValueType : filter .IntValueType , Column : "id" },
150+ "name" : {Location : filter .EntityTable , ValueType : filter .StringValueType , Column : "name" },
151+ "externalId" : {Location : filter .EntityTable , ValueType : filter .StringValueType , Column : "external_id" },
152+ "createTimeSinceEpoch" : {Location : filter .EntityTable , ValueType : filter .IntValueType , Column : "create_time_since_epoch" },
153+ "lastUpdateTimeSinceEpoch" : {Location : filter .EntityTable , ValueType : filter .IntValueType , Column : "last_update_time_since_epoch" },
154+
155+ // Core properties matching CatalogModel pattern
156+ "source_id" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "source_id" },
157+ "base_name" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "base_name" },
158+ "description" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "description" },
159+ "provider" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "provider" },
160+ "license" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "license" },
161+ "license_link" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "license_link" },
162+ "logo" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "logo" },
163+ "readme" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "readme" },
164+ "version" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "version" },
165+
166+ // MCP-specific filterable dimensions (need explicit type for arrays)
167+ "tags" : {Location : filter .PropertyTable , ValueType : filter .ArrayValueType , Column : "tags" },
168+ "transports" : {Location : filter .PropertyTable , ValueType : filter .ArrayValueType , Column : "transports" },
169+ "deploymentMode" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "deploymentMode" },
170+
171+ // Security indicators (need explicit type for booleans)
172+ "verifiedSource" : {Location : filter .PropertyTable , ValueType : filter .BoolValueType , Column : "verifiedSource" },
173+ "secureEndpoint" : {Location : filter .PropertyTable , ValueType : filter .BoolValueType , Column : "secureEndpoint" },
174+ "sast" : {Location : filter .PropertyTable , ValueType : filter .BoolValueType , Column : "sast" },
175+ "readOnlyTools" : {Location : filter .PropertyTable , ValueType : filter .BoolValueType , Column : "readOnlyTools" },
176+ }
177+
178+ // mcpServerToolProperties defines the allowed properties for McpServerTool entities
179+ var mcpServerToolProperties = map [string ]filter.PropertyDefinition {
180+ // Common Artifact properties
181+ "id" : {Location : filter .EntityTable , ValueType : filter .IntValueType , Column : "id" },
182+ "name" : {Location : filter .EntityTable , ValueType : filter .StringValueType , Column : "name" },
183+ "createTimeSinceEpoch" : {Location : filter .EntityTable , ValueType : filter .IntValueType , Column : "create_time_since_epoch" },
184+ "lastUpdateTimeSinceEpoch" : {Location : filter .EntityTable , ValueType : filter .IntValueType , Column : "last_update_time_since_epoch" },
185+
186+ // McpServerTool-specific properties stored in ArtifactProperty table
187+ "description" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "description" },
188+ "accessType" : {Location : filter .PropertyTable , ValueType : filter .StringValueType , Column : "accessType" },
189+ }
0 commit comments