@fre4x/gemini

中文文档
1.1.29发布于 2026/10/23MITES Module近 30 天下载 2683

A Gemini MCP server providing multimodal analysis and image/video generation.

原始使用文档
文档目录8 节
  1. Tools
  2. Requirements
  3. Environment variables
  4. Mock Mode
  5. Deploy
  6. Notes
  7. Development
  8. License

gemini — The Intelligence Bridge

The agent that can see, hear, and imagine is the agent that cannot be outmaneuvered.

Part of FRE4X-B1TE — a monorepo of MCP servers built for autonomous agents.

Google's Gemini is not a chatbot. It is a multimodal reasoning engine. This B1TE bridges your agent directly to that engine — text, images, video, audio — so it can perceive the world as humans do, and then outthink it.

Tools

ToolCapability
analyze_mediaAnalyze an image or audio file via URL or file:// path. Prompt is optional.
list_modelsList supported models for analyze_media, generate_image, and generate_video. Filter by analyze, image, video, or all.
generate_imageNano Banana image synthesis via generateContent with imageConfig.aspectRatio. Optionally save to output_dir.
generate_videoStart async Gemini Omni video generation via the REST Interactions API (gemini-omni-1.1-flash by default). Returns an interaction id to poll.
get_video_statusSingle GET status check per call (returns done: false while queued/in_progress). Set wait=true to block until complete or timeout. Downloads via Files API when ready. Optionally saves to output_dir.

Requirements

A Google AI Studio API key — set as GEMINI_API_KEY.

Environment variables

VariablePurpose
GEMINI_API_KEYRequired for live API calls (unless MOCK=true).
GEMINI_IMAGE_MODELOverride default image model (gemini-3.1-flash-image).
GEMINI_VIDEO_MODELOverride default Omni video model (gemini-omni-1.1-flash).
GEMINI_VIDEO_POLL_TIMEOUT_MSMax wait when get_video_status.wait=true (default 600000 ms).
GEMINI_MEDIA_FETCH_TIMEOUT_MSPer-request timeout for Interactions/Files HTTP calls (default 30000 ms).

Polling interval for in-progress video is GEMINI_VIDEO_POLL_INTERVAL_MS (5 seconds) when using wait=true or Files API processing.

Mock Mode

Run without an API key (returns fixture data of identical shape):

MOCK=true npx @fre4x/gemini

Deploy

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@fre4x/gemini"],
      "env": {
        "GEMINI_API_KEY": "your_api_key_here"
      }
    }
  }
}

Notes

  • Image generation uses Nano Banana generateContent with responseModalities: ["IMAGE"] and imageConfig.aspectRatio (not Imagen). Check AI Studio for model access.
  • Video generation uses the Interactions API with x-goog-api-key header auth (never ?key= on URLs). Flow: generate_video → call get_video_status every ~5s until done: true, or pass wait=true on a status check to block until complete.
  • Tool errors include recovery_class: agent_recoverable (retry with corrected params/models) vs user_action_required (moderation, auth, quota, requires_action).
  • analyze_media accepts file:// paths for local files and auto-detects MIME type from URL extension (jpg, png, mp4, mp3, wav, pdf, etc.). If you omit prompt, it defaults to "Describe this media." and uses gemini-3.8-flash by default.
  • analyze_media rejects retired text-model aliases such as gemini-1.5-* and gemini-2.0-*. If you override model, use a currently supported generateContent model.
  • output_dir on generate_image and get_video_status saves files to disk. Directory is created if it doesn't exist.
  • Model defaults are intentionally pinned to the latest verified official Gemini docs for the current date. Do not replace them with older names from stale model knowledge.

Development

npm install
npm run dev      # tsx, no build
npm run build    # esbuild → dist/
npm test         # vitest unit tests
npm run inspector # MCP inspector in mock mode

License

MIT — WE ARE THE FRE4X.

版本与发布记录

@fre4x/gemini 共发布 61 个版本,首次发布于 2026/02/28;过去 12 个月发布了 61 个版本。

版本发布日期距今
1.1.29latest2026/10/2323 天前
1.1.282026/10/2125 天前
1.1.272026/10/2125 天前
1.1.262026/09/221 个月前
1.1.132026/09/112 个月前
1.1.112026/09/062 个月前

其他发布通道:beta → 1.1.0-beta.6。

关于 @fre4x/gemini 的常见问题

@fre4x/gemini 是什么?

A Gemini MCP server providing multimodal analysis and image/video generation.

如何安装 @fre4x/gemini?

在项目目录运行 npm install @fre4x/gemini,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 gemini,可以用 npx gemini 直接运行。

@fre4x/gemini 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fre4x__gemini 是否存在。

@fre4x/gemini 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fre4x/gemini 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fre4x/gemini 可以商用吗?

@fre4x/gemini 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fre4x/gemini 的下载量有多少?

根据 npm 官方下载统计,@fre4x/gemini 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,683 次,日均约 89 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fre4x/gemini 还在维护吗?

最新版本 1.1.29 发布于 2026/10/23(23 天前);至今共发布 61 个版本,其中过去 12 个月发布了 61 个;首次发布于 2026/02/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。