Token导航 LogoToken导航TokenDH.com
AI Studio MCP Server logo
运维云端未说明官方级别未说明来源级核验

AI Studio MCP Server

MCP Server

一个与Google AI Studio/Gemini API集成的模型上下文协议服务器,提供支持文件、对话历史和系统提示的内容生成功能。

工具数

0

提示词数

0

GitHub Stars

30

资源数

0
JavaScript云端部署Docker

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

eternnoir

提供方

eternnoir

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

AI Studio MCP服务器

模型上下文协议(MCP)服务器,与Google AI Studio/Genium API集成,提供支持文件、对话历史记录和系统提示的内容生成功能。

安装和使用

先决条件

  • Node.js 20.0.0或更高版本
  • Google AI Studio API密钥

使用npx(推荐)

GEMINI_API_KEY=your_api_key npx -y aistudio-mcp-server

本地安装

npm install -g aistudio-mcp-server
GEMINI_API_KEY=your_api_key aistudio-mcp-server

配置

将Google AI Studio API密钥设置为环境变量:

export GEMINI_API_KEY=your_api_key_here

可选配置

  • GEMINI_MODEL:要使用的Gemini模型(默认值:Gemini-2.5-flash)
  • GEMINI_TIMEOUT:请求超时(毫秒)(默认值:300000=5分钟)
  • GEMINI_MAX_OUTPUT_TOKENS:最大输出令牌(默认值:8192)
  • GEMINI_MAX_FILES:每个请求的最大文件数(默认值:10)
  • GEMINI_MAX_TOTAL_FILE_SIZE:最大总文件大小(MB)(默认值:50)
  • GEMINI_TEMPERATURE:生成温度(0-2,默认值:0.2)

例子:

export GEMINI_API_KEY=your_api_key_here
export GEMINI_MODEL=gemini-2.5-flash
export GEMINI_TIMEOUT=600000  # 10 minutes
export GEMINI_MAX_OUTPUT_TOKENS=16384  # More output tokens
export GEMINI_MAX_FILES=5  # Limit to 5 files per request
export GEMINI_MAX_TOTAL_FILE_SIZE=100  # 100MB limit
export GEMINI_TEMPERATURE=0.7  # More creative responses

可用工具

生成内容

使用Gemini生成内容,全面支持文件、对话历史和系统提示。支持各种文件类型,包括图像、PDF、Office文档和文本文件。

参数:

  • user_prompt (string,必填):生成用户提示
  • system_prompt (字符串,可选):引导AI行为的系统提示
  • files (array,可选):要包含在生成中的文件数组

- 每个文件对象必须具有 pathcontent - path (string):文件路径 - content (string):Base64编码文件内容 - type (字符串,可选):MIME类型(从文件扩展名自动检测)

  • model (字符串,可选):要使用的Gemini模型(默认值:Gemini-2.5-flash)
  • temperature (数字,可选):生成温度(0-2,默认值:0.2)。较低的值产生更集中的反应,较高的值产生更有创意的反应

支持的文件类型(Gemini 2.5型号):

  • 图像:JPG、JPEG、PNG、GIF、WebP、SVG、BMP、TIFF
  • 视频:MP4、AVI、MOV、WEBM、FLV、MPG、WMV(每个请求最多10个文件)
  • 音频:MP3、WAV、AIFF、AAC、OGG、FLAC(每个文件最大15MB)
  • 文件:PDF(视为图像,一页=一张图像)
  • 文本:TXT、MD、JSON、XML、CSV、HTML

文件限制:

  • 最大文件大小:每个音频/视频/文档文件15MB
  • 最大总请求大小:20MB(使用云存储时为2GB)
  • 视频文件:每个请求最多10个
  • PDF文件遵循图像定价(一页=一张图像)

基本示例:

{
  "user_prompt": "Analyze this image and describe what you see",
  "files": [
    {
      "path": "/path/to/image.jpg"
    }
  ]
}

PDF到Markdown的转换:

{
  "user_prompt": "Convert this PDF to well-formatted Markdown, preserving structure and formatting. Return only the Markdown content.",
  "files": [
    {
      "path": "/path/to/document.pdf"
    }
  ]
}

系统提示:

{
  "system_prompt": "You are a helpful document analyst specialized in technical documentation",
  "user_prompt": "Please provide a detailed explanation of the authentication methods shown in this document",
  "files": [
    {"path": "/api-docs.pdf"}
  ]
}

多文件示例:

{
  "user_prompt": "Compare these documents and images",
  "files": [
    {"path": "/document.pdf"},
    {"path": "/chart.png"},
    {"content": "base64encodedcontent", "type": "image/jpeg"}
  ]
}

常见用例

PDF到Markdown转换

要将PDF文件转换为Markdown格式,请使用 generate_content 带有适当提示的工具:

{
  "user_prompt": "Convert this PDF to well-formatted Markdown, preserving structure, headings, lists, and formatting. Include table of contents if the document has sections.",
  "files": [
    {
      "path": "/path/to/document.pdf"
    }
  ]
}

图像分析

分析带有详细描述的图像、图表、示意图或照片:

{
  "system_prompt": "You are an expert image analyst. Provide detailed, accurate descriptions of visual content.",
  "user_prompt": "Analyze this image and describe what you see. Include details about objects, people, text, colors, and composition.",
  "files": [
    {
      "path": "/path/to/image.jpg"
    }
  ]
}

对于屏幕截图或技术图:

{
  "user_prompt": "Describe this system architecture diagram. Explain the components and their relationships.",
  "files": [
    {
      "path": "/architecture-diagram.png"
    }
  ]
}

音频转录

从音频文件生成转录:

{
  "system_prompt": "You are a professional transcription service. Provide accurate, well-formatted transcripts.",
  "user_prompt": "Please transcribe this audio file. Include speaker identification if multiple speakers are present, and format it with proper punctuation and paragraphs.",
  "files": [
    {
      "path": "/meeting-recording.mp3"
    }
  ]
}

面试或会议记录:

{
  "user_prompt": "Transcribe this interview and provide a summary of key points discussed.",
  "files": [
    {
      "path": "/interview.wav"
    }
  ]
}

MCP客户端配置

将此服务器添加到MCP客户端配置中:

{
  "mcpServers": {
    "aistudio": {
      "command": "npx",
      "args": ["-y", "aistudio-mcp-server"],
      "env": {
        "GEMINI_API_KEY": "your_api_key_here",
        "GEMINI_MODEL": "gemini-2.5-flash",
        "GEMINI_TIMEOUT": "600000",
        "GEMINI_MAX_OUTPUT_TOKENS": "16384",
        "GEMINI_MAX_FILES": "10",
        "GEMINI_MAX_TOTAL_FILE_SIZE": "50",
        "GEMINI_TEMPERATURE": "0.2"
      }
    }
  }
}

发展

设置

请确保您已安装Node.js 20.0.0或更高版本。

npm install
npm run build

在本地运行

GEMINI_API_KEY=your_api_key npm run dev

许可证

麻省理工学院

目录标签

目录标签

JavaScript云端部署DockerAI内容生成本地部署多文件处理对话历史支持系统提示集成

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明noneremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP