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. 批量处理:高效的大量文档操作
相关推荐
清纯世纪2 小时前
word设置的正文样式,按回车后变成了样式格式
word
ELI_He9993 小时前
WPS制作论文三线表
word·论文
坚定信念,勇往无前7 小时前
vue3图片,pdf,word,excel,ppt多格式文件预览组件Vue Doc Viewers Plus
pdf·word·excel
qq_296544651 天前
在怎么编辑PDF?专业级pdf转换教程,PDF在线编辑,Word转PDF使用方法
microsoft·pdf·word
jameszjd1 天前
解决WPS word主选项卡审阅栏消失问题
word·wps
fie88891 天前
Qt对Word网页的读写功能实现
开发语言·qt·word
secondyoung2 天前
WPS宏使用:一键批量调整图片与表格格式
经验分享·word·lua·markdown·wps·vb
m5655bj2 天前
Python 将 Word 文档转换为 Markdown 格式
python·c#·word
天地一沙鸥GW2 天前
如何将Word文档中已设置好的样式复制/迁移到另一个Word中??
word
qq_296544652 天前
永久免费的PDF转word,PDFgear安卓版,mac版,win版都有,word转PDF,PDF转Excel
pdf·word