MCP Reference: docsmcp.googleapis.com

这是一个 MCP 服务器,提供用于与 Google 文档交互的工具。

Model Context Protocol (MCP) 服务器充当外部服务(为大语言模型 [LLM] 或 AI 应用提供上下文、数据或功能)与 LLM 或 AI 应用之间的代理。MCP 服务器将 AI 应用连接到数据库和 Web 服务等外部系统,并将这些系统的响应转换为 AI 应用可理解的格式。

MCP 工具

MCP 工具是 MCP 服务器向 LLM 或 AI 应用公开的函数或可执行功能,用于在现实世界中执行操作。

工具

docsmcp.googleapis.com MCP 服务器具有以下工具:

MCP 工具
read_doc

此工具会检索给定 Google 文档的文档 ID 的 JSON 表示形式。

JSON 表示形式包含文档的文本和结构信息。

与 REST API 中的 documents.get 相对应。

update_doc

使用批量更新请求更新文档。它接受 documents.batchUpdate 请求(以 JSON 格式)。

与 REST API 中的 documents.batchUpdate 相对应。

可能的更新列表如下:

  • replaceAllText:替换指定文本的所有实例。
  • insertText:在指定位置插入文本。
  • updateTextStyle:更新指定范围内的文本样式。
  • createParagraphBullets:为段落创建项目符号。
  • deleteParagraphBullets:从段落中删除项目符号。
  • createNamedRange:创建命名范围。
  • deleteNamedRange:删除命名范围。
  • updateParagraphStyle:更新指定范围内的段落样式。
  • deleteContentRange:从文档中删除内容。
  • insertInlineImage:在指定位置插入内嵌图片。
  • insertTable:在指定位置插入表格。
  • insertTableRow:在表格中插入空行。
  • insertTableColumn:在表格中插入空列。
  • deleteTableRow:从表格中删除行。
  • deleteTableColumn:从表格中删除列。
  • insertPageBreak:在指定位置插入分页符。
  • deletePositionedObject:从文档中删除定位的对象。
  • updateTableColumnProperties:更新表格中列的属性。
  • updateTableCellStyle:更新表格单元格的样式。
  • updateTableRowStyle:更新表格中的行样式。
  • replaceImage:替换文档中的图片。
  • updateDocumentStyle:更新文档的样式。
  • insertInlineSheetsChart:在指定位置插入内嵌 Google 表格图表。
  • mergeTableCells:合并表格中的单元格。
  • unmergeTableCells:取消合并表格中的单元格。
  • refreshSheetsChart:刷新 Google 表格图表。
  • createHeader:创建页眉。
  • createFooter:创建页脚。
  • createFootnote:创建脚注。
  • replaceNamedRangeContent:替换命名范围内的内容。
  • updateEmbeddedObject:更新嵌入式对象的属性。
  • updateSectionStyle:更新指定范围内的节样式。
  • insertSectionBreak:在指定位置插入分节符。
  • deleteHeader:从文档中删除页眉。
  • deleteFooter:从文档中删除页脚。
  • pinTableHeaderRows:更新表格中固定的页眉行数。
  • addDocumentTab:添加文档标签页。
  • deleteTab:删除文档标签页。
  • updateDocumentTabProperties:更新文档标签页的属性。
  • insertPerson:插入人物提及。
  • updateNamedStyle:更新命名样式。
  • insertRichLink:插入富链接。
  • insertDate:插入日期。
  • insertComment:将 CommentThread 插入文档。
  • addCommentReply:向 CommentThread 或 SuggestionThread 添加回复。
  • updateCommentPost:更新 CommentThread 或 SuggestionThread 的现有帖子(主帖子或回复)。
  • deleteComment:删除 CommentThread。
  • deleteCommentReply:从 CommentThread 或 SuggestionThread 中删除回复帖子。
  • acceptSuggestion:接受建议。
  • rejectSuggestion:拒绝建议。
  • deleteSuggestion:删除建议。

获取 MCP 工具规范

如需获取 MCP 服务器中所有工具的 MCP 工具规范,请使用 tools/list 方法。下面的示例演示了如何使用 curl 列出 MCP 服务器中当前可用的所有工具及其规范。

Curl 请求
curl --location 'https://docsmcp.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
    "method": "tools/list",
    "jsonrpc": "2.0",
    "id": 1
}'