用途:标准化生成 Cursor 深度链接,涵盖 prompt、command、rule 以及 MCP 安装四类链接,供用户在 Cursor 中查看并批准后创建对应文件或配置。
主要能力:支持 prompt(/prompt,参数 text)、command(/command,参数 name、text,批准后将在当前项目创建 .cursor/commands/.md)、rule(/rule,参数 name、text,批准后在当前项目创建 .cursor/rules/.mdc)、MCP 安装(/mcp/install,参数 name、config,config 为单个 server 传输配置对象的 JSON 字符串经 base64 后的结果,非整个 mcp.json 映射)。链接有两种等价基址:WEB 为 https://cursor.com/link,APP 为 cursor://anysphere.cursor-deeplink。
使用方式:优先使用生成脚本 scripts/cursor-deeplink-gen.py 以避免编码错误并校验 8000 字符上限,例如:python3 scripts/cursor-deeplink-gen.py prompt --text "Create a README for this repo" --md;python3 scripts/cursor-deeplink-gen.py command --name "run-all-tests" --text "Run the full test suite and fix failures" --md;python3 scripts/cursor-deeplink-gen.py rule --name "python-style" --text "Prefer ruff/black; avoid implicit Any." --md;python3 scripts/cursor-deeplink-gen.py mcp-install --name postgres --config-file mcp.json --md。输出契约要求返回 WEB 链接(主)、APP 链接(次)、预期结果(用户批准后 Cursor 将创建或展示的内容)以及安全提示“Check secrets + 8,000 URL limit”。
限制与注意:无法运行生成器时才手动构造,需对全部参数做 URL 编码(含换行与空格)并确保编码后总长不超过 8000 字符;MCP 的 base64 结果需 URL 编码(+ 变为 %2B)。不得在链接文本或配置中嵌入 API key、token、密码、私钥等敏感信息。深度链接不会自动执行,须由用户在 Cursor 中审查并批准。参考仓库文档 doc/cursor-deeplinks.md 与 Cursor 官方 deeplinks、MCP 安装链接文档。