Skip to content

586 tag support across all apis#676

Merged
crivetimihai merged 16 commits intomainfrom
586-tag-support-across-all-apis
Aug 8, 2025
Merged

586 tag support across all apis#676
crivetimihai merged 16 commits intomainfrom
586-tag-support-across-all-apis

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

@crivetimihai crivetimihai commented Aug 7, 2025

🏷️ [Feature] Comprehensive Tag Support System - closes #586

📋 Overview

This PR implements a complete tag support system for MCP Gateway, enabling flexible categorization and filtering across all entity types (tools, resources, prompts, servers, gateways). The implementation includes intelligent tag normalization, comprehensive validation, full UI integration, tag discovery APIs, and extensive documentation.

image

🎯 Issue Reference

Closes: #586 - [Feature Request]: Tag support with editing and validation across all APIs endpoints and UI (tags)

Epic Goal: Enable flexible tagging capabilities across all MCP Gateway entities to support dynamic categorization, filtering, and organization for advanced features like dynamic server composition.

Related: #319 #673 #313 #123

✨ Key Features Implemented

🔧 Core Tag System

  • Database Schema: JSON columns added to all entity tables with PostgreSQL GIN indexes
  • Smart Normalization: Automatic case conversion, space-to-hyphen, underscore-to-hyphen, deduplication
  • Robust Validation: Length (2-50 chars), character restrictions, special character filtering
  • Security: XSS prevention, SQL injection protection, input sanitization

🛠️ API Implementation

  • Universal Support: Tags for tools, resources, prompts, servers, gateways
  • Query Filtering: ?tags=tag1,tag2 with OR logic for all GET endpoints
  • CRUD Operations: Full create, read, update support with tag validation
  • Intelligent Input: Handles arrays, comma-separated strings, mixed case

🔍 Tag Discovery API (NEW)

  • Tag Discovery: New /tags endpoint to retrieve all tags with statistics and optional entity details
  • Entity Lookup: New /tags/{tag_name}/entities endpoint to find all entities with a specific tag
  • Admin Integration: /admin/tags endpoint for comprehensive tag management
  • Smart Filtering: Filter by entity types, include/exclude entity details

💻 Admin UI Integration

  • Visual Display: Blue badges in all entity tables and detail views
  • Form Integration: Tag input fields in all create/edit forms
  • Real-time Filtering: Client-side tag filtering with tag suggestions
  • Edit Support: Tags editable in all entity modals with auto-population
  • Tag Management Page: New /admin/tags interface for system-wide tag overview

📚 Enhanced Documentation

  • Comprehensive Guide: /docs/overview/tags.md with examples and best practices
  • API Documentation: Complete curl examples for all operations
  • Integration Examples: Ready-to-use Python and TypeScript clients
  • Advanced Use Cases: Virtual server composition, access control, tag-based discovery
  • Normalization Guide: User-friendly input patterns and transformations

🚀 Enhanced Tag Normalization

The system goes beyond basic requirements with intelligent normalization:

# Input Transformations
"Machine Learning""machine-learning"
"web_development""web-development"  
"API Gateway""api-gateway"
["Finance", "FINANCE", " finance "] → ["finance"]

# Smart Input Handling
["api,web,mobile"] → ["api", "web", "mobile"]  # Comma expansion
["API", None, "", "  ", "api"] → ["api"]       # Robust filtering

📊 Implementation Details

Database Changes

-- Migration: cc7b95fec5d9_add_tags_support_to_all_entities.py
-- Add JSON tags columns with empty array defaults
ALTER TABLE tools ADD COLUMN tags JSON DEFAULT '[]';
ALTER TABLE resources ADD COLUMN tags JSON DEFAULT '[]'; 
ALTER TABLE prompts ADD COLUMN tags JSON DEFAULT '[]';
ALTER TABLE servers ADD COLUMN tags JSON DEFAULT '[]';
ALTER TABLE gateways ADD COLUMN tags JSON DEFAULT '[]';

-- PostgreSQL GIN Indexes for fast JSON queries (SQLite compatible)
CREATE INDEX idx_tools_tags ON tools (tags) USING GIN;
CREATE INDEX idx_resources_tags ON resources (tags) USING GIN;
CREATE INDEX idx_prompts_tags ON prompts (tags) USING GIN;
CREATE INDEX idx_servers_tags ON servers (tags) USING GIN;
CREATE INDEX idx_gateways_tags ON gateways (tags) USING GIN;

Tag Validation Rules

class TagValidator:
    MIN_LENGTH = 2
    MAX_LENGTH = 50
    ALLOWED_PATTERN = r"^[a-z0-9]([a-z0-9\-\:\.]*[a-z0-9])?$"
    
    # Normalization features:
    # - Lowercase conversion
    # - Space → hyphen conversion  
    # - Underscore → hyphen conversion
    # - Whitespace trimming
    # - Duplicate removal

New Tag Discovery Endpoints

  1. GET /tags - List all unique tags across entity types

    • Optional entity_types filtering (tools, resources, prompts, servers, gateways)
    • Optional include_entities=true to return entity details for each tag
    • Returns statistics (count per entity type) for each tag
  2. GET /tags/{tag_name}/entities - Get entities by specific tag

    • Optional entity_types filtering
    • Returns list of TaggedEntity objects with id, name, type, description
  3. GET /admin/tags - Admin UI optimized tag endpoint

    • Same functionality as /tags but with flattened response structure

Enhanced Tag Service

  • TagService class in mcpgateway/services/tag_service.py
  • Handles tag aggregation across all entity types
  • Supports both statistics-only and entity-inclusive responses
  • Proper entity name resolution (name → original_name → uri fallback)
  • Efficient database queries with JSON tag filtering

Schema Enhancements

  • TaggedEntity - Simplified entity representation for tag contexts
  • TagStats - Statistics per entity type (tools, resources, prompts, servers, gateways, total)
  • TagInfo - Complete tag information with stats and optional entities list

API Examples

# Create with tags
curl -X POST "/admin/tools" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -d '{"name": "analytics-tool", "tags": ["Machine Learning", "API"]}'
# Result: tags stored as ["machine-learning", "api"]

