Cursor配置markdown转Word的MCP工具教程

前言

今天在写论文,使用cursor生成论文的整个源码及说明文档,AI大模型目前是不能直接生成Word的,给cursor安排了Word-MCP。Office-Word-MCP-Server是一个专为Cursor编辑器设计的MCP(Model Context Protocol)服务器,它能够实现在Cursor中Word文档创建、markdown转Word等功能。

项目简介

Office-Word-MCP-Server(https://github.com/GongRzhe/Office-Word-MCP-Server.git)是一个基于MCP协议的开源项目,主要功能包括:

  • 文档创建与编辑:直接从Cursor创建和修改Word文档
  • 格式转换:将Markdown、代码块转换为Word格式
  • 实时同步:保持Cursor和Word内容的同步更新
  • 模板支持:使用预定义模板快速生成文档

环境准备

系统要求

  • Windows 10/11(支持Microsoft Word)
  • Node.js 16.0或更高版本
  • Cursor编辑器最新版本
  • Microsoft Word 2016或更高版本

依赖安装

首先克隆项目到本地:

bash 复制代码
git clone https://github.com/GongRzhe/Office-Word-MCP-Server.git
cd Office-Word-MCP-Server

安装项目依赖:

bash 复制代码
npm install

或使用yarn:

bash 复制代码
yarn install

Cursor配置步骤


1. 配置MCP服务器

在Cursor中打开设置,找到MCP配置选项,添加以下配置:

json 复制代码
{
  "mcpServers": {
    "word-document-server": {
      "command": "G:\\aicode\\cursorword\\Office-Word-MCP-Server\\.venv\\Scripts\\python.exe",
      "args": [
        "G:\\aicode\\cursorword\\Office-Word-MCP-Server\\word_mcp_server.py"
      ],
      "env": {
        "PYTHONPATH": "G:\\aicode\\cursorword\\Office-Word-MCP-Server",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

2. 修改配置文件路径

将上述配置中的`替换为实际的项目路径,例如:

你根据上面实际的路径,替换3个G盘的路径为你自己的实际路径。

3. 启动服务验证

重启Cursor编辑器,在命令面板中输入"MCP"查看是否成功加载Office-Word服务器。

核心功能使用

文档创建功能

在Cursor中使用以下命令创建新的Word文档:

javascript 复制代码
// 通过MCP调用创建文档
AI会自动调用WORD的MCP

Markdown转Word

复制代码
To update, run: G:\aicode\cursorword\Office-Word-MCP-Server\.venv\Scripts\python.exe -m pip install --upgrade pip
Requirements installed successfully!

MCP configuration has been written to: G:\aicode\cursorword\Office-Word-MCP-Server\mcp-config.json

MCP configuration for Claude Desktop:
{
  "mcpServers": {
    "word-document-server": {
      "command": "G:\\aicode\\cursorword\\Office-Word-MCP-Server\\.venv\\Scripts\\python.exe",
      "args": [
        "G:\\aicode\\cursorword\\Office-Word-MCP-Server\\word_mcp_server.py"
      ],
      "env": {
        "PYTHONPATH": "G:\\aicode\\cursorword\\Office-Word-MCP-Server",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

💻 STDIO Transport Configuration:
   Server runs locally with standard input/output
```c

总结

通过本教程,您已经学会了如何在Cursor中配置和使用Office-Word-MCP-Server工具。这个强大的集成方案为开发者提供了:

  1. 无缝集成:Cursor与Word之间的直接数据交换
  2. 格式转换:自动化的Markdown到Word转换
  3. 模板支持:快速生成标准化文档
  4. 批量处理:高效的大量文档操作
相关推荐
骆驼爱记录4 天前
WPS页码设置:第X页共Y-1页
自动化·word·excel·wps·新人首发
2301_816997884 天前
Word 清除格式的方法
word
微光feng4 天前
毕业论文word引用操作汇总
word·目录·公式·毕业论文·交叉引用·题注
2301_816997884 天前
Word 功能区与快速访问工具栏
word
halen3334 天前
Hellowordl: The Masters Tool for Word Puzzle Enthusiasts
word
lpfasd1235 天前
Markdown 导出 Word 文档技术方案
开发语言·c#·word
Cxiaomu5 天前
Python 文件解析: Excel / Word / PDF 的解析、处理、预览与下载
python·word·excel
bu_shuo5 天前
Word中插入文本内容控件并交叉引用
word·内容控件
缺点内向5 天前
C#中如何创建目录(TOC):使用Spire.Doc for .NET实现Word TOC自动化
c#·自动化·word·.net
2301_816997885 天前
Word 创建打开与保存文档
c#·word·xhtml