Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ANTHROPIC_API_KEYNoAPI key for Anthropic Claude (optional, used for AI semantic features).
DBJAVAGENIX_LOG_LEVELNoLog level, e.g., 'DEBUG'.
DBJAVAGENIX_LOG_FORMATNoLog format, e.g., 'json' for structured logging.
DBJAVAGENIX_PROGRESSIVENoEnable progressive mode to expose only always visible tools (e.g., '1').

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
db_connect_testB

Test database connection and create connection session

db_query_databasesB

List all databases on the server

db_query_tablesB

List all tables in a specific database

db_query_table_existsA

Check if a table exists in the database

db_query_executeA

Execute custom SQL query (SELECT only for safety)

db_table_describeB

Get complete table structure information including columns, types, constraints

db_table_columnsC

Get detailed column information for a table

db_table_primary_keysC

Get primary key information for a table

db_table_foreign_keysC

Get foreign key relationships for a table

db_table_indexesC

Get index information for a table

db_codegen_analyzeC

Analyze database table structure for code generation with template context

db_codegen_generateA

[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.

codegen_build_contextA

构建代码生成所需的完整模板上下文(不写盘,不渲染)。这是原子代码生成工作流的第一步,后续 codegen_render_* 工具的输入。返回的 context dict 可被 LLM 检视或修改,再传给后续工具。

codegen_render_entityA

渲染 Entity 层(JPA @Entity / MybatisPlus @TableName)。需要先调用 codegen_build_context 获取 context。返回单个 java 文件源码。

codegen_render_daoA

渲染 DAO/Repository 层(JpaRepository 或 BaseMapper)。需要先调用 codegen_build_context 获取 context。

codegen_render_serviceA

渲染 Service 接口 + ServiceImpl 实现。需要先调用 codegen_build_context 获取 context。返回 2 个 java 文件。

codegen_render_controllerA

渲染 REST Controller(@RestController + Bean Validation)。需要先调用 codegen_build_context 获取 context。

codegen_render_mapperA

渲染 MyBatis XML mapper 或 MapStruct mapper。适用模板: Default(mapper.xml) / MybatisPlus-Mixed(mapper) / 含 useMapStruct(mapstruct_mapper)。sb35-java21 分类不需要 mapper,会返回空 files 列表。

springboot_validate_projectB

Validate SpringBoot project structure and dependencies before code generation

springboot_analyze_dependenciesB

Analyze project dependencies and generate intelligent recommendations for code generation

springboot_read_configB

Read Spring Boot project configuration (YAML/Properties/Bootstrap) and infer base package

db_render_er_diagramA

生成多个表的 Mermaid ER 图 (MCP App: mermaid 组件)。调用前需已通过 db_connect_test 建立连接。支持 MCP Apps 的客户端会渲染图表;不支持的客户端会看到纯文本摘要 + mermaid 源码。

ai_infer_business_namesA

从数据库表/列推断 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_recommend_templateA

根据整库表名 + 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_schemaA

对整库 schema 做自然语言概述: 总览、模块划分 (按前缀)、核心实体 (列数 + 命中模式)、关键关系。便于用户理解大库,或在生成前对齐 LLM 的 mental model。

ai_metricsA

返回进程内累积的 AI 调用指标 (Prompt Caching 命中率、token 消耗、错误次数)。对应 P4.4: ai.cache_hit_rate / ai.tokens_saved_via_cache 等。可在每次 ai_infer_business_names 等工具调用后查询。

server_metricsB

返回 DBJavaGenix MCP server 的运行时指标: uptime、每个工具的调用次数 / 平均时延 / 错误率。轻量级 in-process,不依赖 Prometheus。

server_healthA

返回 server 健康状态: Python 版本、mcp SDK 版本、核心模块导入是否成功、DB 连接活跃数、OS 信息。用于部署后冒烟检查。

search_toolsA

按关键词搜索可用 MCP 工具,用于渐进式发现 (Progressive Discovery)。当用户提到的操作不在当前可见工具列表中时,先用此工具搜索,再调用返回的工具。示例: query='render dao' → 返回 codegen_render_dao + 相关工具。传空 query 列出所有 always_visible 工具。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZhaoXingPeng/DBJavaGenix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server