Morph代码库搜索Skill morph-search

Morph 代码库搜索是一个快速、AI 驱动的代码搜索工具,使用 WarpGrep 技术,比传统 grep 快 20 倍。它允许开发者搜索代码库中的模式、函数名和变量,支持正则表达式搜索,并能编程方式编辑文件。适用于大型代码库的快速查找和自动化代码处理。关键词:代码搜索、AI、快速、WarpGrep、正则表达式、自动化编辑。

DevOps 0 次安装 0 次浏览 更新于 3/14/2026

name: morph-search description: 通过 WarpGrep 实现快速代码库搜索(比 grep 快 20 倍) allowed-tools: [Bash, Read]

Morph 代码库搜索

快速、AI 驱动的代码库搜索,使用 WarpGrep。比传统 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 服务器并设置 MORPH_API_KEY