# adexltd
## 基本信息
- Slug: `adexltd-mcp-google-suite`
- Source: modelscope
- Publisher: @adexltd/mcp-google-suite
- Categories: cloud-storage / app-automation
- Hosted: Yes
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@adexltd/mcp-google-suite
## 简介
暂无描述。
## MCP Server 详情

# MCP Google Workspace 服务器

[![CI](https://github.com/adexltd/mcp-google-suite/actions/workflows/ci.yml/badge.svg)](https://github.com/adexltd/mcp-google-suite/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/adexltd/mcp-google-suite/branch/main/graph/badge.svg)](https://codecov.io/gh/adexltd/mcp-google-suite)
[![PyPI version](https://badge.fury.io/py/mcp-google-suite.svg)](https://badge.fury.io/py/mcp-google-suite)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

一个模型上下文协议（MCP）服务器，使AI代理能够与Google Workspace（Drive、Docs和Sheets）服务进行交互。

## 🌟 特性

- Google Drive：搜索文件、创建文件夹
- Google Docs：创建、读取、更新文档
- Google Sheets：创建电子表格、读写单元格值
- 多种传输模式：标准输入输出（默认）、SSE、WebSocket
- 支持MCP兼容的客户端（如Cursor等）

## 📋 安装

### 使用uv（推荐）
bash
uvx mcp-google-suite


### 使用pip
bash
pip install mcp-google-suite


### 开发环境设置
bash
# 克隆并安装
git clone git@github.com:adexltd/mcp-google-suite.git && cd mcp-google-suite
uv venv && source .venv/bin/activate  # 或者在Windows上使用.venvScriptsactivate
uv pip install -e .


## 🔧 配置

### 配置MCP客户端

将以下内容添加到您的客户端设置中（例如Cursor, Claude）：

使用uvx（推荐）：
json
{
  "mcpServers": {
    "mcp-google-suite": {
      "command": "uvx",
      "args": ["mcp-google-suite"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "~/.google/server-creds.json",
        "GOOGLE_OAUTH_CREDENTIALS": "~/.google/oauth.keys.json"
      }
    }
  }
}


使用pip安装：
json
{
  "mcpServers": {
    "mcp-google-suite": {
      "command": "python",
      "args": ["-m", "mcp_google_suite"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "~/.google/server-creds.json",
        "GOOGLE_OAUTH_CREDENTIALS": "~/.google/oauth.keys.json"
      }
    }
  }
}


### Google OAuth 设置
1. 访问 [Google Cloud Console](https://console.cloud.google.com)
2. 启用Drive、Docs和Sheets API
3. 创建OAuth 2.0凭据
4. 保存为 `~/.google/oauth.keys.json`
5. 运行 `mcp-google auth` 进行身份验证

### 可用工具

#### Drive 操作
- `drive_search_files`: 在Google Drive中搜索文件
  - `query` (字符串, 必需): 搜索查询
  - `page_size` (整数, 可选): 返回的结果数量
- `drive_create_folder`: 创建新文件夹
  - `name` (字符串, 必需): 文件夹名称
  - `parent_id` (字符串, 可选): 父文件夹ID

#### Docs 操作
- `docs_create`: 创建新文档
  - `title` (字符串, 必需): 文档标题
  - `content` (字符串, 可选): 初始内容
- `docs_get_content`: 获取文档内容
  - `document_id` (字符串, 必需): 文档ID
- `docs_update_content`: 更新文档内容
  - `document_id` (字符串, 必需): 文档ID
  - `content` (字符串, 必需): 新内容

#### Sheets 操作
- `sheets_create`: 创建新电子表格
  - `title` (字符串, 必需): 电子表格标题
  - `sheets` (数组, 可选): 工作表名称
- `sheets_get_values`: 获取单元格值
  - `spreadsheet_id` (字符串, 必需): 电子表格ID
  - `range` (字符串, 必需): A1表示法范围
- `sheets_update_values`: 更新单元格值
  - `spreadsheet_id` (字符串, 必需): 电子表格ID
  - `range` (字符串, 必需): A1表示法范围
  - `values` (二维数组, 必需): 值数组

## 🛠️ 开发

bash
# 安装开发依赖
uv pip install -e ".[dev]"

# 设置pre-commit钩子
pre-commit install

# 运行测试
pytest

# 格式化代码
black . && ruff check --fix .


## 🔍 调试

使用MCP Inspector进行交互式测试：

bash
# 使用uvx
npx @modelcontextprotocol/inspector uvx mcp-google

# 对于开发
cd path/to/mcp-google-suite
npx @modelcontextprotocol/inspector uv run mcp-google## 📚 资源

- [文档](https://github.com/adexltd/mcp-google-suite/wiki)
- [MCP Inspector](https://github.com/modelcontextprotocol/inspector)
- [预提交钩子](https://pre-commit.com)
- [Google Cloud 控制台](https://console.cloud.google.com)

## 🤝 贡献

请阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 以了解我们的行为准则以及提交拉取请求的流程。

## 🔒 安全

有关报告漏洞和最佳实践的信息，请参阅 [SECURITY.md](SECURITY.md)。

## 📄 许可证

MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。

