TUNC.AI / Tunc Doc 指南

从任何智能体创建并导出 Word、Excel 和 PowerPoint

把 Claude、ChatGPT、Cursor 或你自己的代码接到 Tunc Doc,创建、导入和导出 DOCX、XLSX、PPTX 与 PDF 文件。

更新于

大多数 AI 应用能在对话里写 Markdown,但要把这些工作变成一份可编辑的 Word 文档、一个带实时公式和图表的 Excel 工作簿,或者一套 PowerPoint 幻灯片,通常只能手工复制文本或者跑本地脚本。Tunc Doc 给任何已连接的智能体 22 个云端工具,用来创建、读取、编辑、导入和导出文档、表格和幻灯片。

1. 通过 MCP 连接你的 AI 应用

把你的助手接到 https://mcp.tuncdoc.com/mcp,在浏览器里用你的 Tunc 账号登录。在 Tunc Hub 里,这 22 个工具都是内置的。

客户端步骤
claude.ai, Claude Desktop and Claude mobileCustomize → Connectors → Add custom connector → 名称填 Tunc Doc,URL 填 https://mcp.tuncdoc.com/mcp → Add → Connect。免费版只允许一个自定义连接器;Team 和 Enterprise 由 Owner 在 Organization settings → Connectors 里添加。这个链接会打开对话框,名称和 URL 已经填好:
https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Tunc%20Doc&connectorUrl=https%3A%2F%2Fmcp.tuncdoc.com%2Fmcp
Claude Code先添加服务器,然后运行 /mcp,选择 tunc-doc,再 Authenticate。
claude mcp add --transport http tunc-doc https://mcp.tuncdoc.com/mcp
ChatGPTSettings → Apps & Connectors → Advanced → 打开 Developer mode → Create → 名称填 Tunc Doc,URL 填 https://mcp.tuncdoc.com/mcp,Authentication 选 OAuth → Create → Connect。
Cursor加到 ~/.cursor/mcp.json,然后 Settings → MCP:会显示“Needs login” → Login。
{
  "mcpServers": {
    "tunc-doc": {
      "url": "https://mcp.tuncdoc.com/mcp"
    }
  }
}
VS Code (Copilot)命令面板 → MCP: Add Server → HTTP → https://mcp.tuncdoc.com/mcp → 名称 tunc-doc → 允许登录提示。
Gemini CLI加到 settings.json,然后运行 /mcp auth tunc-doc。
{
  "mcpServers": {
    "tunc-doc": {
      "httpUrl": "https://mcp.tuncdoc.com/mcp"
    }
  }
}
Copilot StudioTools → Add a tool → New tool → Model Context Protocol → URL 填 https://mcp.tuncdoc.com/mcp → Authentication 选 OAuth 2.0,Dynamic discovery。

2. 文档、表格和幻灯片

  • 文档(kind "doc"):Markdown,最大 1 MiB。智能体用 doc_create 创建,用 doc_edit 做精确替换,或者基于完整版本用 doc_write 重写。
  • 表格(kind "sheet"):单元格、公式、数字格式和图表。智能体用 sheet_read 读范围,用 sheet_write 写值和公式,用 sheet_ops 和 sheet_add_chart 执行原子操作(排序、格式、合并、图表)。
  • 幻灯片(kind "deck"):用模板或 HTML 生成。智能体用 deck_read 检查幻灯片,用 deck_edit 改元素,用 deck_add_slides 加页,用 deck_render 渲染 PNG,用 deck_check 检查版式。

3. 导入和导出 Office 文件和 PDF

智能体用 doc_import 引入已有的 Word(DOCX)、PowerPoint(PPTX)、Excel(XLSX、XLS、ODS、CSV)和 Markdown 文件(通过 REST 最大 16 MiB,单次 MCP 调用约 3 MiB)。工作完成后,doc_export 把文档导出为 DOCX、PDF、Markdown 或 HTML,把演示稿导出为可编辑的 PPTX、PDF 或 PNG 幻灯片,把表格导出为 XLSX、CSV 或 PDF。传 to_art 会把导出的文件直接保存到 Tunc Art,并带自己的私密链接。

