Skip to content

Cursor 接入

Cursor 是一款 AI 驱动的代码编辑器,支持 MCP 协议进行代码辅助和数据查询。

配置步骤

  1. 找到配置文件位置:

    • 项目级: 在项目根目录创建 .cursor/mcp.json
    • 全局: ~/.cursor/mcp.json(或 Windows: %USERPROFILE%\.cursor\mcp.json
  2. 编辑配置文件:

托管 HTTP 模式(推荐)

json
{
  "mcpServers": {
    "sentinel": {
      "url": "https://mcp.priceminder.online?key=你的MCP-Key"
    }
  }
}

本地 stdio 模式

json
{
  "mcpServers": {
    "sentinel": {
      "command": "uvx",
      "args": ["sentinel-mcp-server"],
      "env": {
        "SENTINEL_API_BASE": "https://priceminder.online/api/v1",
        "SENTINEL_TOKEN": "你的 API Token"
      }
    }
  }
}
  1. 保存后重启 Cursor
  2. 在 Cursor 的 AI 对话中即可使用监控相关命令

验证

在 Cursor 中打开 AI 对话(Cmd/Ctrl + L),输入:

  • "帮我查一下 Shopee 监控列表"
  • "最近有降价预警吗"

使用场景

Cursor 中使用 MCP 的典型场景:

  • 在编写电商数据分析脚本时,直接查询竞品价格
  • 在开发 Shopee 相关工具时,获取实时监控数据
  • 结合代码编辑能力,生成价格分析报告

Released under the MIT License.