# Filter by tags  
curl -X GET "/admin/tools?tags=machine-learning,api"
# Returns: tools with either tag (OR logic)

# Get all tags with statistics
GET /tags

# Get all API-related entities
GET /tags/api/entities

# Get tags with full entity information
GET /tags?include_entities=true

🎨 UI Features

Visual Integration

  • Tag Badges: Consistent blue styling across all tables and modals
  • Form Inputs: Comma-separated input with helpful placeholders and validation hints
  • Real-time Filtering: Type tags to filter entities instantly with available tag suggestions
  • Edit Support: Existing tags automatically populate in edit forms

Enhanced Admin UI Tag Support

Tag Display and Input

  • Tags are displayed as blue badges in all entity tables and detail views
  • All create/edit forms now include tag input fields with comma-separated format
  • Tag input fields support natural language input (e.g., "Machine Learning" becomes "machine-learning")
  • Form validation provides helpful hints for proper tag formatting

Tag Management in Forms

  • Create Forms: Tag input fields for all entity types (tools, resources, prompts, servers, gateways)
  • Edit Forms: Existing tags populate in forms as comma-separated values for easy editing
  • Validation: Real-time validation with user-friendly error messages
  • Placeholders: Helpful examples show proper tag format (e.g., "api, database, v2")

Enhanced Filtering and Navigation

  • Tag filter boxes available in all entity list views
  • Real-time client-side filtering by tags
  • Tags are clickable for quick filtering
  • Clear visual distinction between tagged and untagged entities

Admin Tags Management Page

  • New /admin/tags endpoint provides comprehensive tag overview
  • View all tags across the system with usage statistics
  • Filter tags by entity type
  • See which specific entities have each tag (when include_entities=true)

User Experience

  • Natural Input: Users can type "Machine Learning" and it becomes "machine-learning"
  • Error Resilience: Invalid tags filtered out, no request failures
  • Visual Feedback: Clear validation messages and tag format hints

📚 Documentation Enhancements

Complete Tag System Guide

Added comprehensive documentation at docs/docs/overview/tags.md covering:

  • API Reference: Complete endpoint documentation with request/response examples
  • Tag Discovery API: Documentation for new /tags and /tags/{tag_name}/entities endpoints
  • Tag Normalization Rules: Detailed explanation of automatic tag transformations
  • Best Practices: Recommended naming conventions and tag strategies
  • Integration Examples: Ready-to-use Python and TypeScript client code
  • Advanced Use Cases: Virtual server composition, access control, tag-based discovery
  • Troubleshooting: Common issues and debugging commands

Integration Examples

Python Client

import httpx
from typing import List, Dict, Any, Optional

class MCPTagClient:
    def __init__(self, base_url: str, token: str):
        self.base_url = base_url
        self.headers = {"Authorization": f"Bearer {token}"}
    
    def get_tags(
        self, 
        entity_types: Optional[List[str]] = None,
        include_entities: bool = False
    ) -> List[Dict[str, Any]]:
        """Get all tags with optional filtering."""
        params = {}
        if entity_types:
            params["entity_types"] = ",".join(entity_types)
        if include_entities:
            params["include_entities"] = "true"
        
        response = httpx.get(
            f"{self.base_url}/tags",
            params=params,
            headers=self.headers
        )
        response.raise_for_status()
        return response.json()
    
    def get_entities_by_tag(
        self, 
        tag: str,
        entity_types: Optional[List[str]] = None
    ) -> List[Dict[str, Any]]:
        """Get all entities with a specific tag."""
        params = {}
        if entity_types:
            params["entity_types"] = ",".join(entity_types)
        
        response = httpx.get(
            f"{self.base_url}/tags/{tag}/entities",
            params=params,
            headers=self.headers
        )
        response.raise_for_status()
        return response.json()

    def find_related_entities(
        self, 
        entity_id: str, 
        entity_type: str
    ) -> List[Dict[str, Any]]:
        """Find entities with similar tags."""
        # First, get the entity's tags
        entity = httpx.get(
            f"{self.base_url}/{entity_type}s/{entity_id}",
            headers=self.headers
        ).json()
        
        # Then find entities with those tags
        related = []
        for tag in entity.get("tags", []):
            entities = self.get_entities_by_tag(tag)
            related.extend([
                e for e in entities 
                if e["id"] != entity_id
            ])
        
        # Deduplicate by ID
        seen = set()
        unique = []
        for e in related:
            if e["id"] not in seen:
                seen.add(e["id"])
                unique.append(e)
        
        return unique

# Usage
client = MCPTagClient(
    base_url="http://localhost:4444",
    token="your-jwt-token"
)

# Get all tags with statistics
tags = client.get_tags()

# Get all database tools
db_tools = client.get_entities_by_tag(
    "database", 
    entity_types=["tools"]
)

# Find related entities
related = client.find_related_entities(
    entity_id="tool-123",
    entity_type="tool"
)

TypeScript Client

interface TagStats {
  tools: number;
  resources: number;
  prompts: number;
  servers: number;
  gateways: number;
  total: number;
}

interface TaggedEntity {
  id: string;
  name: string;
  type: string;
  description?: string;
}

interface TagInfo {
  name: string;
  stats: TagStats;
  entities: TaggedEntity[];
}

class MCPTagClient {
  constructor(
    private baseUrl: string,
    private token: string
  ) {}

  private get headers() {
    return {
      'Authorization': `Bearer ${this.token}`,
      'Content-Type': 'application/json'
    };
  }

  async getTags(
    entityTypes?: string[],
    includeEntities = false
  ): Promise<TagInfo[]> {
    const params = new URLSearchParams();
    if (entityTypes?.length) {
      params.append('entity_types', entityTypes.join(','));
    }
    if (includeEntities) {
      params.append('include_entities', 'true');
    }

    const response = await fetch(
      `${this.baseUrl}/tags?${params}`,
      { headers: this.headers }
    );

    if (!response.ok) {
      throw new Error(`Failed to get tags: ${response.statusText}`);
    }

    return response.json();
  }

  async getEntitiesByTag(
    tag: string,
    entityTypes?: string[]
  ): Promise<TaggedEntity[]> {
    const params = new URLSearchParams();
    if (entityTypes?.length) {
      params.append('entity_types', entityTypes.join(','));
    }

    const response = await fetch(
      `${this.baseUrl}/tags/${tag}/entities?${params}`,
      { headers: this.headers }
    );

    if (!response.ok) {
      throw new Error(`Failed to get entities: ${response.statusText}`);
    }

    return response.json();
  }

  async createTaggedTool(
    name: string,
    tags: string[],
    inputSchema: any
  ): Promise<any> {
    const response = await fetch(
      `${this.baseUrl}/tools`,
      {
        method: 'POST',
        headers: this.headers,
        body: JSON.stringify({
          name,
          tags,
          input_schema: inputSchema
        })
      }
    );

    if (!response.ok) {
      throw new Error(`Failed to create tool: ${response.statusText}`);
    }

    return response.json();
  }
}

// Usage
async function example() {
  const client = new MCPTagClient(
    'http://localhost:4444',
    'your-jwt-token'
  );

  // Get all tags with entities
  const tags = await client.getTags(
    undefined, 
    true // include entities
  );

  // Find all API tools
  const apiTools = await client.getEntitiesByTag(
    'api',
    ['tools']
  );

  // Create a new tagged tool
  const newTool = await client.createTaggedTool(
    'My API Tool',
    ['api', 'rest', 'v2'],
    { type: 'object', properties: {} }
  );
}

🧪 Quality Assurance

Test Coverage

  • 1,224 tests passing (maintained 100% pass rate)
  • 26 doctests with comprehensive examples
  • Edge case coverage for normalization, validation, security
  • Integration tests for API endpoints and tag filtering
  • Unit tests for TagService methods
  • Integration tests for all new tag discovery endpoints
  • Admin UI tests for tag functionality

Code Quality

  • Flake8: 100% compliant code style
  • Pylint: Perfect 10.00/10 score maintained
  • Docstring Coverage: Google format with comprehensive documentation
  • Type Safety: Full type hints and Pydantic validation

