SKILL.md
只读
名称
morph-search
描述
通过 WarpGrep 进行快速代码库搜索(比 grep 快 20 倍)
Morph 代码库搜索
使用 WarpGrep 实现快速、AI 驱动的代码库搜索。比传统 grep 快 20 倍。
适用场景
- 在代码库中搜索模式、函数名、变量
- 在大型代码库中快速查找代码
- 以编程方式编辑文件
使用方法
搜索代码模式
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "authentication" --path "."
使用正则表达式搜索
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "def.*login" --path "./src"
编辑文件
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--edit "/path/to/file.py" --content "new content"
参数说明
| 参数 | 描述 |
|---|---|
--search |
搜索查询词/模式 |
--path |
要搜索的目录(默认:.) |
--edit |
要编辑的文件路径 |
--content |
文件的新内容(与 --edit 配合使用) |
示例
# 查找所有异步函数
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "async def" --path "./src"
# 搜索导入语句
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "from fastapi import" --path "."
与 ast-grep 对比
| 工具 | 最适合 |
|---|---|
| morph/warpgrep | 快速文本/正则表达式搜索(快 20 倍) |
| ast-grep | 结构化代码搜索(理解语法) |
需要 MCP 服务端
需要在 mcp_config.json 中配置带有 MORPH_API_KEY 的 morph 服务端。






