mcp-google-docs

by dev-ithitchhiker
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides tools for Google Drive manipulation including listing files, copying files, renaming files, and creating various types of documents including empty spreadsheets and template-based spreadsheets.

  • Offers comprehensive Google Sheets functionality for managing sheets, manipulating data (rows/columns/cells), creating and modifying charts, and updating cell formats. Includes capabilities for sheet listing, copying, renaming, and data retrieval.

MCP Google 电子表格

用于操作 Google 电子表格和 Google Drive 的 MCP(Metoro 控制协议)工具。使用 MCP(Metoro 控制协议)操作 Google 电子表格和 Google Drive 的工具。

特征

Google Drive 功能

  • 列出文件
  • 复制文件
  • 重命名文件
  • 创建空白电子表格
  • 从模板创建电子表格
  • 复制现有电子表格

Google 表格功能

  • 列表表
  • 复印件
  • 重命名工作表
  • 获取工作表数据
  • 添加/删除行
  • 添加/删除列
  • 更新单元格
  • 创建/更新/删除图表
  • 更新单元格格式

如何安装(安装)

1.虚拟环境设置

macOS/Linux

# 가상 환경 생성 (Create virtual environment) python -m venv venv # 가상 환경 활성화 (Activate virtual environment) source venv/bin/activate

视窗

# 가상 환경 생성 (Create virtual environment) python -m venv venv # 가상 환경 활성화 (Activate virtual environment) venv\Scripts\activate

2.安装所需的软件包:

pip install -r requirements.txt

3. Google Cloud Console 设置

  1. 在 Google Cloud Console 中创建一个项目。 (在 Google Cloud Console 中创建项目)
  2. 生成 OAuth 2.0 客户端 ID。 (创建 OAuth 2.0 客户端 ID)
  3. 启用所需的 API:
    • Google 表格 API
    • Google Drive API

4.环境变量设置:

export MCPGD_CLIENT_SECRET_PATH="/path/to/client_secret.json" export MCPGD_FOLDER_ID="your_folder_id" export MCPGD_TOKEN_PATH="/path/to/token.json" # 선택사항 (Optional)

如何使用(用法)

1.运行程序:

python main.py

2. 通过 MCP 使用工具:

# 예시: 파일 목록 조회 (Example: List files) mcp list_files # 예시: 시트 데이터 조회 (Example: Get sheet data) mcp get_sheet_data --spreadsheet-id "your_spreadsheet_id" --range "Sheet1!A1:D10" # 예시: 차트 생성 (Example: Create chart) mcp create_chart --chart-type "LINE" --range "A1:B10" --sheet-name "Sheet1" --title "Sales Trend"

环境变量

  • MCPGD_CLIENT_SECRET_PATH :Google OAuth 2.0 客户端密钥文件的路径
  • MCPGD_FOLDER_ID :Google Drive 文件夹 ID(Google Drive 文件夹 ID)
  • MCPGD_TOKEN_PATH :令牌存储文件的路径(可选,默认值:~/.mcp_google_spreadsheet.json)

执照

MIT 许可证

ID: 1oos2ptkkj