Skip to content

Feature: Add webhook/real-time update support #16

@basher83

Description

@basher83

Feature Request

Implement webhook support to enable real-time updates and event-driven workflows with the Zammad system.

Motivation

Currently, the MCP server only supports polling-based interactions. Real-time updates would enable:

  • Instant notifications for new tickets
  • Live updates for ticket changes
  • Event-driven automation
  • Better user experience for monitoring

Proposed Implementation

1. Webhook Server Component

  • Add webhook endpoint to receive Zammad events
  • Implement event validation and security
  • Queue events for processing

2. Event Types to Support

  • ticket.create - New ticket created
  • ticket.update - Ticket modified
  • ticket.article.create - New article/comment added
  • user.create - New user registered
  • organization.update - Organization changes

3. MCP Integration

# New tool for webhook management
@mcp.tool()
async def register_webhook(
    event_types: list[str],
    callback_url: str,
    active: bool = True
) -> WebhookRegistration:
    """Register a webhook for specific events."""
    pass

# Event streaming resource
@mcp.resource("zammad://events/stream")
async def event_stream() -> Resource:
    """Stream real-time events via SSE or WebSocket."""
    pass

4. Event Processing

  • Validate webhook signatures
  • Transform Zammad events to MCP notifications
  • Implement retry logic for failed deliveries
  • Add event filtering and routing

Architecture Considerations

  • WebSocket or Server-Sent Events for real-time streaming
  • Message queue (Redis) for reliable delivery
  • Event store for replay capability
  • Security: HMAC signature validation

Use Cases

  1. Auto-assignment: Assign tickets based on content
  2. Escalation alerts: Notify when tickets approach SLA
  3. Integration triggers: Update external systems
  4. Live dashboards: Real-time metrics

Acceptance Criteria

  • Can register webhooks via MCP tools
  • Receives and validates Zammad events
  • Transforms events to MCP notifications
  • Handles connection failures gracefully
  • Security validation for all events
  • Documentation for event schemas
  • Integration tests with mock events

Technical Requirements

  • Async event processing
  • Configurable event filters
  • Rate limiting protection
  • Event deduplication
  • Monitoring and metrics

Priority

Medium - Enables advanced automation scenarios

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions