About DBJavaGenix
DBJavaGenix is an MCP server published by ZhaoXingPeng in the Maps category: 智能数据库代码生成工具基于MCP架构,支持MySQL等多种数据库,自动生成Entity、DAO、Service及Controller等完整分层代码,大幅提升开发效率。依托MCP协议,具备强大扩展与集成能力,可智能推断表关系与业务语义。集成Mustache、MapStruct和Lombok,实现跨语言生成、高效映射和代码简化,并提供依赖自动管理,保障项目稳定。. Conduid read 35 tools from its source: ai_infer_business_names, ai_metrics, ai_recommend_template, ai_summarize_schema, codegen_build_context, codegen_render_controller and 29 more. No package is published for it, so it installs from a source checkout.
The repository has 36 stars and 9 forks, and its last commit was on 12 Sep 2026. Conduid has no tagged release on record for it. It passes all 1 static checks Conduid ran on the repository. Its topics include easycode, easycoder, mysql, npm, npmjs and sqllite.
Install
git clone https://github.com/ZhaoXingPeng/DBJavaGenixTools (35)
ai_infer_business_names从数据库表/列推断 Spring Boot 项目中**业务上合理的 Java 命名**。默认基于 15 条命名规则; 设 prefer_llm=true 且 ANTHROPIC_API_KEY 可用时,优先调用 Claude (启用 prompt caching 节省 token)。返回每张表的 class_name + reason + table_kind (entity/association/log/dict/config)。ai_metrics返回进程内累积的 AI 调用指标 (Prompt Caching 命中率、token 消耗、错误次数)。对应 P4.4: ai.cache_hit_rate / ai.tokens_saved_via_cache 等。可在每次 ai_infer_business_names 等工具调用后查询。ai_recommend_template根据整库表名 + FK 关系推荐 template_category (Default/MybatisPlus/MybatisPlus-Mixed/sb35-java21) + 生成选项 (useSwagger/useLombok/include_mapstruct/generate_dto/generate_vo)。检测 RBAC / 电商 / CMS / 工单 等典型业务模式。传 hint_modern_stack=true 强制推 sb35-java21 (Java 21 + jakarta)。ai_summarize_schema对整库 schema 做自然语言概述: 总览、模块划分 (按前缀)、核心实体 (列数 + 命中模式)、关键关系。便于用户理解大库,或在生成前对齐 LLM 的 mental model。codegen_build_context构建代码生成所需的完整模板上下文(不写盘,不渲染)。这是原子代码生成工作流的第一步,后续 codegen_render_* 工具的输入。返回的 context dict 可被 LLM 检视或修改,再传给后续工具。codegen_render_controller渲染 REST Controller(@RestController + Bean Validation)。需要先调用 codegen_build_context 获取 context。codegen_render_dao渲染 DAO/Repository 层(JpaRepository 或 BaseMapper)。需要先调用 codegen_build_context 获取 context。codegen_render_dto渲染 sb35-java21 的 Java record DTO。需要先调用 codegen_build_context 获取 context;其他模板分类不生成 DTO。codegen_render_entity渲染 Entity 层(JPA @Entity / MybatisPlus @TableName)。需要先调用 codegen_build_context 获取 context。返回单个 java 文件源码。codegen_render_mapper渲染 MyBatis XML mapper 或 MapStruct mapper。适用模板: Default(mapper.xml) / MybatisPlus-Mixed(mapper) / 含 useMapStruct(mapstruct_mapper)。sb35-java21 分类不需要 mapper,会返回空 files 列表。codegen_render_service渲染 Service 接口 + ServiceImpl 实现。需要先调用 codegen_build_context 获取 context。返回 2 个 java 文件。db_codegen_analyzeAnalyze database table structure for code generation with template contextdb_codegen_generate[Legacy / single-shot] Generate Java code from database table analysis using templates. Prefer the atomic workflow: codegen_build_context + codegen_render_entity/dao/service/controller/mapper (P2.2). This single-shot tool also writes files to disk in one go, with no preview/edit cycle.db_connect_testTest database connection and create connection sessiondb_disconnectClose an existing database connection sessiondb_query_databasesList all databases on the serverdb_query_executeExecute custom SQL query (SELECT only for safety)db_query_table_existsCheck if a table exists in the databasedb_query_tablesList all tables in a specific databasedb_render_er_diagram生成多个表的 Mermaid ER 图 (MCP App: mermaid 组件)。调用前需已通过 db_connect_test 建立连接。支持 MCP Apps 的客户端会渲染图表;不支持的客户端会看到纯文本摘要 + mermaid 源码。db_table_columnsGet detailed column information for a tabledb_table_describeGet complete table structure information including columns, types, constraintsdb_table_foreign_keysGet foreign key relationships for a tabledb_table_indexesGet index information for a tabledb_table_primary_keysGet primary key information for a tableschema_check_cyclesDetect FK cycles in schema (anti-pattern). Returns cycles list and safe boolean. Self-references not reported as cycles.schema_cluster_tablesGroup tables into business clusters via Union-Find on FK connectivity. Returns clusters with suggested names (common prefix or central table).schema_topo_orderTopologically sort tables by FK dependencies. Returns order safe for DDL creation or Service injection. Detects cycles via unresolved list.search_tools按关键词搜索可用 MCP 工具,用于渐进式发现 (Progressive Discovery)。当用户提到的操作不在当前可见工具列表中时,先用此工具搜索,再调用返回的工具。示例: query='render dao' → 返回 codegen_render_dao + 相关工具。传空 query 列出所有 always_visible 工具。server_health返回 server 健康状态: Python 版本、mcp SDK 版本、核心模块导入是否成功、DB 连接活跃数、OS 信息。用于部署后冒烟检查。server_metrics返回 DBJavaGenix MCP server 的运行时指标: uptime、每个工具的调用次数 / 平均时延 / 错误率。轻量级 in-process,不依赖 Prometheus。springboot_analyze_dependenciesAnalyze project dependencies and generate intelligent recommendations for code generationspringboot_generate_quality_configsGenerate Java engineering-standards config bundle (Checkstyle XML, SpotBugs exclude XML, .editorconfig, lombok.config). Returns each file's suggested path and content as a JSON payload. Caller decides whether to write to disk.springboot_read_configRead Spring Boot project configuration (YAML/Properties/Bootstrap) and infer base packagespringboot_validate_projectValidate SpringBoot project structure and dependencies before code generationSecurity checks
- ✓README presentThe repository's README runs to about 579 words.
5 checks have not been run yet.
README
The repository's README runs to about 579 words. The original in the repository is authoritative.
Read full README