🤖 MCP自动化-使用Claude控制您的PC
与克劳德交谈→ Claude控制你的电脑、GitHub和Notion
______________________________________________________________________
💡 这是什么?
此项目连接 克劳德·艾 使用 MCP(模型上下文协议).
只要正常地和克劳德说话,它就会:
- 📁 创建/编辑/搜索文件 在您的PC上
- 🔀 将代码推送到GitHub 自动地
- 📝 更新通知页面 有单据
- ⚡ 自动化 通过简单的请求
没有体力劳动,问问克劳德就行了。
______________________________________________________________________
🎯 运作原理
You say to Claude:
"Create a new API project at C:\Projects\MyApp with authentication"
Claude automatically:
1. Creates folder structure on your PC
2. Generates all code files
3. Commits to GitHub
4. Documents it in Notion
All done in seconds! ✨流量
graph LR
A[You] -->|Request| B[Claude AI]
B -->|MCP| C[Your PC Files]
B -->|MCP| D[GitHub Repo]
B -->|MCP| E[Notion Docs]
style B fill:#00D9FF
style C fill:#22c55e
style D fill:#181717
style E fill:#000000______________________________________________________________________
🚀 设置(5分钟)
步骤1:安装克劳德桌面
下载地址: claude.ai/下载
步骤2:获取API令牌
GitHub令牌:
- 首选
- 点击“生成新令牌(经典)”
- 选择范围:
repo,workflow,write:packages - 复制令牌
概念整合:
- 首选 概念整合
- 点击“新建集成”
- 给它起个名字,选择工作区
- 复制“内部集成令牌”
- 通过此集成共享您的Notion页面
步骤3:配置MCP
窗户: 打开 %APPDATA%\Claude\claude_desktop_config.json\ 雨衣: 打开 ~/Library/Application Support/Claude/claude_desktop_config.json
粘贴此内容(替换为您的路径和标记):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:/Projects",
"C:/Work",
"D:/Code"
]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
},
"notion": {
"command": "npx",
"args": ["-y", "@notionhq/notion-mcp-server"],
"env": {
"NOTION_API_KEY": "ntn_your_token_here"
}
}
}
}重要提示:
- 添加您希望Claude访问的所有文件夹(项目、工作、文档等)
- 使用正斜杠
/即使在Windows上 - 用您的实际代币替换代币
第四步:重启克劳德
关闭并重新打开Claude Desktop。完成! ✅
______________________________________________________________________
🎯 你能做什么
📁 文件操作
创建文件:
"Create a file at C:\Projects\test.txt with 'Hello World'"创建项目结构:
"Create a new .NET Web API project at C:\Projects\MyApp with:
- Controllers folder
- Models folder
- Program.cs with basic setup
- appsettings.json with database config"搜索文件:
"Search all files in C:\Projects for 'connectionString'"更新文件:
"In C:\Projects\MyApp\appsettings.json, update the database
connection string to use localhost"读取文件:
"Show me the content of C:\Projects\MyApp\Program.cs"______________________________________________________________________
🔀 GitHub运营
创建存储库:
"Create a new GitHub repo called 'my-awesome-app' and push
all files from C:\Projects\MyApp"提交和推送:
"Commit all changes in C:\Projects\MyApp with message
'Added authentication' and push to GitHub"创建分支:
"Create a new branch called 'feature/user-management' and switch to it"搜索代码:
"Search my GitHub repos for code that uses Entity Framework"创建问题:
"Create a GitHub issue in my-awesome-app: 'Add user profile page'"______________________________________________________________________
📝 概念操作
创建页面:
"Create a Notion page titled 'MyApp API Documentation' with:
- Overview section
- List of all endpoints
- Authentication guide"更新页面:
"Update my Notion page 'Project Status' to mark MyApp as 'In Progress'"搜索提示:
"Search my Notion for pages about API development"文件代码:
"Read C:\Projects\MyApp\Controllers\UserController.cs and
create Notion documentation for all its endpoints"______________________________________________________________________
⚡ 组合工作流
完整功能开发:
"Create a complete user management feature:
1. Create UserController.cs at C:\Projects\MyApp\Controllers
2. Create UserService.cs at C:\Projects\MyApp\Services
3. Add database models
4. Commit and push to GitHub
5. Document all endpoints in Notion"克隆和设置:
"Clone my GitHub repo 'existing-project', set it up at
C:\Projects\ExistingProject, install dependencies, and
create a Notion page with setup instructions"自动化部署:
"Build the project at C:\Projects\MyApp, copy build files
to C:\inetpub\wwwroot\MyApp, and update Notion deployment log"______________________________________________________________________
🎬 真实世界示例
你: “我想开始一个新的Angular+.NET项目”
克劳德将:
- 创建文件夹结构:
C:\Projects\MyFullStackApp\
├── Backend\
│ ├── Controllers\
│ ├── Models\
│ └── Program.cs
└── Frontend\
├── src\
└── angular.json- 生成所有文件 有完整的代码
- 创建GitHub仓库 并推动初始提交
- 创建通知页面 与:
- 项目概述 - 安装说明 - API 文档 - 发展路线图
所有在一个请求! 🚀
______________________________________________________________________
📋 工作流示例
以下是MCP的典型一天:
Morning:
"Create a new feature branch for user authentication"
"Generate login and register API endpoints"
"Create Angular login component"
Afternoon:
"Search all my projects for JWT authentication examples"
"Update my authentication code based on best practices"
"Run tests and fix any errors"
Evening:
"Commit everything with message 'Implemented user authentication'"
"Push to GitHub and create pull request"
"Update Notion project board to mark auth as complete"
"Document the new API endpoints in Notion"无需手动创建文件。没有手动git命令。只是请求。 ✨
______________________________________________________________________
🛠️ 配置提示
允许多个文件夹
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:/Projects",
"C:/Work",
"C:/Documents/Code",
"D:/Repositories"
]
}增强安全性
只允许访问特定的项目文件夹,而不是整个驱动器:
✅ 好: "C:/Projects/MyApp"\ ❌ 坏: "C:/"
______________________________________________________________________
🐛 故障排除
“MCP不工作”
- 配置更改后重新启动Claude Desktop
- 检查文件路径是否使用正斜杠
/ - 验证令牌是否正确且处于活动状态
“无法访问文件”
- 确保文件夹列在文件系统参数中
- 检查文件夹权限
“GitHub推送失败”
- 验证您的GitHub令牌是否
repo范围 - 支票令牌尚未过期
“未找到通知”
- 确保您与集成共享了页面
- 检查集成令牌是否正确
______________________________________________________________________
🎓 学习资源
______________________________________________________________________
💡 专业提示
- 简单开始: 从基本文件创建开始,然后转向复杂的工作流程
- 具体来说: 在请求中包含确切的文件路径
- 连锁行动: 将多个任务合并到一个请求中
- 使用注意事项: 编写代码时自动记录所有内容
- 迭代: 如果克劳德的输出不完美,就让它来修复它
______________________________________________________________________
🎯 这个项目做什么
此README演示了以下内容的设置和示例:
✅ 将Claude连接到文件系统\ ✅ 将Claude链接到GitHub进行自动化git操作\ ✅ 集成Notion以实现自动文档\ ✅ 通过简单的请求创建完整的项目\ ✅ 自动化整个开发工作流程
目标: 永远不要手动创建文件或再次运行git命令。告诉克劳德你想要什么! 🚀
______________________________________________________________________
⭐ 标记此仓库以记住设置!
问题? 打开一个问题并提问!