Security Testing

  • XSS Prevention: Safe HTML generation and tag display
  • Input Sanitization: Special character filtering (@, #, $, etc.)
  • SQL Injection: Parameterized queries with SQLAlchemy
  • Length Limits: Prevent abuse with 50-character maximum

📈 Performance

Database Optimization

  • GIN Indexes: Fast JSON tag queries on PostgreSQL
  • Efficient Filtering: Single query with func.json_contains
  • Minimal Overhead: JSON storage with automatic parsing
  • Statistics-only mode by default: Lighter response for tag discovery
  • Entity details optional: Via include_entities parameter

Client-Side Performance

  • Real-time Filtering: JavaScript-based filtering without API calls
  • Tag Suggestions: Cached available tags for instant suggestions

🔄 Migration Strategy

  • Zero Downtime: Default empty array [] for existing entities
  • Backward Compatible: All existing APIs work unchanged
  • Progressive Enhancement: Tags are optional, graceful degradation

📋 User Stories - Implementation Status

✅ Fully Implemented

  1. User Story 1: ✅ Tag assignment and CRUD operations

    ✅ Add tags to entities via PATCH/POST
    ✅ GET endpoints return tags in responses  
    ✅ Tag updates replace existing tags
  2. User Story 2: ✅ Tag filtering for API consumers

    ✅ GET /tools?tags=analytics (single tag)
    ✅ GET /tools?tags=analytics,finance (multiple tags, OR logic)
    ✅ Empty results for non-existent tags
  3. User Story 3: ✅ Server and gateway tagging

    ✅ PATCH /servers/{id} with tags
    ✅ GET /servers?tags=production filtering
  4. User Story 6: ✅ Tag validation and normalization

    ✅ ["Finance", "FINANCE", " finance "] → ["finance"]
    ✅ Length and character validation
    ✅ ["high-priority", "team:backend", "v2.0"] accepted
  5. NEW: Tag Discovery & Analytics: ✅ Tag aggregation and entity lookup

    ✅ GET /tags - List all tags with usage statistics
    ✅ GET /tags/{tag}/entities - Find entities by specific tag
    ✅ Entity type filtering and optional entity details
    ✅ Admin UI tag management interface

📋 Future Enhancements (Not in Scope)

  1. User Story 4: Tag aggregation endpoints (per entity type like /tools/tags) -> we cannot use /tools/tags as that overlaps a potential tool name.
  2. User Story 5: Bulk tag operations (/tools/bulk-tag)
  3. User Story 7: Dynamic server rule integration
  4. Advanced Features: Tag management tab, tag clouds, usage statistics

These features are documented for future implementation and don't block the core functionality.

🔍 Files Changed

Core Implementation (25+ files, +2,500 lines)

  • mcpgateway/db.py: Added tags columns to all entity models
  • mcpgateway/schemas.py: Pydantic schemas with tag validation + new TaggedEntity, TagStats, TagInfo
  • mcpgateway/validation/tags.py: Complete tag validation system (262 lines)
  • mcpgateway/services/*.py: Tag filtering in all service layers
  • mcpgateway/services/tag_service.py: NEW - Tag discovery and aggregation service
  • mcpgateway/main.py: API endpoints with tag query parameters + new /tags endpoints
  • mcpgateway/admin.py: Enhanced with comprehensive tag support + new /admin/tags endpoint

Database

  • mcpgateway/alembic/versions/cc7b95fec5d9_*.py: Migration for tags columns

Frontend

  • mcpgateway/templates/admin.html: Tag display, inputs, filtering UI (427+ lines)
  • mcpgateway/static/admin.js: Tag editing and view integration (100+ lines)

Documentation & Testing

  • docs/docs/overview/tags.md: Comprehensive user guide (739 lines)
  • docs/docs/overview/.pages: Added tags.md to navigation
  • tests/unit/mcpgateway/validation/test_tags.py: Full test suite (153 lines)
  • tests/unit/mcpgateway/services/test_tag_service.py: NEW - Tag service tests
  • tests/integration/test_tag_endpoints.py: NEW - Integration tests for tag discovery

Configuration

  • CLAUDE.md: Updated with testing commands and instructions

🎉 Benefits

For Users

  • 🚀 Zero Learning Curve: Type tags naturally, automatic formatting
  • 🔍 Powerful Organization: Find entities by any tag combination
  • 🛡️ Bulletproof Input: System handles any format gracefully
  • Visual Excellence: Beautiful, consistent UI across all views
  • 📊 Smart Discovery: Find entities across the system by tags with statistics

For Developers

  • 🏗️ Foundation for Advanced Features: Enables dynamic server composition
  • 🔧 Extensible Architecture: Easy to add bulk operations, tag clouds
  • 📚 Comprehensive Documentation: Clear examples and best practices
  • Performance Ready: Optimized queries and caching
  • 🔍 Rich API: Tag discovery and entity lookup capabilities

For Operations

  • 📊 Better Organization: Categorize tools, resources, prompts by team/purpose
  • 🔎 Instant Discovery: Filter large inventories by tags instantly
  • 🛡️ Security: Input validation prevents malicious tag injection
  • 📈 Scalable: Database indexes ensure performance at scale
  • 📋 System Overview: Complete visibility into tag usage across entities

🚨 Breaking Changes

None. This is a purely additive feature with full backward compatibility.

🔧 Testing Instructions

API Testing

# 1. Generate JWT token
JWT_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token -u admin --secret your-secret-key)

# 2. Create entity with tags
curl -X POST "http://localhost:8080/admin/tools" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "test-tool", "url": "https://example.com", "tags": ["Machine Learning", "API"]}'

# 3. Verify normalization
curl -X GET "http://localhost:8080/admin/tools/1" \
  -H "Authorization: Bearer $JWT_TOKEN"
# Should show: "tags": ["machine-learning", "api"]

# 4. Test filtering
curl -X GET "http://localhost:8080/admin/tools?tags=machine-learning" \
  -H "Authorization: Bearer $JWT_TOKEN"

# 5. Test tag discovery
curl -X GET "http://localhost:8080/tags" \
  -H "Authorization: Bearer $JWT_TOKEN"

# 6. Test entity lookup by tag
curl -X GET "http://localhost:8080/tags/api/entities" \
  -H "Authorization: Bearer $JWT_TOKEN"

# 7. Test with entity details
curl -X GET "http://localhost:8080/tags?include_entities=true" \
  -H "Authorization: Bearer $JWT_TOKEN"

UI Testing

  1. Navigate to admin interface
  2. Create new tool with tags: "Machine Learning, Web API"
  3. Verify tags appear as blue badges in table
  4. Use tag filter to find entities
  5. Edit entity and verify tags populate in form
  6. Visit /admin/tags to see system-wide tag overview
  7. Test tag filtering by entity type

Normalization Testing

from mcpgateway.validation.tags import validate_tags_field

# Test various inputs
result = validate_tags_field(["Machine Learning", "API Gateway", "web_dev", "", "ml"])
print(result)  # ["machine-learning", "api-gateway", "web-dev", "ml"]

🚧 Missing Features & Future Roadmap

📋 Core API Enhancements

Enhanced Tag Discovery

  • Per-entity tag endpoints - /tools/tags, /resources/tags, etc. with entity-specific statistics
  • Tag suggestions API - Auto-complete and recommendation service
  • Tag cloud generation - Frequency-based tag visualization data

Bulk Operations API

  • /admin/tools/bulk-tag - Apply/remove tags to multiple tools at once
  • /admin/resources/bulk-tag - Bulk tag operations for resources
  • /admin/prompts/bulk-tag - Bulk tag operations for prompts
  • /admin/servers/bulk-tag - Bulk tag operations for servers
  • Tag migration tools - Rename tags across all entities globally
  • Batch validation - Validate large tag datasets before applying

🔍 Advanced Filtering & Search

Complex Query Support

  • AND logic filtering - ?tags=api+database (requires both tags)
  • NOT logic filtering - ?tags=api,-deprecated (has api, not deprecated)
  • Tag wildcards - ?tags=env:* (all environment tags)
  • Regex pattern matching - ?tags=/^team:.*/ (regex-based matching)
  • Nested tag queries - Support for complex boolean logic combinations
  • Tag hierarchy filtering - Support for parent:child tag relationships

Entity Cross-References

  • Related entities by tags - Find all entities sharing common tags
  • Tag similarity scoring - Rank entities by tag overlap percentage
  • Dynamic collections - Auto-grouping entities by tag patterns
  • Tag-based entity recommendations - Suggest related tools/prompts

🔌 Plugin System Integration

Tag-Based Plugin FilteringHIGH PRIORITY

# Plugin configuration enhancement needed:
class PluginCondition(BaseModel):
    # EXISTING fields...
    server_ids: Optional[set[str]] = None
    tenant_ids: Optional[set[str]] = None
    tools: Optional[set[str]] = None
    prompts: Optional[set[str]] = None
    
    # NEW: Tag-based filtering
    tool_tags: Optional[set[str]] = None      # Plugin applies to tools with these tags
    resource_tags: Optional[set[str]] = None  # Plugin applies to resources with these tags  
    prompt_tags: Optional[set[str]] = None    # Plugin applies to prompts with these tags
    server_tags: Optional[set[str]] = None    # Plugin applies to servers with these tags
    exclude_tags: Optional[set[str]] = None   # Plugin excludes entities with these tags
    tag_logic: str = "OR"                     # "OR"/"AND" logic for multiple tags

Plugin Discovery by Tags

  • Plugin registry with tags - Plugins self-describe with functionality tags
  • Tag-based plugin activation - Enable plugins based on entity tags automatically
  • Conditional plugin execution - Smart plugin routing based on tag patterns
  • Plugin recommendation system - Suggest relevant plugins for tagged entities

🎨 Admin UI Enhancements

Advanced Tag Management

  • Enhanced tag analytics - Usage trends, orphaned tags, tag lifecycle
  • Tag hierarchies UI - Visual tree for parent:child tag relationships
  • Bulk tag editor - Select multiple entities and modify tags en masse
  • Tag color coding - Visual categorization (e.g., env tags = green)
  • Tag templates - Predefined tag sets for common use cases

Enhanced Filtering UI

  • Tag filter builder - Visual interface for complex AND/OR/NOT queries
  • Saved filter presets - Store and reuse complex tag filter combinations
  • Tag-based views - Pre-filtered views (e.g., "Production Tools", "ML Resources")
  • Tag history tracking - See how tags have changed over time per entity

🤖 Automation & Integration

Dynamic Server CompositionHIGH PRIORITY

# Example: Auto-configure servers based on tags
dynamic_rules:
  - name: "ML Workflow"
    conditions:
      tags: ["machine-learning", "data-processing"] 
    actions:
      - activate_servers: ["ml-models", "data-pipeline"]
      - load_tools: ["tag:ml-*"]
      - apply_plugins: ["pii-filter", "ml-validator"]

Tag-Based Workflows

  • Automated tagging rules - Auto-tag entities based on patterns (name, URL, etc.)
  • Tag-triggered actions - Execute workflows when specific tags are applied
  • Compliance checking - Ensure entities have required tags (e.g., security classification)
  • Tag inheritance - Child entities inherit parent tags automatically

Implementation Priority Ranking

Phase 1 - Essential)

  1. 🔌 Plugin system tag filtering (PluginCondition enhancements)
  2. 📊 Enhanced tag analytics (orphaned tags, usage trends in admin UI)
  3. 🎨 Bulk tag operations UI (select multiple entities, modify tags)
  4. 🤖 Dynamic server composition (tag-based server activation rules)

Phase 2 - High Value

  1. 🔍 Advanced filtering (AND/OR/NOT logic, wildcard support)
  2. 📊 Per-entity tag endpoints (/tools/tags, /resources/tags)
  3. 🎨 Enhanced tag management features (color coding, templates)
  4. 🔒 Tag-based access control (filter entities by user permissions)

Phase 3 - Enhancement)

  1. 🤖 Automated tagging rules (pattern-based auto-tagging)
  2. 📊 Tag relationship graphs (advanced tag hierarchies)
  3. 📱 External integrations (GitHub topics, K8s labels)
  4. 🚀 Performance optimizations (caching, indexing, search)

This roadmap transforms the basic tag system into a comprehensive entity organization and automation platform.

✅ Checklist

  • ✅ Database migration with proper indexing
  • ✅ Complete tag validation and normalization system
  • ✅ API endpoints with query parameter filtering
  • NEW: Tag discovery API with /tags and /tags/{tag}/entities endpoints
  • NEW: Enhanced TagService for tag aggregation and entity lookup
  • NEW: TaggedEntity, TagStats, TagInfo schemas
  • ✅ Full admin UI integration (display, input, filtering)
  • NEW: /admin/tags management interface
  • ✅ Comprehensive test coverage (1,224 tests passing)
  • NEW: Unit and integration tests for tag discovery functionality
  • ✅ Security validation (XSS, injection prevention)
  • ✅ Performance optimization (database indexes, optional entity details)
  • NEW: Comprehensive documentation with integration examples
  • ✅ Backward compatibility maintained
  • ✅ Code quality standards (flake8, pylint 10.00/10)

🏆 Summary

This PR delivers a production-ready, comprehensive tag system that:

  • ✨ Exceeds Requirements: Smart normalization, robust validation, beautiful UI, complete tag discovery
  • 🛡️ Enterprise-Ready: Security, performance, scalability built-in
  • 🚀 User-Friendly: Natural input, visual excellence, zero learning curve
  • 📈 Future-Proof: Foundation for advanced features and dynamic server composition
  • 🔍 Discoverable: Complete tag analytics and entity lookup capabilities

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai removed the request for review from madhav165 August 7, 2025 06:46
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@MohanLaksh
Copy link
Copy Markdown
Collaborator

PR Test summary

make serve - pass
make test - pass (80%, === 1206 passed, 10 skipped, 49 warnings in 48.19s ===)
make autoflake isort black flake8 - pass
make pylint - pass (Your code has been rated at 10.00/10 )
make smoketest - ✅ Smoketest passed!
make doctest - pass (57%, 389 passed, 8 skipped in 11.26s)

UI Testing:
Filtering is applied for the STATUS column, not for the TAGS column

image image

NEEDS a FIX

@crivetimihai
Copy link
Copy Markdown
Member Author

Are you on the latest tag? Can you do a git pull and retest filtering please?

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai
Copy link
Copy Markdown
Member Author

🧪 End-to-End Tag System Testing Guide

This guide provides comprehensive testing steps for the tag system implementation, covering both API endpoints and UI functionality.

🔧 Prerequisites

1. Start MCP Gateway

make serve

2. Generate JWT Token

# Generate token (expires in 7 days)
export JWT_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token \
    --username admin --exp 10080 --secret my-test-key)

# Verify token was created
echo $JWT_TOKEN

# Alternative: Generate token for testing
export JWT_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token \
    --username testuser --exp 0 --secret my-test-key)

3. Verify Gateway is Running

curl -I http://localhost:4444/
# Should return: HTTP/1.1 200 OK

🚀 API Testing with cURL

Phase 1: Basic Tag CRUD Operations

1.1 Create Tools with Tags

# Create tool with normalized tags
curl -X POST "http://localhost:4444/tools" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Database Query Tool",
    "description": "Execute SQL queries on databases",
    "input_schema": {"type": "object", "properties": {"query": {"type": "string"}}},
    "tags": ["Machine Learning", "Database", "API Gateway"]
  }'

# Create second tool with overlapping tags
curl -X POST "http://localhost:4444/tools" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "REST API Client",
    "description": "Make HTTP requests to REST APIs",
    "input_schema": {"type": "object", "properties": {"url": {"type": "string"}}},
    "tags": ["api gateway", "web_development", "HTTP"]
  }'

