@ecubelabs/mysql-mcp 1.0.0-next.2 → 1.0.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -237,7 +237,8 @@ migration이 빠진 것처럼 보이기 때문입니다.
237
237
  응답이 새 값을 알립니다.
238
238
  - Catalog가 꺼진 profile(`MYSQL_CATALOG_ENABLED=false` 또는 `MYSQL_APP_SCHEMAS` 없음)은
239
239
  branch를 기록할 곳이 없어 표시하지 않습니다.
240
- - 기록 전에는 `describe`와 query 응답이 기록하라고 안내합니다. profile별 제안은 질문
240
+ - 기록 전에는 `mysql_catalog` 툴 설명이 문서를 연결하기 전에 물으라고 지시하고,
241
+ `describe`·`link`·query 응답이 기록하라고 안내합니다. profile별 제안은 질문
241
242
  형태이고 저장되지 않습니다.
242
243
 
243
244
  | Profile | 제안하는 branch |
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSche
7
7
  import { log, sharedOnce, tableResourceUri } from './src/utils/index.js';
8
8
  import { writeCapabilities } from './src/db/permissions.js';
9
9
  import { SCHEMA_DELETE_PERMISSIONS, SCHEMA_DDL_PERMISSIONS, SCHEMA_INSERT_PERMISSIONS, SCHEMA_UPDATE_PERMISSIONS, isMultiDbMode, mcpConfig as config, MYSQL_PROFILE, PROFILE_LABEL, IS_WRITE_FORBIDDEN_PROFILE, APP_SCHEMAS, MYSQL_CATALOG_ENABLED, MYSQL_CATALOG_PATH, MYSQL_CATALOG_TTL_HOURS, MYSQL_DEFAULT_TIMEOUT_SECONDS, MYSQL_MAX_TIMEOUT_SECONDS, MAX_RESPONSE_ROWS, MYSQL_SSL_ENABLED, MYSQL_SSL_CA_PATH, MYSQL_SSL_CERT_PATH, MYSQL_SSL_KEY_PATH, PACKAGE_VERSION, SSH_ENABLED, } from './src/config/index.js';
10
+ import { missingBranchToolInstruction } from './src/catalog/branch.js';
10
11
  import { catalogIdentity, SchemaCatalog } from './src/catalog/index.js';
11
12
  import { describeConnection, getPool, executeQuery, executeReadOnlyQuery, setQueryDiagnosticsSource, setCodeBranchSource, clampTimeoutSeconds, describeQueryError, poolPromise, profileBanner, } from './src/db/index.js';
12
13
  import { describeTunnel, ensureTunnel, resolveTunnelConfig, stopTunnel } from './src/ssh/tunnel.js';
@@ -552,7 +553,14 @@ export default function createMcpServer() {
552
553
  title: 'MySQL Query',
553
554
  },
554
555
  },
555
- ...(catalog.isEnabled() ? [mysqlCatalogTool] : []),
556
+ ...(catalog.isEnabled()
557
+ ? [
558
+ {
559
+ ...mysqlCatalogTool,
560
+ description: mysqlCatalogTool.description + missingBranchToolInstruction(catalog.codeBranch()),
561
+ },
562
+ ]
563
+ : []),
556
564
  ],
557
565
  };
558
566
  log('info', 'ListToolsRequest response:', JSON.stringify(toolsResponse, null, 2));
@@ -45,6 +45,13 @@ export function normalizeBranchName(input) {
45
45
  }
46
46
  return branch;
47
47
  }
48
+ export function missingBranchToolInstruction(branch) {
49
+ return branch
50
+ ? ''
51
+ : ' No code branch is recorded for this database yet (response banners show no "code:"). ' +
52
+ 'Before linking or reading documents, ask the user which branch matches this database ' +
53
+ 'and record it with branch.';
54
+ }
48
55
  export function loadedBranch(value) {
49
56
  if (typeof value !== 'string') {
50
57
  return null;
@@ -42,7 +42,7 @@ export class CatalogDocuments {
42
42
  constructor(store) {
43
43
  this.store = store;
44
44
  }
45
- link(links) {
45
+ link(links, guidance = null) {
46
46
  const resolved = links.map((link) => ({
47
47
  ...link,
48
48
  doc: normalizeDocumentPath(link.doc),
@@ -74,6 +74,7 @@ export class CatalogDocuments {
74
74
  doc: link.doc,
75
75
  repo: link.repo,
76
76
  })),
77
+ ...(guidance ? { guidance } : {}),
77
78
  }, null, 2);
78
79
  }
79
80
  unlink(schemaName, tableName) {
@@ -270,7 +270,7 @@ export class SchemaCatalog {
270
270
  repo: link.repo,
271
271
  });
272
272
  }
273
- return this.documents.link(resolvedLinks);
273
+ return this.documents.link(resolvedLinks, this.store.codeBranch() ? null : missingBranchNotice(this.options.profile));
274
274
  }
275
275
  async unlink(input) {
276
276
  if (!this.isEnabled()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecubelabs/mysql-mcp",
3
- "version": "1.0.0-next.2",
3
+ "version": "1.0.0-next.3",
4
4
  "description": "Read-only MySQL MCP server that reaches its database through an SSH bastion, with per-environment profiles",
5
5
  "license": "MIT",
6
6
  "repository": {