Skip to main content
Glama

doc-tools-mcp

Word 工具 MCP 服务器

一个模型上下文协议 (MCP) 服务器,提供 AI 驱动的 Word 文档操作功能。该服务器实现了 MCP 协议,使 AI 应用程序能够通过自然语言交互来创建、编辑和管理 Word 文档。

特征

  • 完整的 MCP 协议实现
  • Word文档的创建和管理
  • 富文本内容操作
  • 表格创建和格式化
  • 文档布局控制
  • 文档元数据管理
  • 实时文档状态监控

先决条件

  • Node.js 14 或更高版本
  • Microsoft Word(可选,用于高级功能)

安装

npx @puchunjie/doc-tools-mcp

或者全局安装:

npm install -g @puchunjie/doc-tools-mcp

用作项目中的依赖项:

npm install @puchunjie/doc-tools-mcp

用法

  1. 启动 MCP 服务器:
npx @puchunjie/doc-tools-mcp
  1. 服务器默认在 8765 端口启动
  2. 配置您的 AI 应用程序(例如 Cursor、VSCode)以使用 MCP 服务器:
    http://localhost:8765

MCP 工具

该服务器提供以下MCP功能:

  • create_document创建一个新的Word文档
    • 参数:filePath(必需)、title、author
  • open_document打开现有的Word文档
    • 参数:filePath(必需)
  • add_paragraph - 向文档添加一个段落
    • 参数:filePath(必需)、text(必需)、style、alignment
  • add_table向文档添加表格
    • 参数:filePath(必需)、rows(必需)、cols(必需)、headers、data
  • search_and_replace - 查找并替换文档中的文本
    • 参数:filePath(必需)、searchText(必需)、replaceText(必需)、matchCase
  • set_page_margins - 设置文档页边距
    • 参数:filePath(必需)、top、right、bottom、left
  • get_document_info - 获取文档元数据
    • 参数:filePath(必需)

与人工智能应用程序集成

光标

  1. 打开 Cursor 配置文件~/.cursor/mcp.json
  2. 添加以下配置:
{ "mcpServers": { "doc-tools-mcp": { "command": "npx", "args": [ "@puchunjie/doc-tools-mcp" ] } } }

或者对于本地开发版本:

{ "mcpServers": { "doc-tools-mcp": { "command": "node", "args": [ "/path/to/your/doc-tools-mcp/dist/mcp-server.js" ] } } }

配置完成后就可以使用自然语言来操作Word文档了:

"Create a new document named report.docx" "Add a heading 'Monthly Report' to report.docx" "Insert a 4x3 table with sales data"

VSCode 和其他 MCP 兼容工具

类似的集成步骤适用于其他支持 MCP 协议的工具。有关具体的 MCP 服务器配置步骤,请参阅您工具的文档。

发展

要扩展或修改此 MCP 服务器:

  1. 克隆存储库:
git clone <repository-url> cd doc-tools-mcp
  1. 安装依赖项:
npm install
  1. 以开发模式启动:
npm run start
  1. 为生产而构建:
npm run build

添加新的 MCP 功能

  1. src/services/DocumentService.ts中添加新方法
  2. src/mcp-server.ts中注册新函数
  3. 根据需要更新类型定义

配置

  • 默认端口:8765(可配置)
  • 支持的文件类型:.docx
  • 所有文件路径应为绝对路径或相对于当前工作目录的路径

执照

麻省理工学院

支持

如果您遇到任何问题或有改进建议,请在我们的 GitHub 存储库上提交问题。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

让AI通过自然语言阅读、创建和修改Word文档

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. MCP 工具
            1. 与人工智能应用程序集成
              1. 光标
              2. VSCode 和其他 MCP 兼容工具
            2. 发展
              1. 添加新的 MCP 功能
            3. 配置
              1. 执照
                1. 支持

                  Related MCP Servers

                  • -
                    security
                    F
                    license
                    -
                    quality
                    Enables AI language models to interact with Microsoft OneNote via a standardized interface, supporting notebook and page management through natural language.
                    Last updated -
                    107
                    6
                    TypeScript
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Enables AI assistants to enhance their responses with relevant documentation through a semantic vector search, offering tools for managing and processing documentation efficiently.
                    Last updated -
                    62
                    13
                    TypeScript
                  • A
                    security
                    A
                    license
                    A
                    quality
                    Integrates MATLAB with AI to execute code, generate scripts from natural language, and access MATLAB documentation seamlessly.
                    Last updated -
                    2
                    29
                    JavaScript
                    Apache 2.0
                    • Apple
                    • Linux
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Enables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.
                    Last updated -
                    JavaScript
                    • Apple

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/puchunjie/doc-tools-mcp'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server