yudao-pilot-mcp
v0.4.0面向 yudao 生态的 MCP 智能开发助手
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
load_workspace_config Load Workspace Config
只读加载工作区配置;缺失时返回 config_missing,不创建文件。
| Parameter | Type | Description |
|---|---|---|
workspace_root |
init_workspace_config Init Workspace Config
识别工作区项目并创建 .yudao-pilot/config.yaml;overwrite=true 会重建已有配置。 backend_path 与 frontend_projects 必须同时提供或同时省略,用于多项目目录下的显式选择; frontend_projects=[] 表示只配置后端。省略时按无歧义自动识别,存在多个后端或同类前端候选 时返回 selection_required 与候选清单,不写文件。
| Parameter | Type | Description |
|---|---|---|
backend_path | ||
frontend_projects | ||
overwrite | boolean | |
workspace_root |
discover_workspaces Discover Workspaces
只读发现工作区:返回已有配置、后端与前端候选、扫描告警,不写文件、不连接数据库。 search_root 必须是包含项目目录的绝对路径;max_depth 取 0-6,默认 3,只向下扫描。 在主目录里用它确认目标后,再把选定项目的绝对路径作为 workspace_root 调用其他工具。
| Parameter | Type | Description |
|---|---|---|
search_root * | string | |
max_depth | integer |
inspect_project_path Inspect Project Path
根据 pom.xml 或 package.json 的依赖指纹分析项目类型,不依赖目录名。
| Parameter | Type | Description |
|---|---|---|
project_path * | string |
validate_workspace_projects Validate Workspace Projects
校验工作区中的后端和前端项目是否与配置严格匹配。
| Parameter | Type | Description |
|---|---|---|
workspace_root |
resolve_database_config Resolve Database Config
解析数据库配置,优先遵循工作区 config,其次从后端本地配置中读取。
| Parameter | Type | Description |
|---|---|---|
workspace_root |
inspect_codegen_context Inspect Codegen Context
结合配置规则、后端默认配置和 SQL 菜单数据,构建生成代码所需上下文。 backend_module_dir: 显式后端目标模块目录,支持 yudao-module-a/yudao-module-b 或 a/b。 backend_package_module: 显式 Java package module 名,例如 b;未传时使用 module_name。
| Parameter | Type | Description |
|---|---|---|
table_name * | string | |
backend_module_dir | ||
backend_package_module | ||
business_name | ||
entity_name | ||
menu_name | ||
module_name | ||
parent_menu_id | ||
parent_menu_name | ||
workspace_root |
inspect_table_schema Inspect Table Schema
只读检查单表字段;真实数据库必须识别到目标表,本地 SQL 仅作诊断参考。
| Parameter | Type | Description |
|---|---|---|
table_name * | string | |
workspace_root |
generate_codegen_scaffold Generate Codegen Scaffold
只读生成前后端代码内容与目标路径,不写文件、不生成 SQL、不写库。 generated_files 由 AI 写入;merge_operations 给出专用合并工具及结构化参数, 错误码和字典增量不作为完整文件返回。不会创建预览目录。 field_overrides: AI 覆盖字段组件类型,格式为 {"java_field": "html_type"}, 例如 {"lng": "inputNumber", "lat": "inputNumber"}。 可用 html_type 值: input, inputNumber, textarea, editor, select, radio, checkbox, datetime, date, imageUpload, fileUpload。 backend_module_dir: 显式后端目标模块目录,æ”…
| Parameter | Type | Description |
|---|---|---|
table_name * | string | |
backend_module_dir | ||
backend_package_module | ||
business_name | ||
entity_name | ||
field_overrides | ||
include_backend | boolean | |
include_frontend | boolean | |
menu_name | ||
module_name | ||
parent_menu_id | ||
parent_menu_name | ||
workspace_root |
generate_codegen_sql Generate Codegen Sql
只读生成指定业务表的菜单、派生字典和 H2 SQL 内容及路径,不写文件、不写库。 auto / migration_only 均生成对应 SQL,disabled 不生成对应片段。 即使 codegen.apply_to_database=true,本工具也不执行数据库应用。 SQL 文件由 AI 写入;真实菜单/字典应用需显式调用 apply_codegen_sql。 backend_module_dir: 显式后端目标模块目录,支持 yudao-module-a/yudao-module-b 或 a/b。 backend_package_module: 显式 Java package module 名,例如 b;未传时使用 module_name。
| Parameter | Type | Description |
|---|---|---|
table_name * | string | |
backend_module_dir | ||
backend_package_module | ||
business_name | ||
entity_name | ||
menu_icon | ||
menu_name | ||
module_menu_icon | ||
module_menu_name | ||
module_name | ||
parent_menu_id | ||
parent_menu_name | ||
workspace_root |
apply_codegen_sql Apply Codegen Sql
按当前表结构和参数重新生成计划,显式应用菜单/派生字典到配置数据库。 必须满足 codegen.apply_to_database=true;仅应用 mode=auto 的部分。 不执行任意 SQL、不写迁移或 H2 文件。与 generate_codegen_sql 使用相同命名参数。 菜单与字典分别提交,可能部分成功;返回各自结果,不提供跨两者的整体回滚。
| Parameter | Type | Description |
|---|---|---|
table_name * | string | |
backend_module_dir | ||
backend_package_module | ||
business_name | ||
entity_name | ||
menu_icon | ||
menu_name | ||
module_menu_icon | ||
module_menu_name | ||
module_name | ||
parent_menu_id | ||
parent_menu_name | ||
workspace_root |
merge_backend_error_codes Merge Backend Error Codes
合并后端错误码;relative_path 是相对配置后端仓库的 ErrorCodeConstants.java 路径。 constants 为非空 {name, message} 列表,自动分配编号;同名更新提示并保留编号。 section_title 指定业务分组标题。只修改目标文件及必要的 ServiceErrorCodeRange.java, 不生成普通代码、不处理或删除占位文件。返回实际 changed_files,重复相同输入为空列表。
| Parameter | Type | Description |
|---|---|---|
constants * | array | |
relative_path * | string | |
section_title * | string | |
workspace_root * | string |
merge_frontend_dict_types Merge Frontend Dict Types
向指定前端 src/utils/dict.ts 的 DICT_TYPE 增量合并常量,不创建数据库字典。 target_type 唯一匹配配置前端;relative_path 相对该项目,可带 apps/web-antd 等子目录。 constants 为非空 {name, value, comment?} 列表;同名同值跳过,名称或值冲突报错。 仅修改此文件的 DICT_TYPE 并补齐成员逗号,保留其他内容。不会创建缺失的文件/枚举。
| Parameter | Type | Description |
|---|---|---|
constants * | array | |
relative_path * | string | |
target_type * | string | |
workspace_root * | string |