Depth Pro MCP Server

Depth Pro MCP Server

Enables AI assistants to perform monocular depth estimation on images using Apple's Depth Pro model, with tools for single or batch processing and GPU management.

Category
Visit Server

README

English | 简体中文 | 繁體中文 | 日本語

<div align="center">

🔬 Depth Pro Docker

Docker License Python CUDA

Production-ready Docker deployment for Apple's Depth Pro model

Zero-shot monocular metric depth estimation • 2.25MP depth map in 0.3s

Screenshot

</div>


✨ Features

Feature Description
🚀 One-Click Deploy Docker Compose for instant deployment
🎨 Modern Web UI Beautiful interface with multiple colormaps
🔌 REST API Full-featured API with Swagger docs
🤖 MCP Server Model Context Protocol support for AI assistants
📊 Multiple Outputs JPG visualization, NPZ data, 16-bit PNG
🎛️ Manual Focal Length Override auto focal length estimation
🌐 Multi-language Chinese, English, Japanese UI
💾 GPU Management Auto memory offload, status monitoring

🚀 Quick Start

# One command to run (All-in-One image, no downloads needed!)
docker run -d --name depth-pro --gpus all -p 8500:8500 neosun/depth-pro:latest

# Open browser
open http://localhost:8500

📦 Installation

Prerequisites

  • Docker 24.0+ with NVIDIA Container Toolkit
  • NVIDIA GPU with 8GB+ VRAM (16GB+ recommended)
  • CUDA 12.1 compatible driver

Method 1: Docker Run (Recommended)

All-in-One image includes model weights (~5GB), no additional downloads required!

# Pull and run (model included in image)
docker run -d \
  --name depth-pro \
  --gpus all \
  -p 8500:8500 \
  -e GPU_IDLE_TIMEOUT=60 \
  neosun/depth-pro:latest

Method 2: Docker Compose

# Create docker-compose.yml
cat > docker-compose.yml << 'EOF'
services:
  depth-pro:
    image: neosun/depth-pro:latest
    container_name: depth-pro
    ports:
      - "8500:8500"
    environment:
      - GPU_IDLE_TIMEOUT=60
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: unless-stopped
EOF

# Start service
docker compose up -d

Method 3: Local Development

# Create conda environment
conda create -n depth-pro python=3.9 -y
conda activate depth-pro

# Install dependencies
pip install -e .
pip install flask flask-cors flasgger gunicorn

# Download model
source get_pretrained_models.sh

# Run server
python app.py

⚙️ Configuration

Environment Variables

Variable Default Description
PORT 8500 Server port
GPU_IDLE_TIMEOUT 60 Seconds before GPU memory release
NVIDIA_VISIBLE_DEVICES 0 GPU device index

docker-compose.yml

services:
  depth-pro:
    image: neosun/depth-pro:latest
    container_name: depth-pro
    ports:
      - "8500:8500"
    environment:
      - PORT=8500
      - GPU_IDLE_TIMEOUT=60
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8500/health"]
      interval: 30s
      timeout: 10s
      retries: 3

📖 Usage

Web Interface

Visit http://localhost:8500 for the interactive UI:

  1. Upload an image (JPG/PNG/WebP/HEIC)
  2. Select colormap (Turbo, Viridis, Plasma, etc.)
  3. Optionally set manual focal length
  4. Click "Process" and download results

REST API

Depth Estimation

curl -X POST http://localhost:8500/api/predict \
  -F "file=@image.jpg" \
  -F "colormap=turbo" \
  -F "focal_length=1000"

Response:

{
  "task_id": "abc12345",
  "focal_length_px": 1000.0,
  "min_depth_m": 0.5,
  "max_depth_m": 10.2,
  "mean_depth_m": 3.4,
  "image_size": "1920x1080",
  "depth_image_base64": "...",
  "download_jpg": "/api/download/abc12345/color.jpg",
  "download_npz": "/api/download/abc12345/depth.npz",
  "download_16bit": "/api/download/abc12345/depth16.png"
}

GPU Status

curl http://localhost:8500/api/gpu/status

Release GPU Memory

curl -X POST http://localhost:8500/api/gpu/offload

API Documentation

Swagger UI available at: http://localhost:8500/apidocs/

MCP Server (for AI Assistants)

Add to your Claude Desktop config:

{
  "mcpServers": {
    "depth-pro": {
      "command": "docker",
      "args": ["exec", "-i", "depth-pro", "python3", "mcp_server.py"]
    }
  }
}

Available MCP tools:

  • estimate_depth - Process single image
  • batch_estimate_depth - Process multiple images
  • get_gpu_status - Check GPU status
  • release_gpu - Free GPU memory

📁 Project Structure

depth-pro-docker/
├── app.py                 # Flask web server
├── mcp_server.py          # MCP server for AI assistants
├── gpu_manager.py         # GPU memory management
├── Dockerfile             # Container build file
├── docker-compose.yml     # Docker Compose config
├── checkpoints/           # Model weights (download separately)
│   └── depth_pro.pt
├── src/depth_pro/         # Core model code
├── templates/             # HTML templates
├── static/                # CSS/JS assets
└── docs/                  # Documentation

🛠️ Tech Stack

  • Model: Apple Depth Pro (DINOv2 + Multi-scale ViT)
  • Backend: Flask + Gunicorn
  • Frontend: Vanilla JS + Modern CSS
  • Container: Docker + NVIDIA Container Toolkit
  • GPU: PyTorch + CUDA 12.1

📝 Limitations

  • Far-field scenes (>20m) may have inaccurate absolute depth values
  • Best suited for indoor and close-range outdoor scenes
  • Relative depth ordering is generally reliable even for far scenes

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open a Pull Request

📄 License

This project is based on Apple's Depth Pro and is licensed under the Apple Sample Code License.

🙏 Acknowledgements


⭐ Star History

Star History Chart

📱 Follow Me

<div align="center">

WeChat

</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured