Skip to main content
Glama
README.md
# ๐Ÿช„ Wand: Magical Multi-Agent MCP Platform

> *"Where AI automation meets enchantment"* โœจ

A **spellbinding** Model Context Protocol (MCP) implementation with comprehensive integrations, providing **50+ powerful magical integrations** for AI development workflows. Supports Claude Desktop, Claude Code, and other MCP-compatible clients through mystical stdio and HTTP transports.

```
    ๐Ÿ”ฎ Cast 50+ integration spells across all platforms ๐Ÿ”ฎ
         โšก Enhanced error handling with native preservation โšก
              โœจ Production-ready enchantments โœจ
```

## ๐Ÿš€ Magical Status

- **Protocol Version**: MCP 2025-06-18 (backward compatible)
- **Primary Transport**: stdio (via `./add_to_claude.sh`)
- **Integrations Available**: 50+ comprehensive integrations
- **Client Integration**: Claude Desktop โœ… | Claude Code โœ… | Custom clients โœ…
- **Error Handling**: Enhanced with native error preservation

## โœจ Enchanted Features

### ๐Ÿช„ Comprehensive Integration Arsenal (50+ Integrations)
- **๐ŸŽฅ Media & Content**: Video, Audio, Images, OCR, QR codes
- **๐Ÿค– AI & ML**: OpenAI, Anthropic, Cohere, Hugging Face, Local models
- **๐Ÿ’ฌ Communication**: Discord, Telegram, Microsoft Teams, Email, Calendar
- **โ˜๏ธ Cloud & Storage**: Google Drive, S3, Dropbox, OneDrive
- **๐Ÿ› ๏ธ DevOps**: Docker, Kubernetes, Terraform, Monitoring
- **๐Ÿ’ผ Business**: CRM, Payments, Project Management, HR tools
- **๐Ÿ” Security & Identity**: Enterprise IAM, ServiceNow, SailPoint, Britive, Vault

### ๐Ÿ—๏ธ Enhanced Error Response Architecture
- **Native Error Preservation**: Complete exception details without abstraction
- **Configuration Validation**: Initialization failures properly propagated
- **Exception Categorization**: Timeout, authentication, connection, and generic errors
- **Structured Logging**: System warnings with comprehensive context
- **Rate Limiting Control**: Configurable per integration (disabled by default)

### ๐ŸŒ Multiple Mystical Transports
- **HTTP API**: Full MCP 2025-06-18 implementation with SSE support
- **stdio**: Direct process communication for local clients
- **Session Management**: Secure session handling with cleanup

## ๐Ÿš€ Quick Spell Casting

### Prerequisites
- Python 3.10 or higher (required for MCP support)
- pip (Python package manager)
- git
- Virtual environment support (venv)

### 1. Setup & Installation
```bash
# Clone and setup
git clone <repository-url>
cd wand

# Set up Python virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
```

#### Installation Options

Choose the installation that fits your needs:

**Basic Installation (Recommended)**
```bash
# Core server with essential integrations (Slack, GitHub, Docker, AWS)
pip install -r requirements-base.txt
```

**Installation with Audio/Multimedia Support**
```bash
# Includes PyAudio, OpenCV, Whisper, etc.
# Note: Requires system audio libraries
pip install -r requirements-base.txt -r requirements-audio.txt
```

**Installation with AI/ML Support**
```bash
# Includes OpenAI, Anthropic, HuggingFace, etc.
# Note: Large download size due to PyTorch and transformers
pip install -r requirements-base.txt -r requirements-ai.txt
```

**Complete Installation (All Features)**
```bash
# Includes everything - all 55+ integrations
pip install -r requirements-all.txt
```

**Using pip extras (Alternative)**
```bash
# Install from source with optional dependencies
pip install -e .  # Basic installation
pip install -e ".[audio]"  # With audio support
pip install -e ".[ai]"  # With AI/ML support
pip install -e ".[all]"  # Everything
```

