返回市场
双子座Mcp服务器

双子座Mcp服务器

作者:bowwowxx3 星标更新:2025-08-09

项目介绍

GeminiMcpServer

GeminiMcpServer 是一个支持 Model Context Protocol (MCP) 的服务器,可以与 LM Studio(或其他支持的客户端)以及 Google Gemini API 实现无缝连接,用于图像生成和多模态任务处理。

mole


✨ 特性

  • 🔗 完整的MCP支持 - 支持LM Studio类MCP即时客户端集成。
  • 🎨 图像生成 - 使用Google Gemini 2模型生成图像。
  • 🖼 多模态输入 - (可选)同时处理文本和图像输入。
  • 本地和云端混合处理 - 在本地执行LM Studio的同时利用Gemini API提供的云计算能力。

📦 系统需求


🚀 安装和设置

git clone git@github.com:bowwowxx/GeminiMcpServer.git
cd GeminiMcpServer
npm install

建立 Google API密钥:

  1. 访问 Google AI Studio
  2. 建立一个新的API密钥

设置环境变量: 在项目的根目录创建.env文件并添加:

GEMINI_API_KEY="your_api_key_here"

▶ 使用方法

启动服务器:

npm start

进行测试:

npx tsx testapi.js

此测试将使用Gemini 2实验图像生成API创建图像。

mole


📡 MCP请求示例

{
  "tool": "generateImage",
  "params": {
    "prompt": "一只站在阳光田野中的逼真3D渲染猪",
    "outputFormat": "png",
    "aspectRatio": "16:9"
  }
}

📡 LM Studio示例设置

{
  "mcpServers": {
    "GeminiMcpServer": {
      "command": "npm",
      "args": [
        "run",
        "start"
      ],
      "cwd": "/Users/bowwow/github/GeminiMcpServer"
    }
  }
}

mole