在你自己的代码里,通过 REST 或 A2A

在 https://tunchub.com/account/keys/new 创建一个 API 密钥,然后调用 https://api.tuncdoc.com/v1/docs 或 https://api.tuncdoc.com/v1/tool:

# Create a doc and get its link
curl -s https://api.tuncdoc.com/v1/docs \
  -H "Authorization: Bearer $TUNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Q3 plan","markdown":"# Q3 plan\n\nShip the beta."}'
# → {"doc":{"id":…,"code":…,"url":"https://tuncdoc.com/<code>",…},"markdown":…,"revision":…}

# Docs you can open (paged), and one doc as Markdown with the revision to edit from
curl -s "https://api.tuncdoc.com/v1/docs?limit=20" -H "Authorization: Bearer $TUNC_API_KEY"
curl -s https://api.tuncdoc.com/v1/docs/<doc> -H "Authorization: Bearer $TUNC_API_KEY"

# Change part of it: every edit applies, or none does
curl -s https://api.tuncdoc.com/v1/docs/<doc>/edit \
  -H "Authorization: Bearer $TUNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"edits":[{"old":"Ship the beta.","new":"Ship the beta in May."}],"if_revision":"<revision>"}'

# Or send the whole new text from the revision you read; newer changes are kept.
# A revision ending in #… (#partial, #edited, #merged, #stale) works as doc_edit's
# if_revision, but not as a write base: read the whole doc again first.
curl -s https://api.tuncdoc.com/v1/docs/<doc>/write \
  -H "Authorization: Bearer $TUNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Q3 plan\n\nShipped.","base_revision":"<revision>"}'

# Export as pdf, docx, md or html (the file name is in Content-Disposition),
# or save a copy to Tunc Art and get its link
curl -s "https://api.tuncdoc.com/v1/docs/<doc>/export?format=pdf" -H "Authorization: Bearer $TUNC_API_KEY" -OJ
curl -s https://api.tuncdoc.com/v1/docs/<doc>/art \
  -H "Authorization: Bearer $TUNC_API_KEY" \
  -H "Content-Type: application/json" -d '{"format":"pdf"}'
# → {"url":"https://tuncart.com/<code>","expires_at":…,"display_name":"Q3 plan.pdf",…}

# The doc as the web page tuncdoc.com shows (HTML, no scripts)
curl -s https://api.tuncdoc.com/v1/docs/<doc>/render -H "Authorization: Bearer $TUNC_API_KEY"

# Bring in a Word, PowerPoint, Markdown or spreadsheet file (up to 16 MiB) as the request body.
# format is docx, pptx, md, xlsx, xls, ods or csv; the answer is the new doc, deck or sheet and its link
curl -s "https://api.tuncdoc.com/v1/docs/import?format=pptx" \
  -H "Authorization: Bearer $TUNC_API_KEY" \
  --data-binary @deck.pptx

# Any of the 22 tools by name, decks and sheets included: read a sheet's cells
curl -s https://api.tuncdoc.com/v1/tool \
  -H "Authorization: Bearer $TUNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"sheet_read","arguments":{"doc":"<doc>","range":"A1:C5"}}'

# Delete a doc, deck or sheet: its link stops working for everyone
curl -s -X DELETE https://api.tuncdoc.com/v1/docs/<doc> -H "Authorization: Bearer $TUNC_API_KEY"

或者调用 A2A 1.0 智能体:

curl -s https://a2a.tuncdoc.com -H "Authorization: Bearer $TUNC_API_KEY" -H 'A2A-Version: 1.0' \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"SendMessage","params":{"message":{
        "messageId":"m-1","role":"ROLE_USER",
        "parts":[{"data":{"skill":"doc_list","arguments":{}},"mediaType":"application/json"}]}}}'
# → {"jsonrpc":"2.0","id":1,"result":{"message":{"role":"ROLE_AGENT",
#      "parts":[{"data":{…the tool's result…},"mediaType":"application/json"}],…}}}

免费版:Tunc Hub、Tunc Art、Tunc Doc 和 Tunc Orb 共用 1 GB 存储。