Skip to content

Conversation

@rakdutta
Copy link
Collaborator

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:

  • Added Alembic migration 9e028ecf59c4_tag_records_changes_list_str_to_list_ to convert all tags columns in key tables from lists of strings to lists of dicts with id and label fields, and provides a downgrade path to revert the change.
  • Updated all relevant Pydantic models in mcpgateway/schemas.py (ToolRead, ResourceRead, PromptRead, GatewayRead, ServerRead, A2AAgentRead, GrpcServiceRead) so their tags field is now a list of dictionaries instead of a list of strings. [1] [2] [3] [4] [5] [6] [7]

Backend logic updates:

  • Updated tag filtering logic in mcpgateway/services/export_service.py to match by tag id when tags are dictionaries, ensuring consistent filtering regardless of tag format.
  • Modified resource conversion and tool creation logic to handle the new tag format, normalizing tags to human-readable labels where needed. [1] [2] [3]

Frontend and template updates:

  • Updated all admin panel JavaScript functions in mcpgateway/static/admin.js to 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]
  • Updated templates in mcpgateway/templates/admin.html to display tag ids when tags are dictionaries, ensuring consistent rendering in the UI. [1] [2]

@rakdutta rakdutta force-pushed the feature_update-tool-tag-structure branch from 05f67a1 to caa3a72 Compare November 28, 2025 08:39
@rakdutta rakdutta marked this pull request as ready for review November 28, 2025 08:48
@kevalmahajan kevalmahajan self-assigned this Dec 1, 2025
rakdutta and others added 16 commits December 1, 2025 15:52
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: 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>
@kevalmahajan kevalmahajan force-pushed the feature_update-tool-tag-structure branch from caa3a72 to d2d5800 Compare December 1, 2025 11:10
Copy link
Member

@kevalmahajan kevalmahajan left a 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>
Signed-off-by: rakdutta <rakhibiswas@yahoo.com>
Copy link
Member

@kevalmahajan kevalmahajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected.

@kevalmahajan kevalmahajan merged commit f66e4a3 into main Dec 1, 2025
45 checks passed
@kevalmahajan kevalmahajan deleted the feature_update-tool-tag-structure branch December 1, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants