Windows 系统下使用 Claude for Desktop 进行MCP连接:让智能体帮你管理文件

by DonaldTrump-coder

3 stars
240 downloads
Not rated
GitHub

About

这是一个教程,指导用户如何在 Windows 系统下配置 Claude for Desktop,通过 MCP 协议连接文件系统服务器,从而让 Claude AI 能够管理用户指定目录下的文件(如桌面、下载等)。

Details

Author
DonaldTrump-coder
GitHub stars
3
Downloads
240
Categories
AI

- 通过 MCP 协议实现 Claude AI 管理本地文件。
- 仅支持 Windows 和 macOS(不支持 Linux)。
- 使用官方 @modelcontextprotocol/server-filesystem 包。
- 可自定义 Claude 能访问的目录(如桌面、下载)。
- 需要 Node.js 环境运行文件系统服务器。
- 所有文件操作需用户确认后执行。

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Windows 系统下使用 Claude for Desktop 进行MCP连接:让智能体帮你管理文件
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

按照教程步骤操作:下载并安装 Claude for Desktop,安装 Node.js (用于运行文件系统服务器),可选安装 Python;在 Claude 设置中编辑 claude_desktop_config.json,添加 filesystem MCP 服务器并指定允许访问的目录;重启 Claude,看到锤子图标后即可通过对话让 Claude 执行文件操作。

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "windows \u7cfb\u7edf\u4e0b\u4f7f\u7528 claude for desktop \u8fdb\u884cmcp\u8fde\u63a5\uff1a\u8ba9\u667a\u80fd\u4f53\u5e2e\u4f60\u7ba1\u7406\u6587\u4ef6": {
            "filesystem": {
                "command": "npx",
                "args": [
                    "-y",
                    "@modelcontextprotocol/server-filesystem",
                    "C:\\Users\\username\\Desktop",
                    "C:\\Users\\username\\Downloads"
                ]
            }
        }
    }
}

McpServers

{
    "filesystem": {
        "command": "npx",
        "args": [
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "C:\\Users\\username\\Desktop",
            "C:\\Users\\username\\Downloads"
        ]
    }
}

Windows 系统下使用 Claude for Desktop 进行MCP连接:让智能体帮你管理文件

最近在做一个用 MCP 协议连接大模型改造其他工具的相关项目,于是自己学了学 MCP 协议, 用 Claude for Desktop 做了点事情,写篇文章来总结整个流程以及踩到的坑。<br> 网上关于 MCP 的概念介绍得太多了,我这里就不写了。可见本篇的参考文献:什么是MCP协议?怎么用?一篇让你从零到精通的教程,附如何ClaudePro订阅?如何使用Claude3.7Sonnet模型?<br>

一、下载 Claude for Desktop

下载 Claude 桌面版,直接进入下载官网,选择 Windows 或 macOS 点击下载并安装。(尚不支持Linux) 在官网中,可能会出现被禁止访问的问题,此时需要开梯子,并将节点地区改为美国或英国等中国以外的地区(中国香港的节点也不行!!!)

二、配置 Python 环境

为了在未来进行功能的扩展,可安装并配置 Python 运行环境。(版本最好在3.9及以上)

三、安装 Node.js

使用的文件系统服务器需要通过 npx 运行 Javascript 模块,因此需要安装 Node.js<br> 参考的这一篇<br> 2025最新版Node.js下载安装及环境配置教程(非常详细)从零基础入门到精通,看完这一篇就够了 <br>

1.下载安装包

访问官方网站地址Download Node.js,选择需要的版本下载,我选择的是Windows x64架构,再点击下载Windows 安装程序。 alt text

2.安装

跟着安装向导点下去即可 alt text 根据个人需求选择安装路径 alt text 直接都选择默认安装 alt text 不选择自动安装必要工具 alt text 点击 Install 进行安装 alt text 安装完毕后,测试是否安装成功,在 cmd 终端中输入 `` node -v npm -v ` 若都能显示版本信息,说明 Node.js 安装成功

3.环境配置

(1)找到安装的目录,在安装目录下新建两个文件夹【node_global】和【node_cache】 alt text (2)创建完毕后,使用管理员身份打开 cmd 命令窗口,输入
` npm config set prefix "你的路径\node_global" (复制你刚刚创建的"node_global"文件夹路径) npm config set cache "你的路径\node_cache" (复制你刚刚创建的"node_cache"文件夹路径) ` (3)配置环境变量 ①【此电脑】-单击右键-【属性】-【高级系统设置】-【环境变量】 alt text ② 在【系统变量】中点击【新建】 alt text 变量名:NODE_PATH 变量值:C:\Program Files\nodejs\node_global\node_modules alt text 然后你就会发现【node_global】里多出了一个【node_modules】文件夹 alt text Tips: 如果输入变量值之后没有自动创建【node_modules】文件夹,就在【node_global】下手动创建一个【node_modules】文件夹,再复制你创建的【node_modules】文件夹的路径地址到变量值 ③编辑【用户变量】中的【Path】 alt text ④将默认的 C 盘下【 AppData\Roaming\npm 】修改成 【node_global】的路径,点击确定 alt text alt text ⑤在【系统变量】中选择【Path】点击【编辑】添加【NODE_PATH】,随后一直点击【确定】 alt text alt text

4.测试

输入:
` npm install express -g // -g代表全局安装 ` 若出现以下结果即为配置成功 alt text

四、添加文件系统 MCP 服务器

以 Windows 系统为例,进入 Claude for Desktop ,点击左上角,找到 Settings 并进入,再进入 Developer 一栏,点击 Edit Config 随后会跳至一个包含 claude_desktop_config.json 文件的文件夹,进入该文件,将文件内容替换为:
` { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\username\\Desktop", "C:\\Users\\username\\Downloads" ] } } } `` 确保 "C:\\Users\\username\\Desktop", "C:\\Users\\username\\Downloads" 为您希望 Claude 能够访问和修改的有效目录。它已设置为适用于桌面和下载两个路径,但您也可以添加更多路径。

五、重启 Claude 并运行

更新完配置文件后,重新启动 Claude for Desktop 等待一会后,您应该会看到在输入框的下方看到一个锤子图标alt text 接下来您可以通过 Claude for Desktop 对您的文件进行修改啦,只需在对话框中输入您想进行的操作,Claude 会在征求您的同意后自动对您设定的路径下的文件进行对应的更改操作
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.