# Create third tool with different tags
curl -X POST "http://localhost:4444/tools" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "File Manager",
    "description": "Manage files and directories",
    "input_schema": {"type": "object", "properties": {"path": {"type": "string"}}},
    "tags": ["file-system", "utilities", "admin"]
  }'

1.2 Create Resources with Tags

# Create resource with tags
curl -X POST "http://localhost:4444/resources" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "uri": "resource://config/database",
    "name": "Database Configuration",
    "description": "Main database connection settings",
    "content": "host=localhost\nport=5432\ndatabase=mcp_gateway",
    "tags": ["config", "database", "production"]
  }'

# Create second resource
curl -X POST "http://localhost:4444/resources" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "uri": "resource://docs/api",
    "name": "API Documentation",
    "description": "Complete API reference",
    "content": "# API Reference\n\nThis is the complete API documentation...",
    "tags": ["documentation", "api gateway", "reference"]
  }'

1.3 Create Prompts with Tags

# Create prompt with tags
curl -X POST "http://localhost:4444/prompts" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SQL Query Generator",
    "description": "Generate SQL queries from natural language",
    "template": "Generate a SQL query for the following request: {request}\nDatabase schema: {schema}",
    "arguments": [
      {"name": "request", "description": "Natural language description", "required": true},
      {"name": "schema", "description": "Database schema", "required": false}
    ],
    "tags": ["sql", "generation", "database", "machine learning"]
  }'

1.4 Create Server with Tags

# Create server with tags
curl -X POST "http://localhost:4444/servers" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ML Development Server",
    "description": "Machine learning development environment",
    "tags": ["machine learning", "development", "python", "jupyter"]
  }'

1.5 Create Gateway with Tags

# Create gateway with tags
curl -X POST "http://localhost:4444/gateways" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Gateway",
    "url": "https://prod-gateway.example.com",
    "description": "Production environment gateway",
    "tags": ["production", "external", "high-availability"]
  }'

Phase 2: Verify Tag Normalization

2.1 Check Tag Normalization

# Get the first tool and verify tags were normalized
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools" | jq '.[0].tags'

# Expected output: ["machine-learning", "database", "api-gateway"]
# Original input was: ["Machine Learning", "Database", "API Gateway"]

2.2 Test Various Tag Formats

# Create tool with mixed tag formats to test normalization
curl -X POST "http://localhost:4444/tools" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Format Test Tool",
    "description": "Testing tag format normalization",
    "input_schema": {"type": "object"},
    "tags": ["  UPPERCASE  ", "under_scores", "Multiple   Spaces", "api:v2.0", "team:backend"]
  }'

# Verify normalization
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools" | jq '.[] | select(.name=="Format Test Tool") | .tags'

# Expected: ["uppercase", "under-scores", "multiple-spaces", "api:v2.0", "team:backend"]

Phase 3: Test Tag Filtering

3.1 Filter Tools by Single Tag

# Find all tools with 'database' tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools?tags=database" | jq '.[] | {name: .name, tags: .tags}'

3.2 Filter Tools by Multiple Tags (OR logic)

# Find tools with either 'api-gateway' OR 'database' tags
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools?tags=api-gateway,database" | jq '.[] | {name: .name, tags: .tags}'

3.3 Filter Other Entity Types

# Filter resources by tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/resources?tags=config" | jq '.[] | {name: .name, tags: .tags}'

# Filter prompts by tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/prompts?tags=sql" | jq '.[] | {name: .name, tags: .tags}'

# Filter servers by tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/servers?tags=development" | jq '.[] | {name: .name, tags: .tags}'

Phase 4: Test Tag Discovery API

4.1 Get All Tags with Statistics

# Get all tags across the system
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags" | jq '.'

# Expected: Array of TagInfo objects with name, stats (but empty entities array)

4.2 Get Tags with Entity Details

# Get all tags with full entity information
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags?include_entities=true" | jq '.'

# Expected: Same structure but entities array populated with TaggedEntity objects

4.3 Filter Tags by Entity Type

# Get tags only from tools
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags?entity_types=tools" | jq '.'

# Get tags from tools and resources only
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags?entity_types=tools,resources" | jq '.'

# Get tags from all entity types with entities
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags?entity_types=tools,resources,prompts,servers,gateways&include_entities=true" | jq '.'

4.4 Get Entities by Specific Tag

# Get all entities with 'database' tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags/database/entities" | jq '.'

# Get only tools with 'api-gateway' tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags/api-gateway/entities?entity_types=tools" | jq '.'

# Get tools and resources with 'machine-learning' tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags/machine-learning/entities?entity_types=tools,resources" | jq '.'

4.5 Test Admin Tags Endpoint

# Get flattened tag data for admin UI
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/admin/tags" | jq '.'

# Get admin tags with entity details
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/admin/tags?include_entities=true" | jq '.'

Phase 5: Test Edge Cases

5.1 Test Non-existent Tags

# Try to get entities for non-existent tag
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags/nonexistent/entities" | jq '.'

# Expected: Empty array []

5.2 Test Invalid Entity Types

# Try invalid entity type
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags?entity_types=invalid" | jq '.'

# Expected: Empty array []

5.3 Test Empty Tag Filtering

# Filter by empty tag (should return empty results)
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools?tags=" | jq '.'

Phase 6: Test Tag Updates

6.1 Update Tool Tags

# Get tool ID first
TOOL_ID=$(curl -s -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools" | jq -r '.[0].id')

# Update tool with new tags
curl -X PATCH "http://localhost:4444/tools/$TOOL_ID" \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tags": ["updated-tag", "new feature", "v2.0"]
  }'

# Verify update
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tools/$TOOL_ID" | jq '.tags'

# Expected: ["updated-tag", "new-feature", "v2.0"]

Phase 7: Performance and Analytics Testing

7.1 Generate Test Data