#### Environment Configuration
```bash
# Configure environment variables
cp .env.example .env
# Edit .env and configure:
# - OLLAMA_BASE_URL - Your Ollama server URL (default: http://localhost:11434)
# - API keys for any integrations you want to use
# - Database connection string if using PostgreSQL

# Configure Wand
cp config.sample.json config.json
# Edit config.json to match your setup. Replace placeholder paths:
# - {WAND_PATH} - The absolute path to your wand installation
# - {WORKSPACE_PATH} - Your workspace directory
```

### 2. Add to Claude Desktop (Recommended) ๐Ÿช„
```bash
# One-command setup - adds Wand to Claude Desktop
./add_to_claude.sh

# โœ… Successfully added Wand MCP server to Claude Desktop!
# ๐Ÿ“ Next steps: Restart Claude Desktop to load the server
```

#### Manual Claude Desktop Setup
If you prefer manual setup or the script doesn't work:

1. **Open Claude Desktop Settings**
2. **Navigate to MCP Servers**
3. **Add a new server with these details:**
   - **Name:** `wand`
   - **Command:** `/path/to/wand/venv/bin/python`
   - **Arguments:** `/path/to/wand/wand.py`

#### Troubleshooting Claude Integration
- Ensure you're in the Wand directory when running `./add_to_claude.sh`
- Make sure the virtual environment is set up: `python -m venv venv && source venv/bin/activate && pip install -e .`
- Restart Claude Desktop after adding the server
- Check Claude Desktop logs for connection errors
- Verify the Python path and script path are correct

### 3. Alternative: Manual HTTP Server Setup
```bash
# Start HTTP server
python wand.py http

# Add HTTP MCP server to Claude
claude mcp add wand-http --transport http http://localhost:8001/mcp
```

### 4. Test Your Magic โœจ
After restarting Claude Desktop, test the installation:

```bash
# Test imports
./venv/bin/python -c "from integrations.ai_ml.ollama import OllamaIntegration; print('โœ“ Installation successful')"

# Start the Wand server
./venv/bin/python wand.py stdio
```

Then test the integration:
- Ask Claude: *"Use Wand to check the system status"*
- Try: *"Use Wand to list the available integrations"*
- Or: *"Show me what Wand tools are available"*

#### Troubleshooting Installation

**Module Import Errors**
- Ensure virtual environment is activated
- Reinstall requirements: `pip install -r requirements.txt`

**Ollama Connection Issues**
- Verify Ollama is running: `curl http://localhost:11434/api/tags`
- Check `OLLAMA_BASE_URL` in your `.env` file

**Claude Desktop Integration**
- Check logs in the `logs/` directory
- Ensure paths in Claude configuration are absolute, not relative
- Restart Claude Desktop after configuration changes

## โœจ Why the Script Setup is Magical

The `./add_to_claude.sh` script provides the **best experience** because it:

### ๐ŸŽฏ **Optimal Integration Benefits**
- **Direct stdio communication** (faster than HTTP)
- **Extended timeouts** (handles long-running operations)
- **Automatic path detection** (no manual configuration)
- **Enhanced error handling** with detailed diagnostics
- **All 50+ integrations** ready to use immediately

### ๐Ÿ” **What the Script Does**
1. **Detects** your Python environment automatically
2. **Configures** the MCP server with proper paths
3. **Adds** Wand to Claude Desktop configuration
4. **Enables** all integrations with enhanced error reporting
5. **Provides** clear next steps

### ๐Ÿ”ง **Extended Timeout Configuration**

For **long-running magical operations** (AI training, large deployments, etc.), configure extended timeouts:

**File:** `/Users/david/wand/settings.json`
```json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "BASH_DEFAULT_TIMEOUT_MS": "43200000",
    "BASH_MAX_TIMEOUT_MS": "43200000",
    "MCP_TIMEOUT": "43200000",
    "MCP_TOOL_TIMEOUT": "43200000"
  },
  "permissions": {
    "allow": [
      "mcp__wand__*"
    ]
  }
}
```

**Key Timeout Settings:**
- **43200000ms** = 12 hours (for extensive magical operations)
- **MCP_TIMEOUT**: Overall MCP session timeout
- **MCP_TOOL_TIMEOUT**: Individual spell execution timeout
- **BASH timeouts**: Command execution limits

### ๐Ÿ“‹ **Complete stdio Configuration**

The working Claude Code configuration (`~/.claude.json`):

```json
{
  "mcpServers": {
    "wand": {
      "command": [
        "/path/to/wand/venv/bin/python",
        "/path/to/wand/wand.py",
        "stdio"
      ],
      "args": [],
      "env": {}
    }
  }
}
```

### ๐ŸŽญ **stdio vs HTTP Comparison**

| Feature | stdio Mode | HTTP Mode |
|---------|------------|-----------|
| **Performance** | ๐Ÿš€ Fastest | โšก Fast |
| **Timeouts** | ๐Ÿ• 12+ hours | โฐ 10 minutes |
| **Setup** | ๐Ÿ”Œ One command | ๐ŸŒ Server + client |
| **Reliability** | ๐Ÿ’Ž Highest | ๐Ÿ›ก๏ธ High |
| **Use Case** | ๐Ÿช„ Heavy automation | ๐ŸŽฏ Quick tasks |

## ๐Ÿ“š Magical Grimoires

| Document | Description |
|----------|-------------|
| [๐Ÿ“– Enchanted Documentation Index](docs/README.md) | Complete magical grimoire directory with navigation |
| [๐Ÿš€ Quick Start](docs/QUICK_START.md) | 5-minute setup guide |
| [๐Ÿ”Œ Claude Code Integration](docs/MCP_CLAUDE_CODE_INTEGRATION.md) | Complete integration guide |
| [๐Ÿ“Š API Spellbook](docs/API_DOCUMENTATION.md) | All 69 magical tools and enchanted endpoints |
| [๐Ÿ—๏ธ Architecture](docs/ARCHITECTURE.md) | Complete system design and components |
| [๐Ÿš€ Deployment](docs/DEPLOYMENT_GUIDE.md) | Production deployment guide |
| [๐ŸŽจ Wand UI Integration](docs/MCP_UI_INTEGRATION.md) | Magical dashboard and enchanted management APIs |

## ๐Ÿช„ Available Magical Integrations (50+ Total)

### ๐ŸŽฅ Media & Content Creation
- **FFmpeg** - Video processing and conversion
- **OpenCV** - Computer vision and image processing
- **YouTube** - Video upload and management
- **Twitch** - Streaming platform integration
- **Audio** - Audio processing and manipulation
- **Whisper** - Speech-to-text transcription
- **ElevenLabs** - Text-to-speech synthesis
- **Image** - Image generation and editing
- **OCR** - Optical character recognition
- **QR** - QR code generation and reading
- **Chart** - Data visualization and charting

### ๐Ÿค– AI & Machine Learning
- **OpenAI** - GPT models and API integration
- **Anthropic** - Claude model integration
- **Cohere** - Language model services
- **Hugging Face** - Model hub and transformers
- **Replicate** - Cloud AI model hosting
- **Stability AI** - Image generation models
- **Ollama** - Local language model management
- **DeepL** - Advanced translation services

### ๐Ÿ’ฌ Communication & Social
- **Discord** - Bot integration and messaging
- **Telegram** - Bot and messaging automation
- **Microsoft Teams** - Webhook messaging and notifications
- **Email** - SMTP/IMAP email management
- **Calendar** - Calendar integration and scheduling

### โ˜๏ธ Cloud Storage & File Management
- **Google Drive** - File storage and sharing
- **Dropbox** - Cloud file synchronization
- **OneDrive** - Microsoft cloud storage
- **S3** - Amazon S3 object storage
- **FTP** - File transfer protocol operations

### ๐Ÿ“š Documentation & Knowledge
- **Notion** - Knowledge management integration
- **Confluence** - Team wiki and documentation
- **GitBook** - Documentation platform
- **Markdown** - Markdown processing and conversion
- **PDF** - PDF generation and manipulation

### ๐Ÿ› ๏ธ DevOps & Infrastructure
- **Docker** - Container management
- **Kubernetes** - Container orchestration
- **Terraform** - Infrastructure as code
- **Prometheus** - Monitoring and metrics
- **Datadog** - Application monitoring
- **Sentry** - Error tracking and monitoring

### ๐Ÿ” Testing & Automation
- **Selenium** - Web browser automation
- **Playwright** - Modern web testing
- **Postman** - API testing and development

### ๐Ÿ’ผ Business & CRM
- **Salesforce** - CRM and sales automation
- **HubSpot** - Marketing and sales platform
- **Pipedrive** - Sales pipeline management
- **Stripe** - Payment processing

### ๐Ÿ“‹ Project Management
- **Jira** - Issue tracking and project management
- **Asana** - Team task management
- **Trello** - Kanban board management
- **Linear** - Modern issue tracking
- **Monday.com** - Work operating system

### ๐Ÿ‘ฅ HR & Productivity
- **Workday** - Human capital management
- **BambooHR** - HR information system
- **Toggl** - Time tracking
- **Harvest** - Time tracking and invoicing

### ๐Ÿ” Security & Identity
- **ServiceNow** - IT Service Management and ITSM
- **SailPoint** - Identity Security Cloud and governance
- **Microsoft Entra** - Azure AD identity management
- **Britive** - Privileged access management (PAM)
- **Vault** - Secret management
- **1Password** - Password management
- **Okta** - Identity and access management
- **Auth0** - Authentication as a service
- **Veracode** - Application security testing
- **Snyk** - Vulnerability management
- **SonarQube** - Code quality and security

### ๐ŸŽฎ Entertainment & Gaming
- **Spotify** - Music streaming integration
- **Podcast** - Podcast management and processing
- **Steam** - Gaming platform integration

## ๐Ÿข Enterprise Integration Spotlight

Wand now includes comprehensive **enterprise identity management and communication** tools:

### ๐Ÿ” Identity & Access Management
- **`servicenow`** - Create incidents, manage users, query ITSM records
- **`sailpoint`** - Identity governance, access requests, certification campaigns
- **`entra`** - Azure AD user/group management, role assignments
- **`britive`** - Just-in-time privileged access, secret checkout

### ๐Ÿ’ฌ Enterprise Communication
- **`teams`** - Send messages, cards, and notifications via webhooks

**Example Usage:**
```python
# Create ServiceNow incident
servicenow(operation="create_incident",
          short_description="Server outage",
          priority="1")

# Request SailPoint access
sailpoint(operation="request_access",
          identity_id="user123",
          access_profile_ids=["admin_profile"])

# Send Teams notification
teams(operation="send_notification",
      title="Deployment Complete",
      message="v2.1.0 deployed successfully",
      status="success")
```

See [Enterprise Integrations Guide](docs/ENTERPRISE_INTEGRATIONS.md) for complete setup and usage documentation.

## ๐Ÿช„ Magical Server Modes

### HTTP Mode (Recommended)
```bash
python wand.py http
# Server available at http://localhost:8001/mcp
```

### stdio Mode
```bash
python wand.py stdio
# For direct process communication
```

## ๐Ÿ—๏ธ Magical Architecture

- **Multi-Agent System**: 3 internal agents with load balancing
- **Execution Backends**: Native, Docker, SSH, Host Agent
- **Security**: Command validation, path restrictions, resource limits
- **Monitoring**: Health checks, performance tracking, audit logging

## ๐Ÿณ Docker Support

```bash
# Quick start with Docker
docker build -f scripts/Dockerfile -t wand .
docker run -p 8001:8001 wand
```

## ๐Ÿ”’ Protective Wards

- OAuth 2.1 authentication with resource indicators
- Command allowlist/blocklist with pattern matching
- Path restrictions and resource limits
- Session management with cleanup
- Comprehensive audit logging

## ๐Ÿ“Š Magical Performance

