@yoonion/mimi-seed-mcp 0.25.1 → 0.25.2

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.
@@ -47,9 +47,16 @@ export declare const CONFIRM_PREVIEW_MARKER = "\uD83D\uDED1 DRY-RUN";
47
47
  export declare function buildToolIndex(manifest: ToolManifest): Map<string, ToolMeta>;
48
48
  /** `playstore_submit_release` → `Play Store: Submit release`. */
49
49
  export declare function toolTitle(name: string): string;
50
+ /**
51
+ * MCP 명세의 기본값(readOnlyHint=false · idempotentHint=false · openWorldHint=true)과 같은 힌트는 싣지 않는다 —
52
+ * 도구 목록은 연결마다 에이전트 컨텍스트에 실리고, 생략과 기본값은 명세상 같은 뜻이다. destructiveHint 는 예외로
53
+ * 항상 싣는다: 기본값이 true 라, 생략하면 명세를 느슨하게 읽는 클라이언트가 읽기 도구에도 "파괴" 경고를 붙일 수 있다.
54
+ */
50
55
  export declare function annotationsFor(meta: ToolMeta): ToolAnnotations & {
51
56
  title: string;
52
57
  };
58
+ /** 생략된 힌트를 명세 기본값으로 채운 실효값 — 테스트·카탈로그가 "이 도구는 읽기 전용인가"를 물을 때 쓴다. */
59
+ export declare function effectiveHints(annotations: ToolAnnotations | undefined): Required<Omit<ToolAnnotations, 'title'>>;
53
60
  export declare function previewValue(key: string, value: unknown): string;
54
61
  export declare function confirmPreview(name: string, args: Record<string, unknown>): CallToolResult;
55
62
  /** 레지스트라 가드를 받는 파괴적 도구의 설명 끝에 붙는 문구. 영어 번역은 i18n/tools-en/registrar.ts. */
@@ -69,14 +69,28 @@ export function toolTitle(name) {
69
69
  const capitalized = sentence.charAt(0).toUpperCase() + sentence.slice(1);
70
70
  return brand ? `${brand[1]}: ${capitalized}` : capitalized;
71
71
  }
72
+ /**
73
+ * MCP 명세의 기본값(readOnlyHint=false · idempotentHint=false · openWorldHint=true)과 같은 힌트는 싣지 않는다 —
74
+ * 도구 목록은 연결마다 에이전트 컨텍스트에 실리고, 생략과 기본값은 명세상 같은 뜻이다. destructiveHint 는 예외로
75
+ * 항상 싣는다: 기본값이 true 라, 생략하면 명세를 느슨하게 읽는 클라이언트가 읽기 도구에도 "파괴" 경고를 붙일 수 있다.
76
+ */
72
77
  export function annotationsFor(meta) {
73
78
  const title = meta.deprecatedFor ? `${toolTitle(meta.name)} (deprecated)` : toolTitle(meta.name);
74
79
  return {
75
80
  title,
76
- readOnlyHint: meta.kind === 'read',
81
+ ...(meta.kind === 'read' ? { readOnlyHint: true } : {}),
77
82
  destructiveHint: meta.kind === 'destructive',
78
- idempotentHint: meta.idempotent,
79
- openWorldHint: !meta.local,
83
+ ...(meta.idempotent ? { idempotentHint: true } : {}),
84
+ ...(meta.local ? { openWorldHint: false } : {}),
85
+ };
86
+ }
87
+ /** 생략된 힌트를 명세 기본값으로 채운 실효값 — 테스트·카탈로그가 "이 도구는 읽기 전용인가"를 물을 때 쓴다. */
88
+ export function effectiveHints(annotations) {
89
+ return {
90
+ readOnlyHint: annotations?.readOnlyHint ?? false,
91
+ destructiveHint: annotations?.destructiveHint ?? true,
92
+ idempotentHint: annotations?.idempotentHint ?? false,
93
+ openWorldHint: annotations?.openWorldHint ?? true,
80
94
  };
81
95
  }
82
96
  // ── confirm guard ──────────────────────────────────────────────────────────
@@ -19,7 +19,18 @@ export declare function toolTextTranslator(lang: Lang): TranslateText;
19
19
  /** JSON 스키마 안의 모든 `description` 을 바꾼 사본 (원본은 건드리지 않는다). */
20
20
  export declare function translateSchemaDescriptions<T>(schema: T, translate: TranslateText): T;
21
21
  /**
22
- * `tools/list` 응답의 파라미터 설명을 번역하도록 핸들러를 감싼다. 모든 도구를 등록한 **뒤에** 부른다.
22
+ * 스키마 최상위의 `$schema`(JSON Schema 방언 URL)를 뺀다. SDK 가 도구마다 붙이는데(도구 수 × 약 50바이트) MCP
23
+ * 클라이언트는 쓰지 않는다 — 도구 목록은 연결마다 에이전트 컨텍스트에 실리므로 줄일수록 이득이다. 중첩 스키마는
24
+ * 건드리지 않는다(거기엔 붙지 않는다).
25
+ */
26
+ export declare function withoutSchemaDialect<T>(schema: T): T;
27
+ /**
28
+ * `tools/list` 응답을 다듬도록 핸들러를 감싼다 — `$schema` 를 빼고(모든 언어), `translate` 를 주면 파라미터 설명을
29
+ * 번역한다. 모든 도구를 등록한 **뒤에** 부른다.
30
+ *
31
+ * `$schema` 가 없으면 MCP 클라이언트는 스키마를 JSON Schema 2020-12 로 읽을 수 있다. 우리 스키마는 draft-07 로
32
+ * 만들어지지만 두 방언에서 뜻이 갈리는 구문(튜플 `items` · `additionalItems` · `dependencies` · `definitions`)을 쓰지
33
+ * 않아 어느 쪽으로 읽어도 같다 — tool-manifest.test.ts 가 그 조건을 지킨다.
23
34
  *
24
35
  * SDK 는 `tools/list` 응답을 매번 zod 에서 새로 만든다. 공개 API 로는 그 결과를 가공할 수 없어, Protocol 의
25
36
  * 핸들러 표(`_requestHandlers`)에 있는 SDK 핸들러를 감싼다 — 목록 조립(enabled 필터 · annotations · outputSchema)은
@@ -28,4 +39,4 @@ export declare function translateSchemaDescriptions<T>(schema: T, translate: Tra
28
39
  *
29
40
  * @returns 감쌌으면 true.
30
41
  */
31
- export declare function localizeToolList(server: McpServer, translate: TranslateText): boolean;
42
+ export declare function localizeToolList(server: McpServer, translate?: TranslateText): boolean;
@@ -21,7 +21,23 @@ export function translateSchemaDescriptions(schema, translate) {
21
21
  return out;
22
22
  }
