提交 fcd39f64 编写于 作者: 2501_92246985's avatar 2501_92246985

feat: add rules_mcp.md

上级 9f6b7d23
......@@ -66,6 +66,8 @@
* [国际化](i18n.md)
* [源码和示例](sample.md)
* [跨平台框架及原生对比](select.md)
* [cursor/vscode插件](tutorial/rules_mcp.md)
* [Rules/MCP](tutorial/rules_mcp.md)
* 更新日志
* [正式版](release.md)
* [Alpha 版](release-note-alpha.md)
## 使用规则
> 目前许多AI工具都已支持自定义规则来让AI更好的理解项目背景、编码风格和具体需求,从而生成更符合预期的代码。以下是uni-app-x内部使用的一些规则(以Cursor Rules为例,其中的内容也适用于其他工具)
复制[该项目](https://github.com/dcloudio/uni-app-x-ai-rules)下的.cursor目录到uni-app-x项目根目录下
## 使用mcp
#### 1、下载mcp包
```bash
$ npm i uni-app-x-mcp -g
```
#### 2、在Cursor中使用
在项目根路径创建.cursor/mcp.json文件,文件内容如下
```json
{
"mcpServers": {
"uni-app-x": {
"command": "npx",
"args": [
"uni-app-x-mcp"
]
}
}
}
```
#### 3、默认启动mcp服务
- 点击cursor setting -> 点击mcp
- 会出现一个mcp列表,选择自己需要启动mcp就行(默认是关闭状态)
![](https://web-ext-storage.dcloud.net.cn/hx/doc/D52E7A18-70BA-4C0F-A8AC-24AE8B8AB5DB.png)
ps: 默认需要自己点击是否使用mcp服务,也可以设置为自动代理的方式[文档](https://docs.cursor.com/chat/agent#yolo-mode)
#### 使用方式
话术: 帮我使用项目中的组件来完善当前页面/帮我使用项目中的组件完善当前xxx
![](https://web-ext-storage.dcloud.net.cn/hx/doc/A5961A5A-1A66-4943-A222-C5A936A5561B.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册