TY

tan-yong-sheng/ai-vision-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

79 stars 16 forks 质量 77 趋势 0MIT

tan-yong-sheng/ai-vision-mcp 是从 https://github.com/tan-yong-sheng/ai-vision-mcp. 导入的 MCP 服务器候选。

概览

tan-yong-sheng/ai-vision-mcp 是从 https://github.com/tan-yong-sheng/ai-vision-mcp. 导入的 MCP 服务器候选。

概述(AI 翻译)

一个强大的模型上下文协议(MCP)服务器,利用谷歌Gemini和顶点AI模型提供AI驱动的图像和视频分析。

特色

  • 双提供者支持:在Google Gemini API和Vertex AI之间选择
  • 多模态分析:支持图像和视频内容分析
  • 灵活文件处理:通过多种方式上传(URL、本地文件、base64)
  • 存储集成:内置谷歌云存储支持
  • 全面验证:基于Zod的数据验证全过程
  • 错误处理:具有重试逻辑和断路器的稳健错误处理
  • TypeScript:完全支持TypeScript,严格类型检查

快速启动

先修条件

您可以选择使用 google 提供者或 vertex_ai 提供者。为了简化起见,建议使用 google 提供者。

以下是根据你所选供应商需要设置的环境变量。(注:建议将超时配置设置为MCP客户端超过5分钟。)

(i) 使用 Google AI Studio Provider

点击这里获取您的Google AI Studio的API密钥

(ii) 使用 Vertex AI 提供者

请参阅这里的指南,了解如何设置。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

AI Vision MCP Server

A powerful Model Context Protocol (MCP) server that provides AI-powered image and video analysis using Google Gemini and Vertex AI models.

Features

  • Dual Provider Support: Choose between Google Gemini API and Vertex AI
  • Multimodal Analysis: Support for both image and video content analysis
  • Flexible File Handling: Upload via multiple methods (URLs, local files, base64)
  • Storage Integration: Built-in Google Cloud Storage support
  • Comprehensive Validation: Zod-based data validation throughout
  • Error Handling: Robust error handling with retry logic and circuit breakers
  • TypeScript: Full TypeScript support with strict type checking

Quick Start

Pre-requisites

You could choose either to use google provider or vertex_ai provider. For simplicity, google provider is recommended.

Below are the environment variables you need to set based on your selected provider. (Note: It’s recommended to set the timeout configuration to more than 5 minutes for your MCP client).

(i) Using Google AI Studio Provider

export IMAGE_PROVIDER="google" # or vertex_ai
export VIDEO_PROVIDER="google" # or vertex_ai
export GEMINI_API_KEY="your-gemini-api-key"

Get your Google AI Studio’s api key here

(ii) Using Vertex AI Provider

export IMAGE_PROVIDER="vertex_ai"
export VIDEO_PROVIDER="vertex_ai"
export VERTEX_CLIENT_EMAIL="[email protected]"
export VERTEX_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
export VERTEX_PROJECT_ID="your-gcp-project-id"
export GCS_BUCKET_NAME="your-gcs-bucket"

Refer to the guideline here on how to set this up.

Installation

Below are the installation guide for this MCP on different MCP clients, such as Claude Desktop, Claude Code, Cursor, Cline, etc.

Add to your Claude Desktop configuration:

(i) Using Google AI Studio Provider

{
  "mcpServers": {
    "ai-vision-mcp": {
      "command": "npx",
      "args": ["ai-vision-mcp"],
      "env": {
        "IMAGE_PROVIDER": "google",
        "VIDEO_PROVIDER": "google",
        "GEMINI_API_KEY": "your-gemini-api-key"
      }
    }
  }
}

(ii) Using Vertex AI Provider

{
  "mcpServers": {
    "ai-vision-mcp": {
      "command": "npx",
      "args": ["ai-vision-mcp"],
      "env": {
        "IMAGE_PROVIDER": "vertex_ai",
        "VIDEO_PROVIDER": "vertex_ai",
        "VERTEX_CLIENT_EMAIL": "[email protected]",
        "VERTEX_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
        "VERTEX_PROJECT_ID": "your-gcp-project-id",
        "GCS_BUCKET_NAME": "ai-vision-mcp-{VERTEX_PROJECT_ID}"
      }
    }
  }
}
在 GitHub 查看完整 README

安装

npx ai-vision-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "ai-vision-mcp": { "command": "npx", "args": ["ai-vision-mcp"], "env": { "IMAGE_PROVIDER": "google", "VIDEO_PROVIDER": "google", "GEMINI_API_KEY": "your-gemini-api-key" } } } }