- **Response Time**: <200ms average
- **Concurrency**: 10+ simultaneous sessions
- **Memory Usage**: <50MB per backend
- **Scalability**: Horizontal scaling support

## ๐Ÿงช Local CI & Testing

Wand includes a comprehensive local CI system that mirrors the GitHub Actions pipeline, helping you catch issues before pushing code.

### Quick Testing
```bash
# Run the full CI pipeline (recommended before every commit)
./ci.sh

# Run only enterprise integration tests
./ci.sh --enterprise

# Run with verbose output for detailed logs
./ci.sh --enterprise --verbose

# Setup environment only
./ci.sh --setup
```

### Available Test Modes
- `./ci.sh` - Full CI pipeline (setup + all checks + tests)
- `./ci.sh --enterprise` - Enterprise integration tests only
- `./ci.sh --basic` - Basic tests (no external dependencies)
- `./ci.sh --tests-only` - All tests without setup
- `./ci.sh --lint-only` - Code linting only
- `./ci.sh --security-only` - Security scans only

### CI Pipeline Features
- **Environment Setup**: Automatic virtual environment management
- **Dependency Management**: Installs required and optional dependencies
- **Enterprise Integration Testing**: Tests for ServiceNow, SailPoint, Microsoft Entra, Britive, Teams
- **Code Quality**: Linting (ruff), type checking (mypy), security scanning (bandit, safety)
- **Smart Dependencies**: Gracefully handles missing optional enterprise packages
- **Colored Output**: Clear, colored logging for easy reading

### Enterprise Integration Tests
The enterprise tests are designed for CI environments:
- **With Dependencies**: Full integration tests with proper mocking
- **Without Dependencies**: Tests automatically skip with descriptive messages
- **Expected Skips**: `pysnc` (ServiceNow), `azure-identity` (Entra), `britive` (PAM)

### Before Committing
```bash
# Always run CI to catch issues early
./ci.sh

# If enterprise tests fail, investigate with verbose output
./ci.sh --enterprise --verbose
```

## ๐Ÿค Join the Magic

### Development Workflow
1. **Setup**: Run `./ci.sh --setup` to prepare your environment
2. **Development**: Use `./ci.sh --tests-only` for quick feedback
3. **Before committing**: Run `./ci.sh` to ensure all checks pass
4. **Code quality**: Use `./ci.sh --lint-only` to fix style issues

### Contributing Steps
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Set up development environment (`./ci.sh --setup`)
4. Make your changes and test (`./ci.sh`)
5. Commit your changes (`git commit -m 'Add amazing feature'`)
6. Push to the branch (`git push origin feature/amazing-feature`)
7. Open a Pull Request

## ๐Ÿ“„ License

This project is licensed under a proprietary license - see the LICENSE file for details.

## ๐Ÿ†˜ Magical Support

- ๐Ÿ“– **Documentation**: Check the `docs/` directory for detailed guides
- ๐Ÿ› **Issues**: Report bugs via GitHub Issues
- ๐Ÿ’ฌ **Questions**: Start a GitHub Discussion
- ๐Ÿ”ง **Debug**: Enable debug logging with `LOG_LEVEL=DEBUG`

## ๐Ÿšซ AI Training Policy

This repository **opts out** of AI/ML training. The code and documentation in this repository may not be used for training machine learning models without explicit written permission.

For more details, see:
- [DO_NOT_TRAIN.md](./DO_NOT_TRAIN.md) - Full legal notice
- `.ai-training-opt-out` - Opt-out marker file
- `.noai` - Additional opt-out marker
- `robots.txt` - Crawler directives

---

> ๐Ÿช„ **May your automation be swift and your magic be strong!** โœจ
> *Happy spell casting with Wand!*

```
    ๐ŸŒŸ Welcome to the magical realm of automation ๐ŸŒŸ
         ๐Ÿ”ฎ Where 50+ integrations await your command ๐Ÿ”ฎ
              โœจ Cast responsibly, automate magically โœจ
```