# Multipass

> Universal API Wrapper - Turn ANY Python Library into a Robust API

- **Type:** MCP server
- **Install:** `agentstack add mcp-tinosingh-multipass`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [tinosingh](https://agentstack.voostack.com/s/tinosingh)
- **Installs:** 0
- **Category:** [Data & Analytics](https://agentstack.voostack.com/c/data-and-analytics)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [tinosingh](https://github.com/tinosingh)
- **Source:** https://github.com/tinosingh/multipass
- **Website:** https://github.com/tinosingh/multipass

## Install

```sh
agentstack add mcp-tinosingh-multipass
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MULTIPASS
# Universal API Wrapper - Turn ANY Python Library into a Robust API

MULTIPASS A Universal API Wrapper - Turn ANY Python Library into a Robust API

The architecture I've created is **completely universal** and works with:

✅ **Computer Vision**: YOLO, Ultralytics, OpenCV, PIL, scikit-image  
✅ **LLMs**: Transformers, OpenAI, Anthropic, MLX, LangChain  
✅ **ML Frameworks**: PyTorch, TensorFlow, JAX, scikit-learn  
✅ **Data Science**: Pandas, NumPy, Polars, DuckDB  
✅ **Web Apps**: Streamlit, Gradio, Dash, FastAPI  
✅ **Audio/Video**: Whisper, FFmpeg, PyDub, MoviePy  
✅ **Any Custom Library**: Your proprietary code, research projects  

## 🚀 Quick Start (Literally One Command!)

```bash
# Install the launcher
pip install fastapi uvicorn

# Start ANY library as an API
python api_launcher.py yolo
python api_launcher.py gpt2
python api_launcher.py pandas
python api_launcher.py opencv
```

That's it! Your API is running at `http://localhost:8000`

## 🎯 How It Works

### 1. **Automatic Service Discovery**
The wrapper automatically:
- Inspects the library to find all functions/classes
- Analyzes their signatures and parameters
- Creates REST endpoints for each function
- Generates OpenAPI documentation

### 2. **Universal Adapter Pattern**
```python
# It works with ANY library pattern:

# Simple functions
import numpy as np
# → GET /mean, POST /reshape, etc.

# Classes with methods
from ultralytics import YOLO
model = YOLO()
# → POST /detect, POST /train, etc.

# Complex pipelines
from transformers import pipeline
nlp = pipeline("sentiment-analysis")
# → POST /analyze
```

### 3. **Built-in Resilience**
- 🔄 Automatic retry with backoff
- 🚦 Circuit breakers for fault tolerance
- 📊 Health checks and monitoring
- 🔌 Connection pooling
- 💾 Response caching

## 📚 Library-Specific Examples

### YOLO Object Detection
```python
# Start YOLO API
python api_launcher.py yolo

# Use it
curl -X POST http://localhost:8000/detect \
  -F "image=@photo.jpg"
```

### GPT-2 Text Generation
```python
# Start GPT-2 API
python api_launcher.py gpt2

# Use it
curl -X POST http://localhost:8000/generate \
  -d '{"text": "Once upon a time"}'
```

### Pandas Data Processing
```python
# Start Pandas API
python api_launcher.py pandas

# Use it
curl -X POST http://localhost:8000/read_csv \
  -F "file=@data.csv"
```

### Streamlit App Manager
```python
# Create Streamlit API
from universal_api_wrapper import UniversalAPIFactory

app = UniversalAPIFactory.create_api('streamlit', {
    'adapter_class': 'StreamlitAdapter',
    'apps': [
        {'name': 'dashboard', 'path': './dashboard.py'},
        {'name': 'ml_demo', 'path': './ml_demo.py'}
    ]
})
```

## 🔧 Advanced Configuration

### Custom Library Configuration
```yaml
# my_library_config.yaml
my_ml_pipeline:
  module: my_company.ml_pipeline
  init_function: load_model
  init_args:
    model_path: ./models/production.pkl
    config: ./config/settings.yaml
  endpoints:
    - preprocess
    - predict
    - evaluate
  authentication: true
  rate_limit: 100  # requests per minute
```

### Use Custom Config
```bash
python universal_api_wrapper.py my_ml_pipeline --config my_library_config.yaml
```

## 🐳 Production Deployment

### Docker Compose for Multiple Services
```yaml

services:
  # Computer Vision API
  yolo-api:
    build: .
    command: python api_launcher.py yolo
    ports:
      - "8001:8000"
    deploy:
      replicas: 3
      
  # LLM API
  llm-api:
    build: .
    command: python api_launcher.py gpt2
    ports:
      - "8002:8000"
      
  # Load Balancer
  nginx:
    image: nginx
    ports:
      - "80:80"
    depends_on:
      - yolo-api
      - llm-api
```

## 🔌 Client Libraries

### Python Client
```python
from universal_api_client import UniversalClient

# Connect to any wrapped library
client = UniversalClient("http://localhost:8000")

# Discover available methods
services = await client.discover()

# Call any method dynamically
result = await client.detect(image="photo.jpg", confidence=0.5)
```

### JavaScript/TypeScript Client
```javascript
const client = new UniversalAPIClient('http://localhost:8000');

// Auto-discovers methods
const services = await client.discover();

// Type-safe calls
const result = await client.detect({ image: imageBase64 });
```

## 🛡️ Security & Monitoring

### Built-in Security
- API key authentication
- Rate limiting per endpoint
- Input validation
- CORS configuration
- SSL/TLS support

### Monitoring
- Prometheus metrics
- Health checks
- Performance tracking
- Error logging
- Request tracing

## 🎨 Special Features

### 1. **Model Context Protocol (MCP)**
```python
# Expose any library as MCP server for AI assistants
python mlx_whisper_mcp.py --library pandas
```

### 2. **Streaming Support**
- WebSocket endpoints for real-time data
- Server-sent events for long operations
- Chunked responses for large files

### 3. **Batch Processing**
```python
# Batch endpoint automatically created
POST /batch/detect
{
  "items": [
    {"image": "img1.jpg"},
    {"image": "img2.jpg"},
    {"image": "img3.jpg"}
  ]
}
```

### 4. **Pipeline Chaining**
```python
# Chain multiple operations
POST /pipeline
{
  "steps": [
    {"service": "resize", "args": {"size": [224, 224]}},
    {"service": "detect", "args": {"confidence": 0.5}},
    {"service": "classify", "args": {"top_k": 5}}
  ]
}
```

## 📊 Performance

- **Latency**: 

# That's it! 🎉
```

No more connection errors. No more endpoint breakage. No more manual API maintenance. Just reliable, scalable APIs for any Python library!

Please help to develop it further.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [tinosingh](https://github.com/tinosingh)
- **Source:** [tinosingh/multipass](https://github.com/tinosingh/multipass)
- **License:** Apache-2.0
- **Homepage:** https://github.com/tinosingh/multipass

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-tinosingh-multipass
- Seller: https://agentstack.voostack.com/s/tinosingh
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
