MCPuppet

MCPuppet

MCPuppet is a workflow orchestrator that enforces policies, audits tool calls, and monitors workflow execution for AI applications using MCP servers.

Category
访问服务器

README

MCPuppet

MCPuppet

A proof of concept MCP Workflow Orchestrator that demonstrates workflow monitoring, audit logging, and policy-based execution ordering for AI applications using MCP tools.

Features

  • Workflow Orchestration: Acts as MCP server to AI applications and MCP client to downstream servers
  • Policy Enforcement: Sequential dependencies, parallel restrictions, conditional execution, and approval gates
  • Comprehensive Audit Logging: Complete audit trail of all tool calls and workflow activities
  • Real-time Monitoring: Live workflow status tracking and progress monitoring
  • Template-based Workflows: Predefined workflow patterns for common operations
  • Policy Violation Detection: Automatic blocking of rule violations with detailed reporting

Architecture

AI Application → MCPuppet → Multiple MCP Servers → Tool Execution
                    ↓
              Audit Trail + Policy Enforcement

Prerequisites

  • Python 3.9+
  • Virtual environment (recommended)

Installation

  1. Clone and navigate to the project directory
  2. Create and activate virtual environment:
    python3 -m venv venv
    source venv/bin/activate
    
  3. Install dependencies:
    pip install -r requirements.txt
    

Claude Desktop Integration

To use this as an MCP server with Claude Desktop:

  1. Test the MCP server:

    source venv/bin/activate
    python test_mcp_server.py
    
  2. Configure Claude Desktop by adding this to your claude_desktop_config.json:

    {
      "mcpServers": {
        "workflow-orchestrator": {
          "command": "/path/to/your/project/venv/bin/python",
          "args": ["/path/to/your/project/mcp_server.py"]
        }
      }
    }
    
  3. Restart Claude Desktop to load the MCP server

See CLAUDE_SETUP.md for detailed setup instructions.

Quick Start

Run All Demos

python main.py demo

Run Specific Demos

python main.py demo-success    # Successful customer onboarding workflow
python main.py demo-violation  # Policy violation enforcement demo
python main.py demo-approval   # Financial processing with approval gates
python main.py demo-monitoring # Real-time workflow monitoring
python main.py demo-audit      # Comprehensive audit trail

Interactive Mode

python main.py interactive

System Status

python main.py status

Demo Scenarios

1. Successful Workflow

Demonstrates a complete customer onboarding workflow:

  • Data validation → Processing → Backup → Notification
  • Shows proper dependency ordering and successful completion

2. Policy Violation

Shows what happens when workflow rules are violated:

  • Attempts to process data before validation
  • Demonstrates automatic blocking and audit logging

3. Approval Workflow

Financial processing workflow with manual approval gates:

  • Validation → Approval → Processing → Backup & Notification
  • Shows approval request/response cycle

4. Real-time Monitoring

Live dashboard showing workflow progress:

  • Progress bars and status updates
  • Real-time metrics and completion tracking

5. Comprehensive Audit

Complete audit trail across all sessions:

  • Policy violations summary
  • Performance metrics
  • Compliance reporting

Configuration

Edit config.json to customize:

  • Downstream server URLs
  • Policy rules (dependencies, restrictions, conditions)
  • Workflow templates
  • Audit settings

Project Structure

MCPuppet/
├── main.py                    # Main entry point
├── orchestrator.py            # Core workflow orchestrator
├── workflow_policies.py       # Policy engine
├── audit_monitor.py          # Audit logging and monitoring
├── workflow_templates.py     # Predefined workflow templates
├── demo_workflows.py         # Demo scenarios
├── config.json              # Configuration
├── requirements.txt         # Dependencies
├── downstream_servers/      # Simulated MCP servers
│   ├── validation_server.py
│   ├── processing_server.py
│   ├── backup_server.py
│   ├── notification_server.py
│   └── approval_server.py
└── audit_logs/              # Audit output directory

Key Components

MCPuppet Core (orchestrator.py)

  • Acts as MCP server to AI applications
  • Acts as MCP client to downstream servers
  • Enforces workflow policies and call ordering
  • Provides comprehensive audit logging
  • Tracks workflow state and dependencies

Workflow Policy Engine (workflow_policies.py)

  • Sequential Dependencies: Tool A must be called before Tool B
  • Parallel Restrictions: Some tools cannot run simultaneously
  • Conditional Execution: Tool C only available after Tool A succeeds
  • Approval Gates: Some tools require manual approval before execution

Audit Monitor (audit_monitor.py)

  • Comprehensive logging of all tool calls
  • Workflow compliance tracking
  • Performance metrics (duration, success rates)
  • Policy violation detection and reporting
  • Real-time workflow status

Workflow Templates (workflow_templates.py)

  • Predefined sequences for common operations
  • Template-based workflow execution
  • Progress tracking and validation

Monitoring Dashboard

The system provides a real-time monitoring dashboard showing:

┌─ Workflow Status Dashboard ─────────────────────┐
│ Active Workflows: 3                             │
│ Completed Today: 47                             │ 
│ Policy Violations: 2                            │
│                                                 │
│ Current Workflow: customer_onboarding          │
│ Progress: ████████░░ 80% (4/5 steps)           │
│ Duration: 3.2s                                  │
│ Next Step: send_notification                    │
└─────────────────────────────────────────────────┘

Security & Compliance

  • Complete audit trail for all MCP tool interactions
  • Policy-based access control and workflow enforcement
  • Comprehensive logging with structured output
  • Compliance reporting and violation tracking
  • Approval workflows for sensitive operations

Testing

The system includes comprehensive demos that test:

  • Workflow orchestration and execution
  • Policy enforcement and violation detection
  • Audit logging and compliance reporting
  • Real-time monitoring and status tracking
  • Template-based workflow management
  • Approval gate functionality

Example Usage

# Create MCPuppet orchestrator
orchestrator = MCPOrchestrator()

# Execute workflow step
result = await orchestrator.call_tool(
    session_id="customer_123",
    tool_name="validate_data",
    arguments={"data": {"name": "John Doe", "email": "john@example.com"}}
)

# Check workflow status
status = orchestrator.get_session_status("customer_123")

Contributing

This is a proof of concept demonstrating MCPuppet's workflow orchestration capabilities. The focus is on showing the value proposition of comprehensive workflow monitoring and audit capabilities for AI tool usage.

License

This project is a demonstration/proof of concept for MCPuppet workflow orchestration.


Key Value Propositions

For Enterprises:

  • "Show me exactly what our AI did and prove it followed our policies"
  • "Prevent AI from doing dangerous things in the wrong order"
  • "Audit compliance for AI tool usage"

For Developers:

  • "I can see the full workflow trace when things go wrong"
  • "I can enforce business logic without changing every tool"
  • "I can gradually add workflow rules without breaking existing tools"

For AI Safety:

  • "AI can't accidentally skip safety checks"
  • "Dangerous tool combinations are blocked by policy"
  • "Complete audit trail for accountability"

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选