23
23
  /**
24
- * `tools/list` 응답의 파라미터 설명을 번역하도록 핸들러를 감싼다. 모든 도구를 등록한 **뒤에** 부른다.
24
+ * 스키마 최상위의 `$schema`(JSON Schema 방언 URL)를 뺀다. SDK 가 도구마다 붙이는데(도구 수 × 약 50바이트) MCP
25
+ * 클라이언트는 쓰지 않는다 — 도구 목록은 연결마다 에이전트 컨텍스트에 실리므로 줄일수록 이득이다. 중첩 스키마는
26
+ * 건드리지 않는다(거기엔 붙지 않는다).
27
+ */
28
+ export function withoutSchemaDialect(schema) {
29
+ if (!schema || typeof schema !== 'object' || Array.isArray(schema) || !('$schema' in schema))
30
+ return schema;
31
+ const { $schema: _dialect, ...rest } = schema;
32
+ return rest;
33
+ }
34
+ /**
35
+ * `tools/list` 응답을 다듬도록 핸들러를 감싼다 — `$schema` 를 빼고(모든 언어), `translate` 를 주면 파라미터 설명을
36
+ * 번역한다. 모든 도구를 등록한 **뒤에** 부른다.
37
+ *
38
+ * `$schema` 가 없으면 MCP 클라이언트는 스키마를 JSON Schema 2020-12 로 읽을 수 있다. 우리 스키마는 draft-07 로
39
+ * 만들어지지만 두 방언에서 뜻이 갈리는 구문(튜플 `items` · `additionalItems` · `dependencies` · `definitions`)을 쓰지
40
+ * 않아 어느 쪽으로 읽어도 같다 — tool-manifest.test.ts 가 그 조건을 지킨다.
25
41
  *
26
42
  * SDK 는 `tools/list` 응답을 매번 zod 에서 새로 만든다. 공개 API 로는 그 결과를 가공할 수 없어, Protocol 의
27
43
  * 핸들러 표(`_requestHandlers`)에 있는 SDK 핸들러를 감싼다 — 목록 조립(enabled 필터 · annotations · outputSchema)은
@@ -34,17 +50,19 @@ export function localizeToolList(server, translate) {
34
50
  const handlers = server.server._requestHandlers;
35
51
  const original = handlers?.get('tools/list');
36
52
  if (!handlers || !original) {
37
- console.error('[mimi-seed] tools/list handler not found; tool descriptions will not be translated (MCP SDK internals changed?).');
53
+ console.error('[mimi-seed] tools/list handler not found; tool descriptions will not be translated or trimmed (MCP SDK internals changed?).');
38
54
  return false;
39
55
  }
56
+ // 번역할 게 없으면(ko) 스키마를 통째로 복사하지 않는다 — `$schema` 제거는 최상위 얕은 복사로 충분하다.
57
+ const retext = (schema) => (translate ? translateSchemaDescriptions(schema, translate) : schema);
40
58
  handlers.set('tools/list', async (request, extra) => {
41
59
  const result = (await original(request, extra));
42
60
  return {
43
61
  ...result,
44
62
  tools: result.tools.map((tool) => ({
45
63
  ...tool,
46
- ...(tool.inputSchema ? { inputSchema: translateSchemaDescriptions(tool.inputSchema, translate) } : {}),
47
- ...(tool.outputSchema ? { outputSchema: translateSchemaDescriptions(tool.outputSchema, translate) } : {}),
64
+ ...(tool.inputSchema ? { inputSchema: withoutSchemaDialect(retext(tool.inputSchema)) } : {}),
65
+ ...(tool.outputSchema ? { outputSchema: withoutSchemaDialect(retext(tool.outputSchema)) } : {}),
48
66
  })),
49
67
  };
50
68
  });
package/dist/server.js CHANGED
@@ -86,8 +86,8 @@ export function buildServer(version, options = {}) {
86
86
  registerYouTubeTools(registrar);
87
87
  registerTikTokBusinessTools(registrar);
88
88
  registerDriveTools(registrar);
89
- if (toolLang === 'en')
90
- localizeToolList(server, translate);
89
+ // 모든 언어에 적용한다 — `$schema` 제거는 언어와 무관하다. 번역은 en 일 때만.
90
+ localizeToolList(server, toolLang === 'en' ? translate : undefined);
91
91
  registerPrompts(server, toolsets, manifest);
92
92
  registerResources(server, { manifest, toolsets });
93
93
  return server;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoonion/mimi-seed-mcp",
3
- "version": "0.25.1",
3
+ "version": "0.25.2",
4
4
  "description": "Mimi Seed MCP server \u2014 Firebase + AdMob + Google Play + App Store management for Claude Code / Codex / Cursor / any MCP client.",
5
5
  "type": "module",
6
6
  "imports": {