Refactor: Replace String Tags with Structured Tag Objects Across Backend, Database, and UI #1516
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request closes issue #1442 and introduces a richer, structured tag system across the entire MCP Context Forge application. Previously, tags were stored and handled as plain strings. They are now represented as objects/dictionaries containing both an id and a label, enabling future extensibility and more consistent filtering and display.
Database migration and model changes:
9e028ecf59c4_tag_records_changes_list_str_to_list_to convert alltagscolumns in key tables from lists of strings to lists of dicts withidandlabelfields, and provides a downgrade path to revert the change.mcpgateway/schemas.py(ToolRead,ResourceRead,PromptRead,GatewayRead,ServerRead,A2AAgentRead,GrpcServiceRead) so theirtagsfield is now a list of dictionaries instead of a list of strings. [1] [2] [3] [4] [5] [6] [7]Backend logic updates:
mcpgateway/services/export_service.pyto match by tagidwhen tags are dictionaries, ensuring consistent filtering regardless of tag format.Frontend and template updates:
mcpgateway/static/admin.jsto correctly display and edit tags, showing tag labels (or ids) when tags are objects and maintaining compatibility with string tags. [1] [2] [3] [4] [5] [6] [7] [8]mcpgateway/templates/admin.htmlto display tag ids when tags are dictionaries, ensuring consistent rendering in the UI. [1] [2]