Office Viewer
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Antigravity Office 预览器(Office Viewer)
English | 简体中文
一个纯本地、离线运行、零第三方服务端依赖的 Antigravity MCP App 插件,补齐 Antigravity 桌面端(App)侧边栏无法直接预览 Office 与 PDF 文档的缺失功能。
支持在右侧边栏直接渲染 Word(.docx / .doc)、Excel(.xlsx / .xls / .csv / .tsv)、PowerPoint(.pptx / .ppt) 与 PDF(.pdf),不上传任何云端数据、不修改原始文件。
核心特性
四大格式一站式预览
Word(
.docx/.doc):还原段落、标题、表格、页眉页脚与图片;内置中文公文/法律常用字体别名映射(仿宋、楷体、宋体、黑体等);自动提取可折叠章节大纲并统计字数/页数。Excel & 表格(
.xlsx/.xls/.csv/.tsv):多工作表标签切换、支持合并单元格、点击列头升/降序排序、关键词筛选、行号冻结、数字右对齐以及一键导出 CSV / 复制表格。PowerPoint(
.pptx/.ppt):支持单页演示模式(←/→键盘翻页)与连续滚动模式切换,完整渲染文本框、形状颜色、内嵌图片、表格以及可折叠演讲者备注(Speaker Notes)。PDF(
.pdf):纯离线内联 PDF.js 渲染,支持连续滚动 / 单页阅读、可视区懒加载、书签大纲解析、90° 页面旋转、页内搜索高亮、划词复制与「引用到对话」。
跨平台支持(macOS / Windows / Linux)
原生封装外部程序打开(
open/start/xdg-open)、文件管理器定位与系统文件选择框。旧版二进制格式(
.doc/.xls/.ppt)在系统临时缓存区自动只读转码预览(macOS.doc优先使用内置textutil,其余格式及 Windows / Linux 自动探测本机 LibreOffice)。
专注阅读与工作流集成
阅读主题切换:白纸 / 暖纸护眼 / 深色模式
页内关键词搜索与高亮跳转(
⌘F/Ctrl+F)一键打印 / 导出 PDF(内置
@media print净化排版)引用到对话:一键将当前文档路径或选中文本段落附加到下一条 AI 对话上下文
中 / EN 双语界面:跟随宿主语言自动切换,支持顶栏手动切换
零运行时依赖 & 预构建单文件:已内置打包好的
dist/office-viewer.html,克隆或安装后无需npm install即可直接被 Antigravity 加载运行。
Related MCP server: Antigravity File Viewer
支持格式一览
类别 | 原生离线直接渲染 | 通过本地转换器只读转码预览 |
Word |
|
|
Excel / 表格 |
|
|
PowerPoint |
|
|
| — |
注:如果本机未安装 LibreOffice 且预览
.xls/.ppt,插件会提示说明并提供一键「外部打开」按钮调用本机默认办公软件。
快速安装
方式一:克隆仓库并软链接到 Antigravity 插件目录(推荐)
git clone https://github.com/wflawyer/antigravity-office-viewer.git
cd antigravity-office-viewer
node scripts/install-local.mjsWindows 用户若未开启符号链接权限,可执行复制安装:
node scripts/install-local.mjs --copy方式二:直接放入插件目录
将本仓库放到 ~/.gemini/config/plugins/office-viewer/,Antigravity 会自动发现并加载,无需重启客户端。
使用方法
从侧边栏随时打开:点击 Antigravity 右侧边栏顶部
+→ 选择 「Office 预览」(或左侧导航栏入口),即可浏览快捷目录、查看最近文档,或直接把.docx/.xlsx/.csv/.pptx/.pdf文件拖入窗口预览。在对话中让 AI 打开:直接对 AI 说「在侧边栏预览这份 Word / Excel / PPT / PDF 文件」,AI 会自动调用
preview_office在右侧边栏呈现。
隐私与安全设计
100% 本地离线:静态前端页面完全打包为单文件 HTML,无任何外部 CDN 请求。
原文件绝对只读:所有转换均写入系统临时目录并按路径和修改时间哈希缓存,绝不向文档原目录写入临时文件。
随机 Token 隔离与敏感文件拦截:内置 HTTP 文件流仅绑定
127.0.0.1随机空闲端口与 24 位随机令牌;自动跳过~$锁文件,并拒绝.env、.ssh、私钥及非白名单文件。
本地开发与测试
# 安装开发构建与测试依赖
npm install
# 重新打包单文件 UI(输出至 dist/office-viewer.html)
npm run build
# 运行解析器与 MCP 服务端集成测试
npm test
# 一键构建并校验全部测试
npm run check目录结构
├── plugin.json # Antigravity 插件元数据
├── mcp_config.json # MCP 服务启动配置
├── server/
│ ├── mcp-server.mjs # 零依赖 JSON-RPC 2.0 服务端与只读文件流服务
│ ├── file-utils.mjs # 路径解析、敏感文件拦截、目录遍历与最近记录
│ └── platform.mjs # macOS / Windows / Linux 系统动作与转码适配
├── ui/
│ ├── index.html / style.css / main.js / i18n.js
│ ├── parsers/ # 纯 JS XML、XLSX/CSV 与 PPTX 解析器
│ └── renderers/ # Word、电子表格与幻灯片渲染器
├── dist/office-viewer.html # 预构建单文件产物(用户免构建开箱即用)
├── rules/AGENTS.md # Agent 侧边栏预览联动规范
├── skills/office-viewer/ # 技能说明
└── test/ # node:test 单元测试与端到端集成测试开源协议
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert PDF pages into editable Word-ready text from your AI chat, all offline.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Merge, split, extract, rotate, reorder and stamp PDF pages from your AI chat, all offline.
Merge, split, extract, rotate, reorder and stamp PDF pages from your AI chat, all offline.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables offline browsing, previewing, searching, and citing local PDFs, Word, Excel/CSV, Markdown, HTML, images, and code directly in Antigravity's sidebar, with agent integration for opening documents and sending selected text to conversations.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables previewing local Word, Excel, PowerPoint, PDF, HTML, ZIP, Jupyter Notebook, media, images/SVG, and Markdown files directly in Google Antigravity's sidebar or full-page view, with automatic agent-driven opening and file navigation.MIT
- AlicenseBqualityBmaintenanceEnables Google Antigravity users to preview Word, Excel, PowerPoint, and PDF files locally in the conversation’s right-hand panel without downloading or uploading documents, and lets AI agents open previews via the preview_office_file tool.3MIT
- AlicenseNot gradedqualityBmaintenanceEnables native right-sidebar and file-tab previews for PDF, Word, Excel, CSV, and PowerPoint documents in Google Antigravity, including AI-assisted opening and document-center browsing.MIT