getxmediaagency/mcp-server-webhook
3.2
If you are the rightful owner of mcp-server-webhook and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A scalable, plugin-ready MCP (Model Context Protocol) server with human-in-the-loop collaboration capabilities.
Modular MCP Server
A scalable, plugin-ready MCP (Model Context Protocol) server with human-in-the-loop collaboration capabilities.
Features
- Modular Architecture: Plugin-ready action registry for easy extension
- Human-in-the-Loop: Built-in approval workflow for sensitive operations
- Async Support: Full async/await support with aiohttp
- Comprehensive Logging: Detailed logging with unique request tracking
- Debugging Support: Every operation has unique IDs for traceability
- Production Ready: Scalable design with error handling and monitoring
Architecture
mcp_server/
āāā core/ # Core server components
ā āāā server.py # Main MCPServer class
ā āāā action_registry.py # Action management system
ā āāā human_loop.py # Human approval workflow
āāā actions/ # Action implementations
ā āāā client_data.py # Client data actions
ā āāā ... # Additional action modules
āāā utils/ # Utility functions
āāā config/ # Configuration management
āāā __init__.py # Package initialization
Quick Start
-
Install Dependencies:
pip install -r requirements.txt
-
Start the Server:
python main.py
-
Test the Server:
# Health check curl http://localhost:8000/health # Get client data curl -X POST http://localhost:8000/api/action/get_client_data \ -H "Content-Type: application/json" \ -d '{"params": {"client_id": "test-client"}}'
API Endpoints
Core Endpoints
GET /health
- Health checkGET /api/status
- Server status and debugging infoGET /api/actions
- List available actions
Action Execution
POST /api/action/{action_name}
- Execute an actionPOST /api/approval/{request_id}
- Handle human approvals
Human-in-the-Loop Workflow
Actions can be configured to require human approval:
- Action Registration: Set
requires_approval=True
when registering actions - Approval Request: Server creates approval request when action is called
- Human Review: Human reviews and approves/rejects the action
- Execution: Approved actions are executed automatically
Development
Adding New Actions
- Create action in
mcp_server/actions/
- Use
@action_handler
decorator for metadata - Register action in
main.py
Example Action
from mcp_server.core.action_registry import action_handler
@action_handler(
description="My custom action",
requires_approval=True
)
async def my_action(params: Dict[str, Any]) -> Dict[str, Any]:
# Action implementation
return {"result": "success"}
Configuration
The server supports configuration through environment variables:
MCP_HOST
: Server host (default: localhost)MCP_PORT
: Server port (default: 8000)MCP_DEBUG
: Enable debug mode (default: false)
Logging
The server provides comprehensive logging:
- Request Tracking: Every request has a unique ID
- Performance Monitoring: Execution time tracking
- Error Handling: Detailed error logging with context
- Human Loop: Approval workflow logging
Production Deployment
For production deployment:
- Use a process manager (systemd, supervisor)
- Configure reverse proxy (nginx, Apache)
- Set up monitoring and alerting
- Configure SSL/TLS certificates
- Set up backup and recovery procedures
Contributing
- Follow the modular architecture
- Add comprehensive documentation
- Include unique IDs for all operations
- Test thoroughly with async operations
- Follow the human-in-the-loop workflow for sensitive operations