morph-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMorph Codebase Search
Morph代码库搜索
Fast, AI-powered codebase search using WarpGrep. 20x faster than traditional grep.
基于WarpGrep的AI驱动型快速代码库搜索工具,速度比传统grep快20倍。
When to Use
使用场景
- Search codebase for patterns, function names, variables
- Find code across large codebases quickly
- Edit files programmatically
- 在代码库中搜索模式、函数名、变量
- 快速在大型代码库中查找代码
- 以编程方式编辑文件
Usage
使用方法
Search for code patterns
搜索代码模式
bash
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "authentication" --path "."bash
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "authentication" --path "."Search with regex
使用正则表达式搜索
bash
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "def.*login" --path "./src"bash
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--search "def.*login" --path "./src"Edit a file
编辑文件
bash
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--edit "/path/to/file.py" --content "new content"bash
uv run python -m runtime.harness scripts/mcp/morph_search.py \
--edit "/path/to/file.py" --content "new content"Parameters
参数说明
| Parameter | Description |
|---|---|
| Search query/pattern |
| Directory to search (default: |
| File path to edit |
| New content for file (use with |
| 参数 | 描述 |
|---|---|
| 搜索查询/模式 |
| 要搜索的目录(默认值: |
| 要编辑的文件路径 |
| 文件的新内容(需与 |
Examples
示例
bash
undefinedbash
undefinedFind all async functions
查找所有异步函数
uv run python -m runtime.harness scripts/mcp/morph_search.py
--search "async def" --path "./src"
--search "async def" --path "./src"
uv run python -m runtime.harness scripts/mcp/morph_search.py
--search "async def" --path "./src"
--search "async def" --path "./src"
Search for imports
搜索导入语句
uv run python -m runtime.harness scripts/mcp/morph_search.py
--search "from fastapi import" --path "."
--search "from fastapi import" --path "."
undefineduv run python -m runtime.harness scripts/mcp/morph_search.py
--search "from fastapi import" --path "."
--search "from fastapi import" --path "."
undefinedvs ast-grep
与ast-grep对比
| Tool | Best For |
|---|---|
| morph/warpgrep | Fast text/regex search (20x faster) |
| ast-grep | Structural code search (understands syntax) |
| 工具 | 适用场景 |
|---|---|
| morph/warpgrep | 快速文本/正则搜索(速度快20倍) |
| ast-grep | 结构化代码搜索(理解语法) |
MCP Server Required
需MCP Server支持
Requires server in mcp_config.json with .
morphMORPH_API_KEY需要在mcp_config.json中配置服务器,并提供。
morphMORPH_API_KEY