Skip to main content
Glama

MCP Video Recognition Server

一个 MCP 服务器,可描述本地文件中的图像、转录音频并总结视频。默认使用 Google Gemini,也可使用任何兼容 OpenAI 的端点(如 OpenRouter)。

功能

  • 选择你的提供商:Google Gemini(默认)或兼容 OpenAI 的端点

  • 三个 MCP 工具,用于本地图像、音频和视频

  • 可选的 Gemini 模型回退,外加最终的兼容 OpenAI 的备份

模型支持情况各不相同。选择兼容 OpenAI 的提供商并不意味着每个端点或模型都能处理所有媒体类型,服务器也绝不会替你替换模型或提供商。

Related MCP server: Puter MCP Server

前提条件

  • Node.js 18.0.0 或更高版本

  • 你的提供商的 API 密钥:

    • Gemini: GOOGLE_API_KEY

    • 兼容 OpenAI 的提供商: OPENAI_COMPATIBLE_API_KEY

安装

git clone https://github.com/yourusername/mcp-video-recognition.git
cd mcp-video-recognition
npm install
npm run build

快速开始

将服务器添加到你的 MCP 客户端配置中,并将其指向构建后的 dist/index.js:

{
  "mcpServers": {
    "video-recognition": {
      "command": "node",
      "args": ["/path/to/mcp-video-recognition/dist/index.js"],
      "env": {
        "GOOGLE_API_KEY": "your_google_api_key"
      }
    }
  }
}

在 Windows 上,请在路径中使用正斜杠或双反斜杠(\\)。保存文件并重新连接你的 MCP 客户端。

对于 OpenRouter 或其他兼容 OpenAI 的端点,请设置 RECOGNITION_PROVIDER=openai-compatible 及其变量。有关现成示例,请参阅 配置。

使用 FLUJO:

  1. 点击添加服务器。

  2. 粘贴 GitHub URL。

  3. 点击解析、克隆、安装、构建并保存。

配置

服务器会读取环境变量。最常见的变量如下:

变量

默认值

用途

RECOGNITION_PROVIDER

gemini

gemini 或 openai-compatible

GOOGLE_API_KEY

无

Gemini API 密钥

GEMINI_MODEL

gemini-3.5-flash

要使用的 Gemini 模型

OPENAI_COMPATIBLE_API_KEY

无

兼容 OpenAI 的 API 密钥

OPENAI_COMPATIBLE_BASE_URL

无

端点基础 URL

OPENAI_COMPATIBLE_MODEL

xiaomi/mimo-v2.5

要使用的模型

ALLOWED_MEDIA_ROOTS

无

兼容 OpenAI 的提供商和 Gemini 备份的媒体目录

错误的值会阻止启动;它们不会被静默修复。

有关完整的变量列表、验证规则、OpenRouter 示例和支持的媒体类型,请参阅 配置参考。

有关 Gemini 模型回退和最终备份,请参阅 提供商恢复参考。

工具

服务器提供三个 MCP 工具。每个工具都接受一个本地 filepath、一个可选的 prompt(默认为 Describe this content)以及一个可选的 modelname 覆盖。

  • image_recognition — 描述图像

  • audio_recognition — 转录音频或描述音频

  • video_recognition — 描述视频

示例:

{
  "name": "video_recognition",
  "arguments": {
    "filepath": "/path/to/video.mp4",
    "prompt": "Describe what happens in this video"
  }
}

安全

  • 默认情况下要求使用 HTTPS。仅对显式启用的本地端点允许普通 HTTP。

  • 兼容 OpenAI 的提供商和 Gemini 备份仅从你在 ALLOWED_MEDIA_ROOTS 中列出的目录读取媒体。

  • 密钥保留在进程环境中。不要提交真实密钥。

有关端点规则、资源限制和事件响应,请参阅 安全参考。

开发

# Run in development mode
GOOGLE_API_KEY=your_api_key npm run dev

# Build and run the provider foundation tests
npm run verify:provider-foundation

项目结构

  • src/index.ts: 入口点和提供商构建

  • src/server.ts: MCP 服务器和传输

  • src/tools/: 三个识别工具

  • src/services/: Gemini 和兼容 OpenAI 的提供商

  • src/types/: 共享类型

  • src/utils/: 辅助函数

许可证

MIT

Available Tools

3 tools
audio_recognitionB

Analyze and transcribe audio using Google Gemini AI

Inputs: filepath (required), modelname, prompt.

image_recognitionB

Analyze and describe images using Google Gemini AI

Inputs: filepath (required), modelname, prompt.

video_recognitionC

Analyze and describe videos using Google Gemini AI

Inputs: filepath (required), modelname, prompt.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting different media types: audio, images, and videos. There is no overlap in functionality, as they handle separate input formats with similar analysis capabilities but different domains.

    Naming Consistency5/5

    All tool names follow a consistent pattern of 'media_type_recognition' using snake_case. This predictable naming scheme makes it easy to understand what each tool does based on its name alone.

    Tool Count3/5

    With only 3 tools, the server feels somewhat thin for a video recognition domain, as it lacks operations like video editing, frame extraction, or metadata retrieval. However, the core recognition functions for audio, images, and videos are covered, making it borderline appropriate.

    Completeness3/5

    The server provides basic recognition for three media types but lacks comprehensive coverage for video processing. There are no tools for operations like video segmentation, object tracking, or format conversion, which are common in video recognition workflows, leaving notable gaps.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers