Ripple-MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Ripple-MCPanalyze impact of changing survey_status_today from INT to VARCHAR"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ripple-MCP
字段级语义变更影响分析 · Field-Level Semantic Change Impact Analysis
pip install ripple-impact-mcp🇨🇳 中文
为什么需要 Ripple-MCP?
当你想分析「修改 machine.x/y 语义」或「把某字段类型从 INT 改为 VARCHAR」会影响哪些代码时,传统工具无法回答:
问题 | 示例 |
哪些地方直接读取了这个字段? |
|
哪些地方用了这个字符串值? |
|
哪些地方调用了这个函数? |
|
哪些文件导入了这个模块? |
|
TypeScript / JavaScript 里哪些地方用了这个变量? | — |
改了函数 X,哪些函数直接调用了它? | — |
Ripple-MCP 把 Claude Code 的语义理解与 ripgrep / Python AST 的机械精确性结合,覆盖 codegraph 的所有盲区。
核心工具
工具 | 说明 |
| 通用正则扫描,支持任意语言 |
| 精准 Python AST 分析,区分属性访问 / 下标 / |
| 多层调用链追踪(BFS 上溯「调用者的调用者」,最多 5 层) |
| 符号定义查找(函数 / 类 / 常量,含签名与所在类) |
| 语义变更影响的结构化 Markdown 报告 |
| 带上下文的代码片段提取 |
安装
环境要求: Python 3.10+
pip install ripple-impact-mcp包名为
ripple-impact-mcp(PyPI 上ripple-mcp已被占用),安装后的命令行入口仍是ripple-mcp。
或源码安装:
git clone https://github.com/0xYubo/Ripple-Mcp.git
cd Ripple-Mcp
pip install -e .Claude Code 集成(MCP 配置):
# 方式一:命令行一键添加(推荐,-s user 表示全局可用)
claude mcp add ripple -s user -- ripple-mcp// 方式二:手动编辑 MCP 配置文件
{
"mcpServers": {
"ripple": {
"command": "ripple-mcp"
}
}
}
ripple-mcp是pip install -e .注册的命令行入口,等价于python -m field_impact_mcp。
配置完成后重启 Claude Code 即可生效。
使用方式
无需手动调用任何工具——在 Claude Code 对话中用自然语言描述变更意图,Claude 会自动编排下面的工具完成分析。
字段类型变更
分析「把 all_check 表的 survey_status_today 字段从 INT 改为 VARCHAR」
对 /path/to/backend 的影响范围坐标语义变更
如果把机台坐标 x/y 从左上角改为中心点,
/path/to/project 里哪些地方需要修改?函数重命名
把 get_eq_partition 重命名为 get_machine_partition,
/path/to/backend 里有多少个调用点?API 路径变更
/api/external/apiKey/refresh 改为 /api/external/api-keys,
哪些前端文件引用了旧路径?推荐工作流(Claude 自动执行,也可手动指定):
描述变更意图
→ scan_patterns + analyze_python_ast(并行扫描)
→ get_code_context(对可疑命中确认上下文)
→ generate_impact_report(生成结构化影响报告)MCP 工具参数说明
scan_patterns — 通用 pattern 扫描
接受任意正则表达式,支持所有语言和文件类型。
{
"project_path": "/path/to/project",
"patterns": ["machine\\.x", "survey_status_today", "/api/external/"],
"extensions": [".py", ".ts", ".tsx", ".sql"],
"max_results": 500
}返回(按文件聚合,file 为相对 project_path 的路径):
{
"engine": "rg",
"total_found": 12,
"returned": 12,
"truncated": false,
"files": [{"file": "pkg/a.py", "hits": [{"line": 2, "code": "...", "patterns": ["..."], "confidence": "low"}]}]
}truncated: true 时表示命中数超过 max_results,可增大后重试。
analyze_python_ast / find_definition 返回相同的聚合结构(hits 内分别为 {line, kind, value, extra, function, confidence} / {line, kind, name, signature, parent})。
analyze_python_ast — Python AST 精确分析
比 grep 更精确,区分访问方式,标注所在函数。
{
"project_path": "/path/to/backend",
"field_names": ["x", "y", "survey_status_today"],
"string_values": ["success", "failed"],
"call_names": ["get_eq_partition"],
"import_names": ["plogen_tools"]
}kind 与置信度对应:
kind | 说明 | confidence |
|
| high |
|
| high |
|
| high |
| 函数 / 方法调用 | medium |
| 导入 | medium |
| 类型注解 | low |
trace_callers — 多层调用链追踪
{
"project_path": "/path/to/backend",
"function_name": "get_eq_partition",
"depth": 3
}depth=1 找直接调用者,depth=2 再找「调用者的调用者」,依此类推(上限 5 层)。返回:
{
"target": "get_eq_partition", "max_depth": 3, "total_found": 5, "truncated": false,
"levels": [{"depth": 1, "callers": [{"file": "svc/a.py", "line": 12, "caller_function": "do_calc", "callee": "get_eq_partition", "confidence": "high"}]}]
}confidence=high 表示 foo(x) 直呼;medium 表示 obj.foo() 按方法名匹配,可能是其他类的同名方法。
find_definition — 符号定义查找
{
"project_path": "/path/to/backend",
"name": "get_eq_partition"
}返回函数 / 类 / 模块级与类级赋值的定义处,含签名(def fn(a, b) -> int)和所在类(parent)。与 trace_callers 配对使用:先看定义签名,再追调用链。
get_code_context — 代码上下文
{
"file_path": "pkg/a.py",
"line_number": 254,
"context_lines": 8,
"project_path": "/path/to/project"
}file_path 可直接使用扫描结果中的相对路径(需同时传 project_path),也可传绝对路径。
验证多个命中时推荐批量模式:传 locations: [{file_path, line_number}] 数组,一次返回多段上下文。
generate_impact_report — 生成影响报告
先调用 scan_patterns / analyze_python_ast(结果自动缓存),再调用此工具只传 change_description 即可。
{
"change_description": "将 survey_status_today 字段从 INT 改为 VARCHAR(16)",
"project_path": "/path/to/project"
}与 codegraph 的关系
Ripple-MCP 不是 codegraph 的替代品,而是补充:
分析场景 | codegraph | Ripple-MCP |
函数 / 类调用图 | ✅ | ✅ |
字段级读写追踪 | ❌ | ✅ |
字符串字面量匹配 | ❌ | ✅ |
枚举值引用追踪 | ❌ | ✅ |
类型注解分析 | ❌ | ✅ |
跨语言扫描(Python + TS/JS) | ❌ | ✅ |
Related MCP server: Axon.MCP.Server
🇺🇸 English
Why Ripple-MCP?
When you want to analyze the impact of "changing machine.x/y semantics" or "converting a field type from INT to VARCHAR", traditional tools can't answer:
Question | Example |
Where is this field read directly? |
|
Where is this string value used? |
|
What functions call this function? |
|
Which files import this module? |
|
Where is this variable used in TypeScript / JavaScript? | — |
If function X changes, which callers are affected? | — |
Ripple-MCP combines Claude Code's semantic understanding with the mechanical precision of ripgrep / Python AST, covering all blind spots left by codegraph.
Core Tools
Tool | Description |
| Universal regex-based pattern matching across any language |
| Precise Python AST analysis — distinguishes attribute access, subscript, and |
| Multi-level call chain tracking (BFS up to 5 levels of "callers of callers") |
| Symbol definition lookup (function / class / constant, with signature and enclosing class) |
| Structured Markdown report of semantic change impact |
| Contextual code snippet retrieval with surrounding lines |
Installation
Requirements: Python 3.10+
pip install ripple-impact-mcpThe package name is
ripple-impact-mcp(ripple-mcpwas taken on PyPI); the installed CLI entry point is stillripple-mcp.
Or install from source:
git clone https://github.com/0xYubo/Ripple-Mcp.git
cd Ripple-Mcp
pip install -e .Claude Code Integration:
# Option 1: one-liner via CLI (recommended, -s user = available in all projects)
claude mcp add ripple -s user -- ripple-mcp// Option 2: edit the MCP config manually
{
"mcpServers": {
"ripple": {
"command": "ripple-mcp"
}
}
}
ripple-mcpis the console entry point registered bypip install -e ., equivalent topython -m field_impact_mcp.
Restart Claude Code after configuring.
Usage
No manual tool calls needed — just describe your change intent in natural language inside Claude Code, and Claude orchestrates the tools below automatically.
Field type change
Analyze the impact of changing the survey_status_today column
of the all_check table from INT to VARCHAR on /path/to/backendCoordinate semantics change
If machine coordinates x/y change from top-left to center,
which places in /path/to/project need updating?Function rename
Rename get_eq_partition to get_machine_partition —
how many call sites exist in /path/to/backend?API path change
/api/external/apiKey/refresh becomes /api/external/api-keys —
which frontend files reference the old path?Recommended workflow (orchestrated by Claude automatically):
Describe the change intent
→ scan_patterns + analyze_python_ast (parallel scan)
→ get_code_context (confirm suspicious hits)
→ generate_impact_report (structured impact report)MCP Tool Reference
scan_patterns — universal pattern scan
Accepts any regex; works across all languages and file types.
{
"project_path": "/path/to/project",
"patterns": ["machine\\.x", "survey_status_today", "/api/external/"],
"extensions": [".py", ".ts", ".tsx", ".sql"],
"max_results": 500
}Returns (grouped by file; file is relative to project_path):
{
"engine": "rg",
"total_found": 12,
"returned": 12,
"truncated": false,
"files": [{"file": "pkg/a.py", "hits": [{"line": 2, "code": "...", "patterns": ["..."], "confidence": "low"}]}]
}When truncated: true, hits exceeded max_results — retry with a larger value.
analyze_python_ast / find_definition return the same grouped structure (hits contain {line, kind, value, extra, function, confidence} / {line, kind, name, signature, parent} respectively).
analyze_python_ast — precise Python AST analysis
More accurate than grep — distinguishes access kinds and annotates the enclosing function.
{
"project_path": "/path/to/backend",
"field_names": ["x", "y", "survey_status_today"],
"string_values": ["success", "failed"],
"call_names": ["get_eq_partition"],
"import_names": ["plogen_tools"]
}kind → confidence mapping:
kind | Meaning | confidence |
|
| high |
|
| high |
|
| high |
| function / method call | medium |
| import | medium |
| type annotation | low |
trace_callers — multi-level call chain tracking
{
"project_path": "/path/to/backend",
"function_name": "get_eq_partition",
"depth": 3
}depth=1 finds direct callers; depth=2 walks up to "callers of callers", etc. (max 5). Returns:
{
"target": "get_eq_partition", "max_depth": 3, "total_found": 5, "truncated": false,
"levels": [{"depth": 1, "callers": [{"file": "svc/a.py", "line": 12, "caller_function": "do_calc", "callee": "get_eq_partition", "confidence": "high"}]}]
}confidence=high means a direct foo(x) call; medium means obj.foo() matched by method name — possibly a same-named method on another class.
find_definition — symbol definition lookup
{
"project_path": "/path/to/backend",
"name": "get_eq_partition"
}Returns definitions of functions / classes / module-level and class-level assignments, with signature (def fn(a, b) -> int) and enclosing class (parent). Pairs with trace_callers: inspect the signature first, then trace the call chain.
get_code_context — code context
{
"file_path": "pkg/a.py",
"line_number": 254,
"context_lines": 8,
"project_path": "/path/to/project"
}file_path accepts the relative paths from scan results (pass project_path along), or an absolute path.
To verify multiple hits, prefer batch mode: pass locations: [{file_path, line_number}] to get all snippets in one call.
generate_impact_report — impact report
Call scan_patterns / analyze_python_ast first (results are cached server-side), then pass only change_description.
{
"change_description": "Change survey_status_today from INT to VARCHAR(16)",
"project_path": "/path/to/project"
}Relationship with codegraph
Ripple-MCP is not a replacement for codegraph — it fills the gaps:
Scenario | codegraph | Ripple-MCP |
Function / class call graph | ✅ | ✅ |
Field-level read/write tracking | ❌ | ✅ |
String literal matching | ❌ | ✅ |
Enum value reference tracking | ❌ | ✅ |
Type annotation analysis | ❌ | ✅ |
Cross-language scan (Python + TS/JS) | ❌ | ✅ |
License: MIT
Available Tools
6 toolsanalyze_python_astARead-only
对 Python 代码做 AST 级别精确分析,比 grep 更准确。支持多种搜索目标,可同时指定多类:
symbols: 任何标识符(变量名、类名、常量名)
field_names: 字段/属性名(捕获 obj.field / obj['field'] / obj.get('field'))
string_values: 字符串字面量值(捕获代码中的字符串常量)
call_names: 函数/方法调用名
import_names: 导入的模块或符号名 每个命中都标注所在函数名、访问方式和置信度,适合需要精确上下文的场景。返回按文件聚合的 JSON:{total_found, returned, truncated, files:[{file:相对路径, hits:[{line, kind, value, extra, function, confidence}]}]}。
| Name | Required | Description | Default |
|---|---|---|---|
| symbols | No | 标识符名列表,如 ['AllEq', 'DEFAULT_TTL'] | |
| call_names | No | 函数/方法调用名列表,如 ['get_eq_partition'] | |
| field_names | No | 字段/属性名列表,如 ['x', 'y', 'status'] | |
| max_results | No | 最大返回结果数,默认 500;truncated=true 时可增大后重试 | |
| exclude_dirs | No | 排除目录,不传则使用默认排除列表,传 [] 则不排除任何目录 | |
| import_names | No | 导入符号/模块名列表,如 ['plogen_tools'] | |
| project_path | Yes | Python 项目根目录绝对路径 | |
| string_values | No | 字符串字面量值列表,如 ['success', 'failed'] |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already covers safety. The description adds behavioral detail by describing the return format, the per-hit fields (line, kind, value, extra, function, confidence), and the truncation flag. It doesn't contradict annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured: a one-sentence core value proposition, a bulleted list of search targets, and a compact return schema. Each sentence contributes new information, making it concise despite its length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is moderately complex with 8 parameters and no output schema, but the description compensates by specifying the JSON return structure and per-hit metadata. It does not cover edge cases like duplicate hits or performance, but the essential information for correct invocation and result interpretation is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the baseline is 3. The description adds semantic meaning for each parameter type, especially field_names ('捕获 obj.field / obj['field'] / obj.get('field')') and string_values, and notes that multiple search types can be combined—a behavior not detailed in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as performing AST-level precise analysis of Python code ('对 Python 代码做 AST 级别精确分析') and differentiates it from grep ('比 grep 更准确'). It enumerates five distinct search targets (symbols, field_names, string_values, call_names, import_names), which distinguishes it from siblings like scan_patterns.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states that the tool is suitable for scenarios needing precise context ('适合需要精确上下文的场景') and claims better accuracy than grep, giving an implicit comparison to alternatives. However, it does not name sibling tools or state when not to use it, so it stops short of full exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_definitionARead-only
找出符号在项目中的定义处:函数定义、类定义、模块级/类级赋值(常量、类属性)。与 trace_callers 配对使用——先找定义看签名,再追调用链。返回按文件聚合的 JSON:{total_found, returned, truncated, files:[{file:相对路径, hits:[{line, kind, name, signature, parent}]}]},kind 为 function/class/assignment,parent 为所在类或函数(顶层为 )。
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 要查找定义的符号名,如 'get_eq_partition'、'MachineModel'、'DEFAULT_TTL' | |
| exclude_dirs | No | 排除目录,不传则使用默认排除列表,传 [] 则不排除任何目录 | |
| project_path | Yes | Python 项目根目录绝对路径 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With readOnlyHint=true, the description adds valuable behavioral context beyond the annotation: it describes the aggregated JSON return format, the 'truncated' flag indicating possible result truncation, and the meaning of 'kind' and 'parent'. This goes beyond a simple read-only hint and informs the agent about the exact output structure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the purpose, then pair-usage, then return format. It is a bit dense due to the inlined JSON schema, but every sentence earns its place—no filler or repetition. The structure is logical, though slightly heavier than ideal.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description fully documents the return format including nested objects, fields, and semantics for 'kind' and 'parent'. It also covers the truncation behavior and file aggregation. For a read-only tool with a clear return contract, this is quite complete, though it doesn't explicitly address not-found cases or pagination parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all three parameters (project_path, name, exclude_dirs). The description does not add parameter-specific semantics beyond what the schema provides, but it does reinforce the meaning of 'name' indirectly via the return format. Baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the verb+resource: '找出符号在项目中的定义处' (find where a symbol is defined), and enumerates the kinds of definitions (function, class, module/class-level assignments). It distinguishes itself from siblings by explicitly pairing with trace_callers and outlining a workflow, making it unambiguous what this tool does and how it relates to others.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states the primary use case (find definition to see signature) and explicitly recommends pairing with trace_callers ('与 trace_callers 配对使用——先找定义看签名,再追调用链'). It provides clear context on when to use the tool, though it does not explicitly state exclusions or 'when not to use' scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_impact_reportARead-only
将扫描结果聚合成结构化 Markdown 影响分析报告。若不传 scan_results/ast_results,自动使用该 project_path 的最近一次扫描缓存。推荐工作流:先调用 scan_patterns 和/或 analyze_python_ast,再调用此工具生成报告。
| Name | Required | Description | Default |
|---|---|---|---|
| ast_results | No | analyze_python_ast 返回的结果(整个 JSON 对象),不传则自动使用该 project_path 的缓存 | |
| project_path | Yes | ||
| scan_results | No | scan_patterns 返回的结果(整个 JSON 对象),不传则自动使用该 project_path 的缓存 | |
| change_description | Yes | 变更描述,如「将 survey_status_today 字段类型从 INT 改为 VARCHAR」 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description reveals cache-based fallback behavior when scan_results/ast_results are omitted, which goes beyond the readOnlyHint annotation. It does not mention potential errors if the cache is missing, but the annotation covers the safety profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences: the first states the core action, the second covers fallback and recommended workflow. Every clause contributes new information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description sufficiently explains the tool's role and inputs, including cache fallback and the recommended upstream scan calls. It does not detail report structure, but for a read-only aggregation tool with a well-described workflow, it is adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 75%, with change_description, scan_results, and ast_results documented. The description adds the cache fallback context and an illustrative change_description example, but most parameter semantics are already in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a clear verb-resource pairing: '将扫描结果聚合成结构化 Markdown 影响分析报告' (aggregate scan results into a structured Markdown impact report). It distinguishes itself from sibling scanning tools by being the report-generation step, and the recommended workflow reinforces this role.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit workflow guidance is provided: '推荐工作流:先调用 scan_patterns 和/或 analyze_python_ast,再调用此工具生成报告'. It also describes the cache fallback when scan_results/ast_results are omitted, making the usage context precise.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_code_contextARead-only
获取代码上下文,帮助判断命中处是否真正受变更影响。支持两种模式:单点(file_path + line_number)或批量(locations 数组,推荐——验证多个命中时一次调用替代多次往返)。
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | 单点模式:文件路径;可传扫描结果中的相对路径(需同时传 project_path)或绝对路径 | |
| locations | No | 批量模式:[{file_path, line_number}] 数组,一次返回多段上下文 | |
| line_number | No | 单点模式:目标行号(从 1 开始) | |
| project_path | No | 项目根目录绝对路径;file_path 为相对路径时必传 | |
| context_lines | No | 前后各显示行数,默认 6 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations declare readOnlyHint=true, so the read-only safety is already covered. The description adds behavioral context about the two modes (single vs. batch) and a recommendation, but does not disclose other behavioral traits like error handling, performance, or exact return format. This is adequate given the simple read-only nature.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the tool's purpose, and no wasted words. Every phrase adds value: the purpose, the two modes, and the batch recommendation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the primary usage and modes, and the annotation provides safety context. There is no output schema, so the description could ideally mention what the response includes, but the tool name and context_lines parameter imply code content around the specified lines. It is complete enough for a straightforward read-only utility.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are well-documented. The description adds value by clarifying the mode semantics (single vs. batch) and the recommendation to use batch mode, which goes beyond the schema's individual parameter descriptions. It also reinforces relative path handling with project_path.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb (获取) and resource (代码上下文), and clarifies its purpose: helping judge whether a code hit is truly affected by changes. It distinguishes from sibling tools by focusing on context retrieval for impact assessment, though it does not explicitly name alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It clearly states when to use the tool (to verify if a hit is affected by changes) and recommends batch mode for multiple hits to reduce round trips. It gives context for both single and batch modes, though it lacks explicit exclusions or when-not-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scan_patternsARead-only
在代码库中搜索任意正则表达式 pattern,支持 Python/TypeScript/JavaScript/任意文本文件。这是最通用的搜索工具,适用于所有变更场景:字段访问、函数调用、字符串值、常量、配置项、API 路径、SQL 字段名、注释、枚举值等任何内容。当用户描述任何类型的代码变更并想知道影响范围时,调用此工具。由 Claude 根据变更描述决定要搜什么 pattern,此工具只负责机械执行搜索。返回按文件聚合的 JSON:{engine, total_found, returned, truncated, files:[{file:相对路径, hits:[{line, code, patterns, confidence}]}]}。
| Name | Required | Description | Default |
|---|---|---|---|
| patterns | Yes | 正则表达式列表,支持任意内容。例如:字段访问: ["machine\.x", "machine\['x'\]"] | 函数调用: ["calculate_distance\("] | 字符串值: ["'success'", "\"failed\""] | 常量: ["STATUS_OK", "MAX_RETRY"] | API路径: ["/api/external/"] | SQL字段: ["survey_status_today"] | 导入: ["from plogen_tools import"] | |
| extensions | No | 文件扩展名,默认 ['.py','.ts','.tsx','.js','.jsx'] | |
| max_results | No | 最大返回结果数,默认 500;truncated=true 时可增大后重试 | |
| exclude_dirs | No | 排除目录,不传则使用默认排除列表(node_modules/.venv/dist 等),传 [] 则不排除任何目录 | |
| project_path | Yes | 项目根目录绝对路径 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the minimal readOnlyHint: true annotation, the description adds valuable behavioral context: it states the tool '只负责机械执行搜索' (only mechanically executes search) and describes the exact JSON return structure aggregated by file. This gives the agent insight into the tool's role and output. It does not contradict the annotation. Slightly more could be said about edge cases or performance, but the disclosure is solid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, followed by concise sentences that each add distinct value: generality, usage guidance, tool role, and return format. There is no fluff or repetition, making it appropriately sized for a general-purpose search tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Since there is no output schema, the description includes the return JSON structure, which is helpful. It covers the tool's scope, when to use it, its mechanical nature, and return format. While some defaults (e.g., extensions, max_results) are only in the schema, this is acceptable. The description is contextually complete for a complex search tool, though it could briefly mention potential limitations like truncation behavior (which is already in the schema).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema descriptions for all 5 parameters are detailed, providing examples for patterns and defaults for extensions and max_results, so schema coverage is 100%. The description itself does not add additional parameter-level semantics; it only mentions the return format. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource: '在代码库中搜索任意正则表达式 pattern' (search arbitrary regex patterns in the codebase). It then distinguishes itself as '最通用的搜索工具' (the most general-purpose search tool) and provides concrete examples of what it can search (field access, function calls, string values, etc.), clearly differentiating it from specialized sibling tools like trace_callers or find_definition.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use the tool: '当用户描述任何类型的代码变更并想知道影响范围时,调用此工具' (call this tool when the user describes any type of code change and wants to know the impact scope). It also clarifies that Claude decides the patterns to search, relieving the tool of interpretation. However, it does not mention alternatives or when not to use this tool, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
trace_callersARead-only
BFS 逐层找出调用指定函数的函数:depth=1 为直接调用者,depth=2 再找「调用者的调用者」,依此类推(上限 5 层)。适合回答「改了函数 X,影响会波及到哪里?」返回 {target, max_depth, total_found, truncated, levels:[{depth, callers:[{file, line, caller_function, callee, confidence}]}]}。confidence=high 表示 foo(x) 直呼;medium 表示 obj.foo() 按方法名匹配,可能是其他类的同名方法。
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | 追踪层数,1=直接调用者,最大 5,默认 1 | |
| max_results | No | 所有层合计最大返回数,默认 500 | |
| exclude_dirs | No | 排除目录,不传则使用默认排除列表,传 [] 则不排除任何目录 | |
| project_path | Yes | Python 项目根目录绝对路径 | |
| function_name | Yes | 要追踪的函数名,如 'get_eq_partition' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint annotation, the description discloses the BFS algorithm, depth limit of 5, the exact return structure, and the semantics of confidence levels (high vs medium). This is useful behavioral context, though it does not cover edge cases like function-not-found or exit conditions. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise—just two dense sentences—yet packs in the algorithm, depth bounds, use case, return schema, and confidence interpretation. Every phrase contributes meaning, and the most important action (BFS caller tracing) is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
In the absence of an output schema, the description fully specifies the return structure with fields like target, max_depth, total_found, truncated, and levels with per-caller details. It also explains confidence granularity. Given the tool's moderate complexity, this is complete enough for an agent to understand what to expect.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, and the description adds little beyond the schema for parameters. It does clarify the depth semantics (depth=1 direct callers, depth=2 indirect callers) but this is also largely present in the schema's depth field. With full schema coverage, a baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: 'BFS 逐层找出调用指定函数的函数' (BFS layer-by-layer finds callers of the specified function). It clearly distinguishes itself from siblings like find_definition (which locates definitions) and analyze_python_ast (which analyzes AST), making the tool's unique purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use the tool: '适合回答「改了函数 X,影响会波及到哪里?」' (suitable for answering 'If I change function X, where will the impact spread?'). This provides a clear use case, though it does not mention alternatives or exclusions compared to sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v1.1.0- First observed
analyze_python_ast - First observed
find_definition - First observed
generate_impact_report - First observed
get_code_context - First observed
scan_patterns - First observed
trace_callers
TDQS
Scored across 6 tools
Each tool has a clear, distinct purpose: scan_patterns does regex search across any file, analyze_python_ast does AST-based Python analysis, get_code_context retrieves code snippets, generate_impact_report aggregates results, trace_callers finds callers, and find_definition locates definitions. No two tools overlap ambiguously.
All tool names follow a consistent verb_noun pattern with lowercase and underscores: scan_patterns, analyze_python_ast, get_code_context, generate_impact_report, trace_callers, find_definition. The naming is uniform and predictable.
Six tools is well-scoped for a code impact analysis server. Each tool serves a distinct function in the workflow: searching, analyzing, getting context, tracing callers, finding definitions, and generating reports. No redundancy or unnecessary tools.
The tool set covers the full lifecycle of impact analysis: search (scan_patterns), precise analysis (analyze_python_ast), context (get_code_context), caller tracing (trace_callers), definition lookup (find_definition), and report generation (generate_impact_report). No obvious gaps for static code change impact assessment.
Maintenance
Related MCP Connectors
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server enabling symbol-aware semantic search in Claude Code, allowing precise location of functions, types, and implementations via a symbol graph and embeddings.9MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that transforms codebases into intelligent, queryable knowledge bases, enabling AI assistants to perform semantic search, explore architecture, and analyze code relationships.166-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that transforms Claude Code into an intelligent refactoring assistant, enabling code scanning, hotspot detection, optimization reports, and safe refactoring for large repositories.1,0886MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for local-first code intelligence, providing structural code graph, semantic search, and impact analysis to AI agents.2MIT