Token导航 LogoToken导航TokenDH.com
Yass Rag logo
搜索检索stdio官方级别未说明来源级核验

Yass Rag

MCP Server

一个基于Google Gemini API的文件搜索服务,支持Google Drive同步,用于RAG工作流。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
文件搜索搜索PythonClaude文档处理Claude

安装说明

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

作者 / 组织

hdjebar

提供方

hdjebar

最后核验

2026/5/17 20:21

运行时

Python

快速接入

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

命令预览

uv run yass-rag

详细介绍

亚斯拉格

又一款简单而智能的RAG -一个MCP服务器,通过 谷歌云端硬盘同步 RAG工作流的功能。

特性

  • 店铺管理:创建、列出、获取和删除文件搜索存储
  • 文献检索:上传本地文件或文本内容
  • 🆕 谷歌云端硬盘同步:自动将驱动器文件夹同步到存储
  • 语义搜索:使用自然语言+引用查询文档
  • 多种格式:Markdown或JSON响应

可用工具

工具说明
create_store创建新的文件搜索存储
list_stores列出所有商店
get_store获取店铺详细信息
delete_store删除商店
upload_file上传本地文件
upload_text上传文本内容
search使用人工智能生成的答案进行搜索
list_files列出存储中的文件
delete_file删除文件
sync_drive_folder将Google Drive文件夹(URL或ID)同步到存储
list_drive_files预览驱动器文件夹内容(URL或ID)
configure_rag配置所有RAG设置(API密钥、型号、轮询等)
get_rag_config查看当前RAG配置
reset_rag_config将配置重置为默认值
quick_setup一个命令RAG设置

安装

使用紫外线(推荐)

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and install
git clone https://github.com/yourusername/yass-rag
cd yass-rag

# Install core dependencies
uv sync

# Or install with Google Drive support
uv sync --extra drive

# Or install everything (including dev tools)
uv sync --all-extras

配置

必需:Gemini API密钥

export GEMINI_API_KEY='your-gemini-api-key'

获取您的钥匙:https://aistudio.google.com/apikey

可选:谷歌云端硬盘凭据

重要提示: 谷歌驱动API 支持API密钥(与Gemini不同)。它需要OAuth 2.0或服务帐户,因为它访问私人用户数据。

选项1:服务帐户(建议用于服务器)

export GOOGLE_APPLICATION_CREDENTIALS='/path/to/service-account.json'
  • 最适合:自动化、服务器、共享文件夹
  • 设置:与服务帐户电子邮件共享您的驱动器文件夹

选项2:OAuth(供个人使用)

export GOOGLE_OAUTH_CREDENTIALS='/path/to/oauth-credentials.json'
  • 最适合:访问您的个人驱动器
  • 设置:需要一次性浏览器同意流程

设置Google Drive API

  1. 首选 谷歌云控制台
  2. 创建项目(或选择现有项目)
  3. 启用“Google Drive API”
  4. 创建凭据:

- 服务帐户:下载JSON密钥,与服务帐户电子邮件共享文件夹 - OAuth:下载客户端机密JSON,运行一次以进行身份验证

用法

运行服务器

# Using uv
uv run yass-rag

# Or with python module
uv run python -m yass_rag.main

# Or if installed globally
yass-rag

Claude桌面配置

添加 claude_desktop_config.json:

{
  "mcpServers": {
    "yass-rag": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/yass-rag", "yass-rag"],
      "env": {
        "GEMINI_API_KEY": "your-key",
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/credentials.json"
      }
    }
  }
}

或者,如果全局安装:

{
  "mcpServers": {
    "yass-rag": {
      "command": "yass-rag",
      "env": {
        "GEMINI_API_KEY": "your-key"
      }
    }
  }
}

示例:同步驱动器文件夹

# 1. Create a store
create_store(display_name="Company Docs")
# Returns: fileSearchStores/abc123

# 2. Sync a Drive folder (using full URL)
sync_drive_folder(
    store_name="fileSearchStores/abc123",
    folder="https://drive.google.com/drive/folders/1ABC_your_folder_id_XYZ",
    recursive=True,
    max_files=100
)

# Or just use the folder ID directly
sync_drive_folder(
    store_name="fileSearchStores/abc123",
    folder="1ABC_your_folder_id_XYZ"
)

# 3. Search your documents
search(
    store_names=["fileSearchStores/abc123"],
    query="What is our refund policy?"
)

支持的URL格式

folder 参数接受:

  • 完整URL: https://drive.google.com/drive/folders/1ABC_xyz
  • 带有用户路径的URL: https://drive.google.com/drive/u/0/folders/1ABC_xyz
  • 带有共享参数的URL: https://drive.google.com/drive/folders/1ABC_xyz?usp=sharing
  • 只有文件夹ID: 1ABC_xyz

支持的文件类型

文件:PDF、DOCX、DOC、TXT、MD、HTML 数据:JSON、CSV、XLSX、XLS、PPTX 代码:PY、JS、TS、Java、C++、Go、Rust等。 谷歌文档:自动导出为PDF/CSV

最大文件大小:每个文件100MB

RAG配置

使用配置所有RAG设置 configure_rag 工具:

# Quick one-command setup
quick_setup(
    gemini_api_key="your-key",
    drive_folder="https://drive.google.com/drive/folders/1ABC_xyz",
    project_name="My Knowledge Base",
    model="gemini-2.5-flash"
)

# Or configure individual settings
configure_rag(
    # API Configuration
    gemini_api_key="your-key",
    google_credentials_path="/path/to/credentials.json",
    
    # Model Settings
    model="gemini-2.5-pro",
    temperature=0.7,
    max_output_tokens=4096,
    
    # Polling & Async
    poll_interval_seconds=5,
    max_poll_attempts=60,
    async_uploads=False,
    
    # Google Drive Defaults
    default_drive_folder="https://drive.google.com/drive/folders/...",
    drive_recursive=True,
    drive_max_files=100,
    
    # Project/Store Defaults  
    project_store="fileSearchStores/abc123",
    default_stores=["fileSearchStores/abc123"],
    
    # Response Settings
    include_citations=True,
    citation_style="inline",
    system_prompt="You are a helpful assistant..."
)

# View current config
get_rag_config()

# Reset to defaults (preserves API keys)
reset_rag_config(confirm=True, preserve_api_keys=True)

配置选项

类别设置
APIgemini_api_key, google_credentials_path
模型model, temperature, max_output_tokens, top_p, top_k
轮询poll_interval_seconds, max_poll_attempts, async_uploads, batch_size
驾驶default_drive_folder, drive_recursive, drive_max_files, auto_sync_enabled
商店project_store, default_stores, auto_create_store
检索max_chunks, min_relevance_score, include_metadata
响应include_citations, citation_style, response_format, system_prompt

定价

功能成本
存储空间免费
查询嵌入免费
索引0.15美元/1M代币
世代标准Gemini定价

发展

# Install with dev dependencies
uv sync --all-extras

# Run linter
uv run ruff check .

# Run type checker
uv run mypy yass_rag.py

# Run tests
uv run pytest

# Format code
uv run ruff format .

# Test with MCP Inspector
npx @modelcontextprotocol/inspector uv run yass-rag

项目结构

yass-rag/
├── src/yass_rag/       # Main package
│   ├── tools/          # MCP tool definitions
│   ├── services/       # External API services (Gemini, Drive)
│   ├── models/         # Pydantic data models
│   ├── config.py       # Configuration management
│   └── server.py       # FastMCP server instance
└── tests/              # Unit and integration tests

资源

目录标签

目录标签

文件搜索搜索PythonClaude文档处理本地部署GoogleDrive同步RAG语义搜索文档管理

支持客户端

Claude

接入字段

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

stdio

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

oauth

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdiooauth部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP