关于 Google Docs MCP Server
Google Docs MCP Server 将语言模型连接到 Google Docs,用于搜索和编辑文档。它支持创建文档、追加内容和替换现有内容。
主要功能
- 01按查询搜索 Google Docs
- 02创建并填入初始内容
- 03向文档追加内容
- 04替换文档内容
适用场景
- 01查找 Google Drive 中的文档
- 02创建带初始文本的文档
- 03向现有文档添加内容
- 04替换文档内容
MCP 相关
它通过 MCP 向客户端提供 Google Docs 搜索与编辑工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Google Docs MCP 服务
一个用于 Google Docs API 的模型上下文协议(MCP)服务,允许语言模型创建、搜索、追加内容到 Google 文档,以及更新 Google 文档。
功能
- 搜索文档:使用自定义查询在 Drive 中搜索 Google 文档
- 创建文档:创建新的 Google 文档,可选择添加初始内容
- 追加到文档:将内容追加到现有 Google 文档的末尾
- 更新文档:用新内容替换现有 Google 文档中的内容
设置
先决条件
- Node.js(v14 或更高版本)
- npm
- 已启用 Google Drive API 和 Google Docs API 的 Google Cloud Platform 账号
安装
-
克隆此仓库:
git clone <repository-url> cd google-docs-mcp-server -
安装依赖:
npm install -
设置 Google API 凭据:
- 前往 Google Cloud Console
- 创建新项目(或选择现有项目)
- 启用 Google Drive API 和 Google Docs API
- 创建 OAuth 2.0 凭据(桌面应用)
- 下载凭据 JSON 文件,并将其保存为项目根目录中的
credentials.json
-
获取身份验证令牌:
node get-refresh-token.js按照浏览器中的提示授权此应用。这将创建一个
token.json文件。 -
构建服务:
npm run build
构建 Extism 插件
此服务使用 Extism WebAssembly 插件与 Google Docs API 交互。要构建插件:
cd extism-plugin
npm install
npm run build
这将在 dist 目录中创建 plugin.wasm 文件。
使用方法
运行服务
启动 MCP 服务:
npm start
或使用显式的 node 命令:
node build/index.js
直接测试插件
你可以使用 Extism CLI 直接测试 Extism 插件:
cd extism-plugin
extism call --wasi --allow-host www.googleapis.com --allow-host docs.googleapis.com --config GOOGLE_ACCESS_TOKEN=<your-access-token> dist/plugin.wasm describe
搜索文档:
extism call --wasi --allow-host www.googleapis.com --allow-host docs.googleapis.com --config GOOGLE_ACCESS_TOKEN=<your-access-token> dist/plugin.wasm call --input '{"toolId": "search_docs", "arguments": {"query": "name contains \"report\""}}'
创建新文档:
extism call --wasi --allow-host www.googleapis.com --allow-host docs.googleapis.com --config GOOGLE_ACCESS_TOKEN=<your-access-token> dist/plugin.wasm call --input '{"toolId": "create_doc", "arguments": {"title": "My New Document", "content": "Initial content"}}'
许可证
MIT
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。