# Create multiple entities with various tag combinations
for i in {1..10}; do
  curl -X POST "http://localhost:4444/tools" \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d "{
      \"name\": \"Test Tool $i\",
      \"description\": \"Bulk test tool $i\",
      \"input_schema\": {\"type\": \"object\"},
      \"tags\": [\"bulk-test\", \"tool-$i\", \"performance\"]
    }" > /dev/null
done

7.2 Test Tag Discovery Performance

# Time the tag discovery endpoint
time curl -s -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags" > /dev/null

# Time with entity details (should be slower)
time curl -s -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags?include_entities=true" > /dev/null

7.3 Test Popular Tags

# Get tags sorted by usage (using jq)
curl -H "Authorization: Bearer $JWT_TOKEN" \
  "http://localhost:4444/tags" | jq 'sort_by(-.stats.total) | .[0:5] | .[] | {name: .name, total: .stats.total}'

🎨 UI Testing Steps

Phase 1: Basic UI Verification

1.1 Access Admin Interface

  1. Open browser and navigate to http://localhost:4444/admin
  2. Verify the admin dashboard loads properly
  3. Check that all entity tabs are visible (Tools, Resources, Prompts, Servers, Gateways)

1.2 Verify Tag Display in Tables

  1. Tools Tab:

    • Click on "Tools" tab
    • Verify tools are listed in the table
    • ✅ Check: Tags appear as blue badges next to tool names
    • ✅ Check: Multiple tags are displayed for each tool
    • ✅ Check: Tags are properly normalized (lowercase, hyphens)
  2. Resources Tab:

    • Click on "Resources" tab
    • Verify resources show tags as blue badges
    • ✅ Check: Tags match what was created via API
  3. Repeat for Prompts, Servers, Gateways tabs

1.3 Test Tag Filtering in Tables

  1. In Tools tab:

    • Locate the tag filter input box (should be above the table)
    • Type "database" and press Enter or click filter
    • ✅ Check: Only tools with "database" tag are shown
    • Clear the filter and verify all tools return
  2. Test multiple tag filtering:

    • Type "api-gateway,database" in filter box
    • ✅ Check: Tools with either tag are shown (OR logic)
  3. Test filtering in other tabs (Resources, Prompts, etc.)

Phase 2: Tag Management in Forms

2.1 Create New Tool with Tags

  1. Click "Add Tool" button
  2. Fill in required fields:
  3. In Tags field:
    • Type: "UI Testing, Form Input, Web Interface"
    • ✅ Check: Placeholder text shows proper format
    • ✅ Check: No validation errors appear
  4. Click "Save" or "Create"
  5. ✅ Check: New tool appears in table with normalized tags: ["ui-testing", "form-input", "web-interface"]

2.2 Edit Existing Tool Tags

  1. Find a tool in the table and click "Edit"
  2. Check Tags field:
    • ✅ Check: Existing tags appear as comma-separated values
    • ✅ Check: Tags are editable
  3. Modify tags:
    • Change to: "updated via ui, edit form, modified"
  4. Click "Save"
  5. ✅ Check: Tags updated in table view
  6. ✅ Check: Tags properly normalized

2.3 Test Tag Validation in Forms

  1. Create new tool with invalid tags:
    • Try single character tag: "a"
    • Try very long tag: "this-is-an-extremely-long-tag-that-exceeds-the-fifty-character-limit-and-should-be-rejected"
    • Try special characters: "tag@#$%"
  2. ✅ Check: Validation errors appear
  3. ✅ Check: Form doesn't submit with invalid tags
  4. ✅ Check: Error messages are helpful

Phase 3: Advanced Tag Features

3.1 Test Tag Management Page

  1. Navigate to /admin/tags:
    • Either type URL directly or look for "Tags" menu item
  2. ✅ Check: Page shows system-wide tag overview
  3. ✅ Check: All unique tags are listed
  4. ✅ Check: Usage statistics show correct counts per entity type
  5. ✅ Check: Total counts match expected values

3.2 Test Entity Type Filtering on Tags Page

  1. On tags management page:
    • Look for entity type filter dropdown/checkboxes
    • Select only "Tools"
    • ✅ Check: Only tags from tools are shown
  2. Test multiple selections:
    • Select "Tools" and "Resources"
    • ✅ Check: Tags from both types appear
  3. Test "Include Entities" option (if available):
    • Enable option to show which entities have each tag
    • ✅ Check: Entity lists appear under each tag

3.3 Test Tag Statistics

  1. Verify statistics accuracy:
    • Count tools with "database" tag manually in Tools tab
    • Compare with count shown in Tags page
    • ✅ Check: Numbers match
  2. Test total calculations:
    • ✅ Check: Total count = sum of all entity type counts

Phase 4: Cross-Browser and Responsive Testing

4.1 Browser Compatibility

  1. Test in Chrome:
    • ✅ Check: All tag features work
    • ✅ Check: Tags display properly as badges
  2. Test in Firefox:
    • ✅ Check: Form inputs work correctly
    • ✅ Check: Filtering functions properly
  3. Test in Safari (if available):
    • ✅ Check: No layout issues
    • ✅ Check: Tag normalization works

4.2 Mobile/Responsive Testing

  1. Resize browser to mobile width:
    • ✅ Check: Tag badges wrap properly
    • ✅ Check: Forms remain usable
    • ✅ Check: Tag filter inputs accessible

Phase 5: User Experience Testing

5.1 Test Natural Tag Input

  1. Create entities with natural language tags:
    • "Machine Learning" → should become "machine-learning"
    • "Web Development" → should become "web-development"
    • "API Gateway" → should become "api-gateway"
  2. ✅ Check: Users can input tags naturally
  3. ✅ Check: System handles normalization transparently

5.2 Test Tag Discovery Workflow

  1. Scenario: Find all database-related entities

    • Go to Tags management page
    • Find "database" tag
    • Click to see which entities have this tag (if UI supports this)
    • ✅ Check: Can easily discover related entities
  2. Scenario: Filter entities by multiple criteria

    • Use tag filters in different entity tables
    • Combine with other filters (if available)
    • ✅ Check: Filtering is intuitive and responsive

Phase 6: Error Handling and Edge Cases

6.1 Test Empty States

  1. Create entity with no tags:
    • Leave tags field empty
    • ✅ Check: Entity saves successfully
    • ✅ Check: No tags shown in table (not "null" or error)

6.2 Test Large Numbers of Tags

  1. Create entity with many tags:
    • Add 10+ tags to a single entity
    • ✅ Check: All tags display properly
    • ✅ Check: No layout breaking
    • ✅ Check: Tag badges wrap appropriately

6.3 Test Special Characters and Unicode

  1. Try tags with allowed special characters:
    • "api:v2.0", "team:backend", "env.production"
    • ✅ Check: These are accepted and display correctly

🔍 Verification Checklist

API Functionality ✅

  • Basic CRUD operations with tags work
  • Tag normalization works correctly
  • Tag filtering works with single and multiple tags
  • Tag discovery API returns correct statistics
  • Entity lookup by tag works
  • Admin endpoints function properly
  • Error handling for invalid inputs
  • Performance is acceptable

UI Functionality ✅

  • Tags display as blue badges in all tables
  • Tag input fields work in all forms
  • Tag filtering works in all entity tables
  • Tag validation shows helpful errors
  • Tags management page functions correctly
  • Entity type filtering works
  • Form submission works with tags
  • Tag editing preserves and updates correctly

Data Integrity ✅

  • Tags are normalized consistently
  • Statistics match actual entity counts
  • Updates don't lose existing tags
  • Cross-references between endpoints are accurate
  • No data corruption from special characters

User Experience ✅

  • Natural language input works intuitively
  • Error messages are clear and helpful
  • Performance is responsive
  • Visual design is consistent
  • Mobile/responsive layout works
  • Cross-browser compatibility confirmed

🚨 Common Issues and Troubleshooting

API Issues

# If JWT token expires
export JWT_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token --username admin --exp 10080 --secret my-test-key)

# If server not responding
curl -I http://localhost:4444/
# Should return HTTP 200, if not check server is running

# If getting 401 errors
echo $JWT_TOKEN  # Verify token exists
# Check Authorization header format: "Bearer $JWT_TOKEN"

UI Issues

  1. Tags not displaying: Check browser console for JavaScript errors
  2. Forms not submitting: Verify all required fields are filled
  3. Filters not working: Clear browser cache and reload
  4. Layout issues: Try different browser or check responsive design

Data Issues

  1. Tag counts wrong: Refresh page or restart server
  2. Tags not normalized: Check validation logic in browser console
  3. Entities not appearing: Verify entities were created successfully via API

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@MohanLaksh
Copy link
Copy Markdown
Collaborator

@crivetimihai , @kevalmahajan ...

Here are my observations:

PR Test summary:

make serve - pass
make test - pass (80%, === === 1224 passed, 10 skipped, 50 warnings in 42.99s === ===)
make autoflake isort black flake8 - pass
make pylint - pass (Your code has been rated at 10.00/10 )
make smoketest - ✅ Smoketest passed!
make doctest - pass (56%, 389 passed, 8 skipped in 12.08s)

UI Testing:

Virtual Servers Catalogue:

  • Can ADD and EDIT TAGS
  • Available tags: not populated with the available tags for virtual servers. Also, filter is not working - NEEDS A FIX

Global Tools:

  • Can ADD a TAG.
  • Can EDIT a TAG.
  • Filter works for TAGS and ANNOTATIONS - Needs a FIX

Global Resources:

  • Can ADD and EDIT tags
  • Can Filter the tags from Available Tags:

Global Prompts:

  • Can ADD and EDIT tags
  • Can Filter the tags from Available Tags:

Gateways/MCP Serves:

  • Can ADD and EDIT tags
  • Can Filter the tags from Filter by Tags:
  • Available Tags: not implemented - Needs a FIX

Roots:

Tags: not implemented for Root Directories:

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
@crivetimihai crivetimihai merged commit a4742bd into main Aug 8, 2025
37 checks passed
@crivetimihai crivetimihai deleted the 586-tag-support-across-all-apis branch August 8, 2025 04:20
crivetimihai added a commit that referenced this pull request Aug 10, 2025
…#676 - closes #696

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
crivetimihai added a commit that referenced this pull request Aug 10, 2025
…#676 - closes #696 (#697)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 14, 2025
* Initial tagging implementation

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Adding tags to ui, not yet recorded to db

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Adding UI tags support

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Tags docs

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix flake8

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix pylint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Update docs and filters

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add tags in UI to gateways

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add tags in UI to gateways

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix filtering

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add /tags

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add /tags endpoint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add doctest test coverage

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix gateway add tags

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix lint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fixed server catalog panel to support tags

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Co-authored-by: Keval Mahajan <mahajankeval23@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 14, 2025
…IBM#676 - closes IBM#696 (IBM#697)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 14, 2025
* Initial tagging implementation

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Adding tags to ui, not yet recorded to db

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Adding UI tags support

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Tags docs

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix flake8

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix pylint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Update docs and filters

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add tags in UI to gateways

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add tags in UI to gateways

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix filtering

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add /tags

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add /tags endpoint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add doctest test coverage

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix gateway add tags

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix lint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fixed server catalog panel to support tags

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Co-authored-by: Keval Mahajan <mahajankeval23@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 14, 2025
…IBM#676 - closes IBM#696 (IBM#697)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 16, 2025
* Initial tagging implementation

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Adding tags to ui, not yet recorded to db

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Adding UI tags support

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Tags docs

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix flake8

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix pylint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Update docs and filters

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add tags in UI to gateways

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add tags in UI to gateways

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix filtering

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add /tags

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add /tags endpoint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Add doctest test coverage

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix gateway add tags

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fix lint

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* Fixed server catalog panel to support tags

Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Co-authored-by: Keval Mahajan <mahajankeval23@gmail.com>
vk-playground pushed a commit to vk-playground/mcp-context-forge that referenced this pull request Sep 16, 2025
…IBM#676 - closes IBM#696 (IBM#697)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
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.

[FEATURE]: Tag support with editing and validation across APIs and UI

3 participants