mcp-yearning
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | HTTP transport listen address | 0.0.0.0 |
| MCP_PORT | No | HTTP transport listen port | 8080 |
| YEARNING_URL | No | Yearning server URL | http://localhost:8000 |
| MCP_LOG_LEVEL | No | Log level: debug/info/warning/error | info |
| MCP_TRANSPORT | No | Transport protocol: stdio, sse, streamable-http | stdio |
| MCP_AUTH_TOKEN | No | Bearer token for HTTP authentication | |
| YEARNING_TIMEOUT | No | Request timeout in seconds | 30 |
| YEARNING_PASSWORD | Yes | Login password for Yearning (required) | |
| YEARNING_USERNAME | Yes | Login username for Yearning (required) | |
| YEARNING_READ_ONLY | No | Enable read-only mode (true/false) | false |
| YEARNING_LOGIN_TYPE | No | Login type: general or ldap | general |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Yearning SQL 审核平台 MCP Server。提供 SQL 工单提交/审核/执行、数据查询、表结构查看等工具。基于 REST/WebSocket API,支持工单全生命周期管理。写操作默认禁用(YEARNING_READ_ONLY 默认为 true,safe-by-default),需显式设为 false 开启。
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| yearning_user_infoA | 查看当前登录用户的信息、部门、邮箱,以及有权查询的数据源列表。 对应 API:GET /api/v2/fetch/userinfo |
| yearning_list_sourcesA | 列出当前账号有权限的数据源(可按 query/dml/ddl 维度过滤)。 对应 API:GET /api/v2/fetch/source |
| yearning_list_databasesA | 列出指定数据源下的数据库(库)列表。 对应 API:GET /api/v2/fetch/base |
| yearning_list_tablesA | 列出指定数据源、指定库下的数据表列表。 对应 API:GET /api/v2/fetch/table |
| yearning_table_fieldsA | 查看表结构:字段列表(类型/可空/键/默认值/注释)与索引信息。 对应 API:GET /api/v2/fetch/fields |
| yearning_sql_checkA | 提交前对 SQL 做审核检测,返回逐条检查结果(级别/影响行数/错误/执行耗时)。 建议先调用本工具确认无误,再调用 yearning_submit_order 提交工单。 对应 API:PUT /api/v2/fetch/test |
| yearning_my_ordersA | 分页列出当前用户提交的工单(支持状态/关键字/工单号过滤)。 对应 API:WS /api/v2/common/list |
| yearning_order_detailA | 查看工单详情:SQL 明细(分页)、完整 SQL 语句、执行结果记录。 对应 API:GET /api/v2/fetch/detail + GET /api/v2/fetch/sql |
| yearning_order_timelineA | 查看工单审核时间线与流程步骤(含各审核人动作与当前所处步骤)。 对应 API:GET /api/v2/fetch/timeline + GET /api/v2/fetch/steps |
| yearning_rollback_sqlA | 获取工单的回滚 SQL(执行前由系统生成,用于误操作回退)。 对应 API:GET /api/v2/fetch/roll |
| yearning_audit_ordersA | 分页列出与当前用户相关的待审核/审核工单(审核人视角)。 对应 API:WS /api/v2/audit/order/list |
| yearning_query_statusA | 查看查询审核开关是否开启,以及当前用户的查询工单状态。 对应 API:GET /api/v2/fetch/is_query + GET /api/v2/fetch/query_status |
| yearning_run_queryA | 在指定数据源执行只读 SELECT 查询并返回结果表格。 注意:本工具仅执行 SELECT,对目标库数据无修改;但 Yearning 会留存查询审计记录, 且查询本身可能产生资源开销(如全表扫描、锁竞争),属「提交操作」而非纯被动读取。 需具备查询权限且已通过查询审核。 对应 API:WS /api/v2/query/results(msgpack 编解码) |
| yearning_order_commentsB | 读取指定工单的全部评论。 对应 API:WS /api/v2/fetch/comment |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resource_user_info | 当前登录用户信息(只读资源,已脱敏) |
| resource_sources | 数据源列表(只读资源) |
TDQS
Scored across 14 tools
Each tool targets a distinct resource and action: user info, source listing, database/table/field metadata, SQL check, order retrieval (my orders, audit orders), order details (detail, timeline, rollback, comments), and query execution. The two order-listing tools (my_orders vs audit_orders) are clearly differentiated by user vs auditor perspective.
All tools share the 'yearning_' prefix and use snake_case. Most follow a verb_noun pattern (list_sources, list_tables, run_query) while some are noun-based (table_fields, order_detail). This is a minor deviation but overall predictable and readable.
14 tools is well within the typical range for a domain-specific server. The count matches the platform's complexity and each tool covers a distinct aspect of the SQL audit and query workflow.
The tools heavily favor read/query operations but lack critical actions. The description in yearning_sql_check references a 'submit_order' tool that is absent, so the core workflow of submitting SQL for approval is incomplete. Additionally, there is no tool for approving/rejecting orders from the auditor perspective, only listing them. This leaves significant functional gaps.