Skip to content

Conversation

manavgup
Copy link
Collaborator

@manavgup manavgup commented Sep 25, 2025

Summary

Adds a comprehensive webhook notification system for MCP Gateway events with support for multiple authentication methods, retry logic, and customizable payload templates.

Features Added

  • Webhook Notification Plugin (plugins/webhook_notification/)
    • HTTP webhook notifications for events, violations, and state changes
    • Multiple authentication methods (Bearer token, API key, HMAC signatures)
    • Retry logic with exponential backoff
    • Customizable JSON payload templates per event type
    • Event filtering and concurrent webhook delivery
    • Comprehensive error handling and timeout support

Event Types Supported

  • Tool execution (success/error)
  • PII detection violations
  • Rate limit violations
  • Resource fetch operations
  • Prompt fetch operations
  • Plugin errors and violations

Files Added/Modified

  • plugins/webhook_notification/webhook_notification.py - Main plugin implementation
  • plugins/webhook_notification/README.md - Comprehensive documentation
  • plugins/webhook_notification/TESTING.md - Testing procedures and examples
  • plugins/webhook_notification/test_config.yaml - Example test configuration
  • plugins/webhook_notification/plugin-manifest.yaml - Plugin metadata
  • tests/unit/mcpgateway/plugins/plugins/webhook_notification/ - Complete test suite
  • plugins/config.yaml - Updated with webhook plugin configuration

Configuration Example

- name: "WebhookNotification"
  kind: "plugins.webhook_notification.webhook_notification.WebhookNotificationPlugin"
  hooks: ["tool_post_invoke", "prompt_post_fetch"]
  mode: "permissive"
  priority: 900
  config:
    webhooks:
      - url: "https://hooks.slack.com/services/YOUR/WEBHOOK"
        events: ["violation", "tool_success", "rate_limit_exceeded"]
        authentication:
          type: "bearer"
          token: "${env.SLACK_WEBHOOK_TOKEN}"
        retry_attempts: 3

Testing

  • Comprehensive unit test coverage (authentication, retry logic, event filtering)
  • Integration tests with PluginManager
  • Manual testing procedures with webhook.site integration
  • Performance and load testing examples

Documentation

  • Complete README with usage examples and configuration options
  • Detailed testing guide with multiple testing approaches
  • Security considerations and best practices
  • Troubleshooting section

Test Plan

  • Unit tests for all authentication methods
  • Integration tests with plugin manager
  • Retry logic and error handling tests
  • Template rendering and customization tests
  • Event filtering and webhook delivery tests
  • Manual testing with webhook.site

Adds comprehensive webhook notification system for MCP Gateway events.

Features:
- HTTP webhook notifications for events, violations, and state changes
- Multiple authentication methods (Bearer, API Key, HMAC signatures)
- Retry logic with exponential backoff
- Customizable payload templates per event type
- Event filtering and concurrent webhook delivery
- Comprehensive test coverage (unit + integration)
- Full documentation and testing guide

Supported Events:
- Tool execution (success/error)
- PII detection violations
- Rate limit violations
- Resource fetch operations
- Prompt fetch operations

Configuration:
- Added WebhookNotification plugin to plugins/config.yaml
- Disabled problematic ClamAV and AI Artifacts plugins
- Example webhook.site integration for testing

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
@crivetimihai crivetimihai force-pushed the feat/webhook-notification-plugin branch from ffde7c1 to 67f7428 Compare September 27, 2025 10:31
@crivetimihai crivetimihai merged commit dd1a367 into IBM:main Sep 27, 2025
27 of 33 checks passed
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.

2 participants