-
Notifications
You must be signed in to change notification settings - Fork 414
Refactor: Replace String Tags with Structured Tag Objects Across Backend, Database, and UI #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
05f67a1 to
caa3a72
Compare
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
caa3a72 to
d2d5800
Compare
kevalmahajan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything works well except the GET /tags and GET /tags/{tag_name}/entities APIs.
Failing with an error: Failed to retrieve tags: unhashable type: 'dict'".
These APIs are most probably still treating tags as list of strings and not the refactored tags as list of dicts.
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
kevalmahajan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected.
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]