@yoonion/mimi-seed-mcp 0.23.3 → 0.24.0

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/dist/prompts.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ToolsetSelection } from './lib/toolsets.js';
3
- export declare function registerPrompts(server: McpServer, toolsets: ToolsetSelection): void;
3
+ import type { ToolManifest } from './lib/package-root.js';
4
+ export declare function registerPrompts(server: McpServer, toolsets: ToolsetSelection, manifest: ToolManifest): void;
package/dist/prompts.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { androidPackageName } from './lib/package-name.js';
3
+ import { resolveLang } from '#core/lang.js';
4
+ import { buildToolMenu, formatToolMenu } from './lib/tool-menu.js';
3
5
  const stores = [
4
6
  {
5
7
  target: 'packageName',
@@ -45,16 +47,24 @@ function promptMessage(lines) {
45
47
  function storeTarget(store, targets) {
46
48
  return targets[store.target] ? `${store.label} (${targets[store.target]})` : store.label;
47
49
  }
48
- export function registerPrompts(server, toolsets) {
50
+ export function registerPrompts(server, toolsets, manifest) {
49
51
  const enabled = (name) => toolsets.isToolEnabled(name);
50
52
  const deployStores = stores.filter((store) => [store.check, store.releaseLookup, store.updateNotes].every(enabled));
51
53
  const reviewStores = stores.filter((store) => enabled(store.listReviews));
54
+ server.prompt('select-tools', '이번 작업에 사용할 서비스를 텍스트 목록에서 선택', {}, async () => {
55
+ const lang = resolveLang();
56
+ return promptMessage([
57
+ 'Show the following service menu and wait for the user to choose. Accept multiple numbers, service names, or a free-form description of the work.',
58
+ formatToolMenu(buildToolMenu(manifest, toolsets, lang), lang),
59
+ 'Map the reply to the service IDs in parentheses. If the intent is unclear, ask a short follow-up before loading tools.',
60
+ 'Read mimi-seed://tools/menu/{areas} with the selected comma-separated IDs. Load only the tools needed for the stated task using host discovery. Keep all publish, write, and destructive confirmations in effect.',
61
+ ]);
62
+ });
52
63
  server.prompt('getting-started', '처음 사용자 온보딩 및 첫 읽기 작업', {}, async () => promptMessage([
53
64
  'Mimi Seed 온보딩을 도와줘.',
54
- '1. mimi_seed_status로 연결 상태를 확인한다.',
55
- '2. 사용자가 기능을 물으면 mimi-seed://tools/catalog에서 활성 도메인을 요약한다.',
56
- '3. 목표가 알려져 있으면 바로 진행하고, 불명확하면 먼저 확인한다. 연결이 필요한 경우 해당 서비스 설정을 안내한다.',
57
- '4. 자격증명이 준비되면 활성 도구 중 목표에 맞는 첫 읽기 작업을 실행한다.',
65
+ '서비스가 정해지지 않았으면 mimi-seed://tools/menu의 목록을 보여주고 사용자의 선택을 기다린다.',
66
+ ...(enabled('mimi_seed_status') ? ['선택된 작업의 연결 상태 확인에 필요하면 mimi_seed_status를 사용한다.'] : []),
67
+ '연결이 필요한 경우 해당 서비스 설정을 안내하고, 준비되면 활성 도구 중 목표에 맞는 첫 읽기 작업을 실행한다.',
58
68
  ]));
59
69
  if (deployStores.length > 0) {
60
70
  server.prompt('deploy', '앱 출시 준비도 점검 및 릴리스 노트 적용', {
@@ -80,10 +90,11 @@ export function registerPrompts(server, toolsets) {
80
90
  ]);
81
91
  });
82
92
  }
83
- server.prompt('health', '연결 상태와 대상 앱의 출시 준비도 점검', targetArgs, async (targets) => promptMessage([
84
- 'mimi_seed_status로 연결 상태를 확인하고 작업에 필요한 인증 문제를 알려줘.',
85
- ...selectStores(stores.filter((store) => enabled(store.check)), targets).map((store) => `대상 앱이 특정된 경우 ${storeTarget(store, targets)}의 ${store.check}로 출시 블로커를 확인한다.`),
86
- ]));
93
+ if (enabled('mimi_seed_status') || stores.some((store) => enabled(store.check)))
94
+ server.prompt('health', '연결 상태와 대상 앱의 출시 준비도 점검', targetArgs, async (targets) => promptMessage([
95
+ ...(enabled('mimi_seed_status') ? ['mimi_seed_status로 연결 상태를 확인하고 작업에 필요한 인증 문제를 알려줘.'] : []),
96
+ ...selectStores(stores.filter((store) => enabled(store.check)), targets).map((store) => `대상 앱이 특정된 경우 ${storeTarget(store, targets)}의 ${store.check}로 출시 블로커를 확인한다.`),
97
+ ]));
87
98
  if (reviewStores.length > 0) {
88
99
  server.prompt('review-inbox', '미답변 스토어 리뷰 조회 및 답변 초안 작성', {
89
100
  ...targetArgs,
@@ -1,23 +1,22 @@
1
1
  import { z } from 'zod';
2
+ import { GOOGLE_PROFILE_ID } from '../auth/google-auth.js';
2
3
  import { androidPackageName, iosBundleId } from '../lib/package-name.js';
3
4
  import * as ga4Raw from '../ga4/tools.js';
4
5
  import { requireAuth } from '../helpers.js';
5
6
  import { friendlyGoogleError } from '../lib/google-errors.js';
6
7
  import { wrapDomain } from '../lib/wrap-domain.js';
7
8
  import { jsonResult } from '../lib/mcp-response.js';
8
- // firebase register 와 동일한 프록시 — raw GaxiosError(SERVICE_DISABLED / 403 /
9
- // ACCESS_TOKEN_SCOPE_INSUFFICIENT)를 "다음에 뭘 할지" 메시지로 변환. 특히 GA4 는
10
- // analytics.edit 스코프를 새로 추가했으므로 기존 사용자는 재로그인 안내가 필수.
11
9
  const ga4 = wrapDomain(ga4Raw, (err) => friendlyGoogleError(err));
12
10
  const PROPERTY_DESC = "GA4 property ID — '123456789' 또는 'properties/123456789'";
11
+ const profile = z.string().regex(GOOGLE_PROFILE_ID).optional().describe('Google 로그인 프로필. 생략하면 기본 계정을 사용.');
13
12
  export function registerGa4Tools(server) {
14
- server.tool('ga4_list_account_summaries', '접근 가능한 Google Analytics 계정 + 각 계정의 GA4 property 요약. accountId / propertyId 를 확인할 때 먼저 호출. analytics.edit 스코프 필요(없으면 재로그인 안내).', {}, async () => {
15
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
13
+ server.tool('ga4_list_account_summaries', '접근 가능한 Google Analytics 계정 + 각 계정의 GA4 property 요약. accountId / propertyId 를 확인할 때 먼저 호출.', { profile }, async ({ profile }) => {
14
+ const auth = await requireAuth(ga4Raw.GA4_ADMIN_READ_SCOPES, profile);
16
15
  const summaries = await ga4.listAccountSummaries(auth);
17
16
  return jsonResult(summaries);
18
17
  });
19
- server.tool('ga4_list_properties', '특정 GA 계정 하위 GA4 property 목록.', { accountId: z.string().describe("GA 계정 ID — '123' 또는 'accounts/123'") }, async ({ accountId }) => {
20
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
18
+ server.tool('ga4_list_properties', '특정 GA 계정 하위 GA4 property 목록.', { accountId: z.string().describe("GA 계정 ID — '123' 또는 'accounts/123'"), profile }, async ({ accountId, profile }) => {
19
+ const auth = await requireAuth(ga4Raw.GA4_ADMIN_READ_SCOPES, profile);
21
20
  const properties = await ga4.listProperties(auth, accountId);
22
21
  return jsonResult(properties);
23
22
  });
@@ -26,8 +25,9 @@ export function registerGa4Tools(server) {
26
25
  displayName: z.string().describe('property 표시 이름 (예: SpeakReward)'),
27
26
  timeZone: z.string().optional().describe("IANA 타임존 (기본 'America/Los_Angeles', 예: 'Asia/Seoul')"),
28
27
  currencyCode: z.string().optional().describe("ISO 4217 통화코드 (기본 'USD', 예: 'KRW')"),
29
- }, async ({ accountId, displayName, timeZone, currencyCode }) => {
30
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
28
+ profile,
29
+ }, async ({ accountId, displayName, timeZone, currencyCode, profile }) => {
30
+ const auth = await requireAuth(ga4Raw.GA4_SCOPE, profile);
31
31
  const property = await ga4.createProperty(auth, { accountId, displayName, timeZone, currencyCode });
32
32
  return jsonResult(property);
33
33
  });
@@ -38,8 +38,9 @@ export function registerGa4Tools(server) {
38
38
  defaultUri: z.string().optional().describe('web 전용 — 사이트 URL (예: https://example.com)'),
39
39
  packageName: androidPackageName.optional().describe('android 전용 — 패키지명 (예: com.example.app)'),
40
40
  bundleId: iosBundleId.optional().describe('ios 전용 — Bundle ID (예: com.example.app)'),
41
- }, async ({ propertyId, platform, displayName, defaultUri, packageName, bundleId }) => {
42
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
41
+ profile,
42
+ }, async ({ propertyId, platform, displayName, defaultUri, packageName, bundleId, profile }) => {
43
+ const auth = await requireAuth(ga4Raw.GA4_SCOPE, profile);
43
44
  const stream = await ga4.createDataStream(auth, propertyId, {
44
45
  platform,
45
46
  displayName,
@@ -49,8 +50,8 @@ export function registerGa4Tools(server) {
49
50
  });
50
51
  return jsonResult(stream);
51
52
  });
52
- server.tool('ga4_list_data_streams', 'GA4 property 의 data stream 목록 (measurementId / firebaseAppId 평탄화).', { propertyId: z.string().describe(PROPERTY_DESC) }, async ({ propertyId }) => {
53
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
53
+ server.tool('ga4_list_data_streams', 'GA4 property 의 data stream 목록 (measurementId / firebaseAppId 평탄화).', { propertyId: z.string().describe(PROPERTY_DESC), profile }, async ({ propertyId, profile }) => {
54
+ const auth = await requireAuth(ga4Raw.GA4_ADMIN_READ_SCOPES, profile);
54
55
  const streams = await ga4.listDataStreams(auth, propertyId);
55
56
  return jsonResult(streams);
56
57
  });
@@ -62,51 +63,43 @@ export function registerGa4Tools(server) {
62
63
  streamingExportEnabled: z.boolean().optional().describe('스트리밍 내보내기 활성화 (기본 false, 추가 비용 가능)'),
63
64
  freshDailyExportEnabled: z.boolean().optional().describe('Fresh Daily 내보내기 활성화 (기본 false, 지원 속성만 가능)'),
64
65
  includeAdvertisingId: z.boolean().optional().describe('모바일 광고 식별자 포함 (기본 false, 개인정보 정책 확인 필요)'),
66
+ profile,
65
67
  };
66
- server.tool('ga4_plan_bigquery_link', 'GA4 → BigQuery export 링크 생성 계획을 읽기 전용으로 점검. 기존 링크, 대상 프로젝트, 데이터셋 위치와 export 옵션을 반환하며 원격 상태를 변경하지 않는다.', bigQueryLinkSchema, async ({ propertyId, projectId, datasetLocation, dailyExportEnabled, streamingExportEnabled, freshDailyExportEnabled, includeAdvertisingId }) => {
67
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
68
- const plan = await ga4.planBigQueryLink(auth, propertyId, {
69
- projectId,
70
- datasetLocation,
71
- dailyExportEnabled,
72
- streamingExportEnabled,
73
- freshDailyExportEnabled,
74
- includeAdvertisingId,
75
- });
68
+ server.tool('ga4_plan_bigquery_link', 'GA4 → BigQuery export 링크 생성 계획을 읽기 전용으로 점검. 기존 링크, 대상 프로젝트, 데이터셋 위치와 export 옵션을 반환하며 원격 상태를 변경하지 않는다.', bigQueryLinkSchema, async ({ propertyId, profile, ...opts }) => {
69
+ const auth = await requireAuth(ga4Raw.GA4_ADMIN_READ_SCOPES, profile);
70
+ const plan = await ga4.planBigQueryLink(auth, propertyId, opts);
76
71
  return jsonResult(plan);
77
72
  });
78
73
  server.tool('ga4_create_bigquery_link', 'GA4 → BigQuery export 링크 생성. confirm 생략/false 시 읽기 전용 계획만 반환하고, confirm: true 일 때만 계획을 재검사한 뒤 생성한다. 기존 링크가 있으면 no-op.', {
79
74
  ...bigQueryLinkSchema,
80
75
  confirm: z.boolean().optional().describe('true 명시 시에만 원격 링크 생성. 생략/false 면 계획만 반환'),
81
- }, async ({ propertyId, projectId, datasetLocation, dailyExportEnabled, streamingExportEnabled, freshDailyExportEnabled, includeAdvertisingId, confirm }) => {
82
- const auth = await requireAuth(ga4Raw.GA4_SCOPE);
83
- const opts = {
84
- projectId,
85
- datasetLocation,
86
- dailyExportEnabled,
87
- streamingExportEnabled,
88
- freshDailyExportEnabled,
89
- includeAdvertisingId,
90
- };
76
+ }, async ({ propertyId, profile, confirm, ...opts }) => {
77
+ const auth = await requireAuth(confirm ? ga4Raw.GA4_SCOPE : ga4Raw.GA4_ADMIN_READ_SCOPES, profile);
91
78
  const result = confirm
92
79
  ? await ga4.createBigQueryLink(auth, propertyId, opts)
93
80
  : { preview: true, ...(await ga4.planBigQueryLink(auth, propertyId, opts)) };
94
81
  return jsonResult(result);
95
82
  });
96
- server.tool('ga4_run_report', 'GA4 Data API 리포트 (활성 사용자·이벤트 등). dimensions/metrics 는 쉼표 구분 GA4 API 이름.', {
83
+ server.tool('ga4_run_report', 'GA4 Data API 리포트 (활성 사용자·이벤트 등). 전체 행 수(rowCount)와 현재 페이지를 반환. 페이지 순회는 첫 요청부터 limit 또는 offset: 0을 지정.', {
97
84
  propertyId: z.string().describe(PROPERTY_DESC),
98
85
  startDate: z.string().describe("시작일 (YYYY-MM-DD 또는 'NdaysAgo', 'today')"),
99
86
  endDate: z.string().describe("종료일 (YYYY-MM-DD 또는 'today')"),
100
87
  dimensions: z.string().optional().describe('쉼표 구분 dimension (예: date,country). 생략 시 전체 합계'),
101
88
  metrics: z.string().optional().describe('쉼표 구분 metric (기본 activeUsers,eventCount)'),
102
- }, async ({ propertyId, startDate, endDate, dimensions, metrics }) => {
103
- // Data API 는 analytics.readonly 를 요구한다 — Admin 스코프로 검사하면 통과시켜 놓고 403 이 난다
104
- const auth = await requireAuth(ga4Raw.GA4_DATA_SCOPE);
89
+ limit: z.number().int().min(1).max(ga4Raw.GA4_REPORT_MAX_LIMIT).optional()
90
+ .describe(`페이지 크기 (기본 10000, 최대 ${ga4Raw.GA4_REPORT_MAX_LIMIT})`),
91
+ offset: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional()
92
+ .describe('조회 시작 행의 0부터 세는 위치 (기본 0)'),
93
+ profile,
94
+ }, async ({ propertyId, startDate, endDate, dimensions, metrics, limit, offset, profile }) => {
95
+ const auth = await requireAuth(ga4Raw.GA4_REPORT_SCOPES, profile);
105
96
  const report = await ga4.runReport(auth, propertyId, {
106
97
  startDate,
107
98
  endDate,
108
99
  dimensions: dimensions ? dimensions.split(',').map((d) => d.trim()).filter(Boolean) : undefined,
109
100
  metrics: metrics ? metrics.split(',').map((m) => m.trim()).filter(Boolean) : undefined,
101
+ limit,
102
+ offset,
110
103
  });
111
104
  return jsonResult(report);
112
105
  });
@@ -1,71 +1,72 @@
1
1
  import { z } from 'zod';
2
+ import { GOOGLE_PROFILE_ID } from '../auth/google-auth.js';
3
+ import { GSC_READ_SCOPES, GSC_WRITE_SCOPE } from '../auth/scopes.js';
2
4
  import { requireAuth } from '../helpers.js';
3
5
  import * as gsc from '../gsc/tools.js';
4
6
  import { jsonResult, textResult } from '../lib/mcp-response.js';
5
7
  const SITE_URL_DESC = "Search Console 속성 식별자. 도메인 속성은 'sc-domain:example.com', URL 접두어 속성은 'https://example.com/' 형식.";
8
+ const googleProfile = z.string().regex(GOOGLE_PROFILE_ID).optional().describe('Google 로그인 프로필. 생략하면 기본 계정을 사용.');
6
9
  export function registerGscTools(server) {
7
- server.tool('gsc_list_sites', 'Search Console에 등록된(권한 있는) 속성 목록 + 권한 레벨 조회. siteUrl 값을 확인할 때 먼저 호출.', {}, async () => {
8
- const auth = await requireAuth();
10
+ server.tool('gsc_list_sites', 'Search Console에 등록된(권한 있는) 속성 목록 + 권한 레벨 조회. siteUrl 값을 확인할 때 먼저 호출.', { profile: googleProfile }, async ({ profile }) => {
11
+ const auth = await requireAuth(GSC_READ_SCOPES, profile);
9
12
  const sites = await gsc.listSites(auth);
10
13
  return jsonResult(sites);
11
14
  });
12
- server.tool('gsc_list_sitemaps', '속성에 제출된 사이트맵 목록 (마지막 다운로드 시각, 경고/오류 수, submitted/indexed 카운트). ⚠️ 사이트맵 리포트의 indexed 수치는 신뢰도 낮음 — 실제 색인 여부는 gsc_inspect_url 로 확인.', {
15
+ server.tool('gsc_list_sitemaps', '속성에 제출된 사이트맵 목록 (URL 제출 수, 마지막 다운로드 시각, 경고/오류 수). URL별 색인 상태는 gsc_inspect_url로 조회.', {
13
16
  siteUrl: z.string().describe(SITE_URL_DESC),
14
17
  sitemapIndex: z.string().optional().describe('사이트맵 인덱스 URL — 인덱스 하위 사이트맵만 보고 싶을 때'),
15
- }, async ({ siteUrl, sitemapIndex }) => {
16
- const auth = await requireAuth();
18
+ profile: googleProfile,
19
+ }, async ({ siteUrl, sitemapIndex, profile }) => {
20
+ const auth = await requireAuth(GSC_READ_SCOPES, profile);
17
21
  const sitemaps = await gsc.listSitemaps(auth, siteUrl, sitemapIndex);
18
22
  return jsonResult(sitemaps);
19
23
  });
20
- server.tool('gsc_get_sitemap', '특정 사이트맵 1개의 상세(타입별 submitted/indexed, 경고/오류, 처리 시각) 조회.', {
24
+ server.tool('gsc_get_sitemap', '특정 사이트맵 1개의 상세 조회 (유형별 URL 제출 수, 경고/오류, 처리 시각).', {
21
25
  siteUrl: z.string().describe(SITE_URL_DESC),
22
26
  feedpath: z.string().describe('사이트맵 전체 URL (예: https://example.com/sitemap.xml)'),
23
- }, async ({ siteUrl, feedpath }) => {
24
- const auth = await requireAuth();
27
+ profile: googleProfile,
28
+ }, async ({ siteUrl, feedpath, profile }) => {
29
+ const auth = await requireAuth(GSC_READ_SCOPES, profile);
25
30
  const sitemap = await gsc.getSitemap(auth, siteUrl, feedpath);
26
31
  return jsonResult(sitemap);
27
32
  });
28
- server.tool('gsc_submit_sitemap', '사이트맵을 Search Console에 제출(또는 재제출)해 재크롤을 유도. webmasters read-write 스코프 필요.', {
33
+ server.tool('gsc_submit_sitemap', '사이트맵을 Search Console에 제출하거나 재제출. webmasters 쓰기 권한 필요.', {
29
34
  siteUrl: z.string().describe(SITE_URL_DESC),
30
35
  feedpath: z.string().describe('제출할 사이트맵 전체 URL (예: https://example.com/sitemap.xml)'),
31
- }, async ({ siteUrl, feedpath }) => {
32
- const auth = await requireAuth();
36
+ profile: googleProfile,
37
+ }, async ({ siteUrl, feedpath, profile }) => {
38
+ const auth = await requireAuth(GSC_WRITE_SCOPE, profile);
33
39
  const result = await gsc.submitSitemap(auth, siteUrl, feedpath);
34
- return textResult(`✅ 사이트맵 제출 완료.\n ${result.submitted}\n\n반영까지 수 분~수 시간 걸려. gsc_list_sitemaps 로 lastDownloaded 갱신을 확인해.`);
40
+ return textResult(`✅ 사이트맵 제출 완료.\n ${result.submitted}\n\n처리 상태는 gsc_get_sitemap으로 확인해.`);
35
41
  });
36
- server.tool('gsc_inspect_url', 'URL 1개의 실제 색인 상태 검사 (coverageState, robots.txt 허용 여부, 마지막 크롤 시각, 정규 URL, 리치 결과). 사이트맵 리포트보다 정확한 색인 진단의 단일 출처.', {
42
+ server.tool('gsc_inspect_url', 'Google 색인에 기록된 URL 1개의 상태 조회 (coverageState, robots.txt, 마지막 크롤 시각, 정규 URL, 리치 결과).', {
37
43
  siteUrl: z.string().describe(SITE_URL_DESC),
38
44
  inspectionUrl: z.string().describe("검사할 전체 URL — 반드시 siteUrl 속성 하위여야 함 (예: 'https://example.com/page')"),
39
45
  languageCode: z.string().optional().describe("이슈 메시지 언어 (BCP-47, 예: 'ko', 'en-US'). 기본 en-US"),
40
- }, async ({ siteUrl, inspectionUrl, languageCode }) => {
41
- const auth = await requireAuth();
46
+ profile: googleProfile,
47
+ }, async ({ siteUrl, inspectionUrl, languageCode, profile }) => {
48
+ const auth = await requireAuth(GSC_READ_SCOPES, profile);
42
49
  const result = await gsc.inspectUrl(auth, siteUrl, inspectionUrl, languageCode ?? 'en-US');
43
50
  return jsonResult(result);
44
51
  });
45
- server.tool('gsc_search_analytics', '검색 성과 데이터 조회 (클릭·노출·CTR·평균순위). dimensions로 query/page/country/device/date/searchAppearance 별 분해. 요약(가중 평균순위 포함) + rows 반환.', {
52
+ server.tool('gsc_search_analytics', 'Google 검색 성과 조회. 분해 결과의 rowSummary는 현재 페이지 소계이며 상세 행 일부는 Google에서 생략할 수 있음. 전체 집계는 summary로 반환.', {
46
53
  siteUrl: z.string().describe(SITE_URL_DESC),
47
- startDate: z.string().describe('시작일 (YYYY-MM-DD)'),
48
- endDate: z.string().describe('종료일 (YYYY-MM-DD)'),
49
- dimensions: z.string().optional().describe('쉼표 구분 분해 차원: query,page,country,device,date,searchAppearance (생략 시 전체 합계)'),
50
- rowLimit: z.number().int().min(1).max(25000).optional().describe('최대 행 수 (기본 1000, 최대 25000)'),
51
- type: z.enum(['web', 'image', 'video', 'news', 'discover', 'googleNews']).optional().describe('검색 유형 필터 (기본 web)'),
52
- }, async ({ siteUrl, startDate, endDate, dimensions, rowLimit, type }) => {
53
- const auth = await requireAuth();
54
- const dims = dimensions
55
- ? dimensions.split(',').map((d) => d.trim()).filter(Boolean)
56
- : undefined;
57
- const rows = await gsc.searchAnalytics(auth, siteUrl, {
58
- startDate,
59
- endDate,
60
- dimensions: dims,
61
- rowLimit,
62
- type,
63
- });
64
- return jsonResult({
65
- period: { startDate, endDate },
66
- dimensions: dims ?? [],
67
- summary: gsc.summarizeRows(rows),
68
- rows,
69
- });
54
+ startDate: z.iso.date().describe('시작일 (YYYY-MM-DD, 미국 태평양 시간 기준, 포함)'),
55
+ endDate: z.iso.date().describe('종료일 (YYYY-MM-DD, 미국 태평양 시간 기준, 포함)'),
56
+ dimensions: z.string().optional().describe('쉼표 구분 분해 차원 (예: query,page,country,device,date,searchAppearance). 생략 시 집계.'),
57
+ rowLimit: z.number().int().min(1).max(25000).optional().describe('분해 조회의 페이지당 최대 행 수. 기본 1000.'),
58
+ startRow: z.number().int().nonnegative().optional().describe('분해 조회 시작 위치. 기본 0. 다음 페이지는 pagination.nextStartRow 사용. 클릭 수가 같은 행의 순서는 Google이 보장하지 않음.'),
59
+ type: z.enum(gsc.SEARCH_TYPES).optional().describe('검색 유형 (기본 web)'),
60
+ filters: z.array(z.strictObject({
61
+ dimension: z.enum(gsc.SEARCH_FILTER_DIMENSIONS),
62
+ operator: z.enum(gsc.SEARCH_FILTER_OPERATORS).optional().describe('기본 equals'),
63
+ expression: z.string().min(1).max(4096),
64
+ })).optional().describe('Google에 전달할 필터. 모든 조건이 일치하는 데이터만 집계.'),
65
+ summaryOnly: z.boolean().optional().describe('true면 분해·페이지 옵션을 무시하고 집계만 반환. 필터는 적용.'),
66
+ includeTotals: z.boolean().optional().describe('true면 분해 조회에 같은 기간·필터의 Google 집계를 추가. API 호출 1회 추가.'),
67
+ profile: googleProfile,
68
+ }, async ({ siteUrl, profile, ...params }) => {
69
+ const auth = await requireAuth(GSC_READ_SCOPES, profile);
70
+ return jsonResult(await gsc.searchAnalytics(auth, siteUrl, params));
70
71
  });
71
72
  }
package/dist/resources.js CHANGED
@@ -1,7 +1,10 @@
1
+ import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { resolveLang } from '#core/lang.js';
1
3
  import { ensureFreshAccessToken } from './auth/google-auth.js';
2
4
  import { readPackageRootText, readToolManifest } from './lib/package-root.js';
3
5
  import { buildToolIndex } from './lib/tool-registrar.js';
4
- import { resolveToolsets, TOOLSETS_ENV, TOOLSETS_EXCLUDE_ENV } from './lib/toolsets.js';
6
+ import { resolveToolsets, TOOL_NAMES_ENV, TOOLSETS_ENV, TOOLSETS_EXCLUDE_ENV } from './lib/toolsets.js';
7
+ import { buildToolMenu, formatToolMenu, selectToolMenu, TOOL_MENU_URI, TOOL_SELECTION_URI } from './lib/tool-menu.js';
5
8
  // assets/agent-guide.md = docs/agent-guide.md 의 배포용 사본 (npm 배포본에는 docs/ 가 없다).
6
9
  // 갱신은 `npm run plugin:sync`, 드리프트는 prompts-resources.test.ts 가 잡는다.
7
10
  // 읽기 실패는 정상 설치에서 불가능하다(files 화이트리스트에 포함) — 그래서 폴백은 가이드
@@ -59,8 +62,8 @@ export function buildToolCatalog(manifest, selection) {
59
62
  include: selection.include,
60
63
  exclude: selection.exclude,
61
64
  note: selection.all
62
- ? `모든 도메인이 켜져 있습니다. ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} 로 줄일 수 있습니다.`
63
- : `${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} 로 제한된 서버입니다 — 여기 없는 도구는 이 서버에 등록되지 않았습니다 (전체 ${manifest.total}개).`,
65
+ ? `모든 도메인이 켜져 있습니다. ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} 로 줄일 수 있습니다.`
66
+ : `선택된 도구를 보여줍니다 (전체 ${manifest.total}개). ${TOOLSETS_ENV} / ${TOOLSETS_EXCLUDE_ENV} / ${TOOL_NAMES_ENV} 설정을 반영합니다.`,
64
67
  },
65
68
  legend: {
66
69
  total: '이 서버에 등록된 도구 수 (폐기 예정 별칭 포함) = tools/list 길이. manifestTotal 은 toolset 제한 없는 전체.',
@@ -75,6 +78,22 @@ export function buildToolCatalog(manifest, selection) {
75
78
  };
76
79
  }
77
80
  export function registerResources(server, options = {}) {
81
+ const getToolMenu = (lang) => {
82
+ const manifest = options.manifest ?? readToolManifest();
83
+ const selection = options.toolsets ?? resolveToolsets(process.env, manifest);
84
+ return buildToolMenu(manifest, selection, lang);
85
+ };
86
+ server.resource('tools-menu', TOOL_MENU_URI, { description: '사용할 서비스 다중 선택용 텍스트 목록', mimeType: 'text/plain' }, async () => {
87
+ const lang = resolveLang();
88
+ return { contents: [{ uri: TOOL_MENU_URI, mimeType: 'text/plain', text: formatToolMenu(getToolMenu(lang), lang) }] };
89
+ });
90
+ server.resource('tools-menu-selection', new ResourceTemplate(TOOL_SELECTION_URI, { list: undefined }), { description: '쉼표로 구분한 서비스 ID의 정식 도구 이름', mimeType: 'application/json' }, async (uri, { areas }) => {
91
+ const input = Array.isArray(areas) ? areas.join(',') : (areas ?? '');
92
+ const selected = selectToolMenu(getToolMenu(resolveLang()), decodeURIComponent(input));
93
+ if (!selected)
94
+ throw new Error('Unknown service selection. Read mimi-seed://tools/menu for available services.');
95
+ return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(selected) }] };
96
+ });
78
97
  server.resource('auth-status', 'mimi-seed://auth/status', { description: 'Google OAuth 인증 상태 — fresh / refreshed / expired / unauthenticated', mimeType: 'application/json' }, async () => {
79
98
  const r = await ensureFreshAccessToken();
80
99
  const ok = r.status === 'fresh' || r.status === 'refreshed';
package/dist/server.js CHANGED
@@ -43,6 +43,7 @@ export function buildServer(version, options = {}) {
43
43
  }, {
44
44
  instructions: [
45
45
  'Mimi Seed manages app stores, cloud services, CI, social publishing, and media. Use the client’s tool discovery to load only the active tools needed for the current step.',
46
+ 'If the user starts Mimi Seed without a specific task, show mimi-seed://tools/menu and let them choose one or more services by number, name, or free-form description. Read mimi-seed://tools/menu/{areas} for the selected comma-separated service IDs before loading tools for the task.',
46
47
  'For a targeted read, start with the domain tool. Use mimi_seed_status for onboarding, connection diagnostics, or unresolved authentication errors.',
47
48
  'For preview-gated writes, get the preview and explicit approval before confirming the same operation.',
48
49
  ].join(' '),
@@ -79,7 +80,7 @@ export function buildServer(version, options = {}) {
79
80
  registerYouTubeTools(registrar);
80
81
  registerTikTokBusinessTools(registrar);
81
82
  registerDriveTools(registrar);
82
- registerPrompts(server, toolsets);
83
+ registerPrompts(server, toolsets, manifest);
83
84
  registerResources(server, { manifest, toolsets });
84
85
  return server;
85
86
  }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ import { createInterface } from 'node:readline';
3
+ import { resolveLang } from '#core/lang.js';
4
+ import { printJson } from './lib/cli-args.js';
5
+ import { readToolManifest } from './lib/package-root.js';
6
+ import { buildToolMenu, formatToolMenu, selectToolMenu } from './lib/tool-menu.js';
7
+ import { resolveToolsets } from './lib/toolsets.js';
8
+ async function main(args) {
9
+ const lang = resolveLang();
10
+ const help = 'mimi-seed tools [--select <areas>]';
11
+ if (args.length === 1 && ['--help', '-h'].includes(args[0])) {
12
+ console.log(help);
13
+ return;
14
+ }
15
+ if (args.length > 0 && (args.length !== 2 || args[0] !== '--select'))
16
+ throw new Error(help);
17
+ const manifest = readToolManifest();
18
+ const selection = resolveToolsets(process.env, manifest);
19
+ for (const warning of selection.warnings)
20
+ console.error(warning);
21
+ const menu = buildToolMenu(manifest, selection, lang);
22
+ const invalid = lang === 'ko'
23
+ ? '목록에서 고른 번호 또는 서비스 ID를 쉼표로 구분해 입력하세요.'
24
+ : 'Enter menu numbers or service IDs separated by commas.';
25
+ if (args.length === 2) {
26
+ const selected = selectToolMenu(menu, args[1]);
27
+ if (!selected)
28
+ throw new Error(invalid);
29
+ await printJson(selected);
30
+ return;
31
+ }
32
+ console.log(formatToolMenu(menu, lang));
33
+ if (!process.stdin.isTTY || !process.stdout.isTTY || process.env.CI)
34
+ return;
35
+ const readline = createInterface({ input: process.stdin, output: process.stdout });
36
+ readline.setPrompt(lang === 'ko' ? '번호 또는 ID (예 1,2) > ' : 'Numbers or IDs (e.g. 1,2) > ');
37
+ readline.on('SIGINT', () => readline.close());
38
+ try {
39
+ readline.prompt();
40
+ for await (const line of readline) {
41
+ if (!line.trim())
42
+ return;
43
+ const selected = selectToolMenu(menu, line);
44
+ if (selected) {
45
+ await printJson(selected);
46
+ return;
47
+ }
48
+ console.error(invalid);
49
+ readline.prompt();
50
+ }
51
+ }
52
+ finally {
53
+ readline.close();
54
+ }
55
+ }
56
+ void main(process.argv.slice(2)).catch((error) => {
57
+ console.error(error instanceof Error ? error.message : String(error));
58
+ process.exitCode = 1;
59
+ });
@@ -5,9 +5,9 @@ export declare const aspectRatioSchema: z.ZodEnum<{
5
5
  "1:1": "1:1";
6
6
  }>;
7
7
  export declare const assetKindSchema: z.ZodEnum<{
8
+ video: "video";
8
9
  image: "image";
9
10
  audio: "audio";
10
- video: "video";
11
11
  }>;
12
12
  export declare const assetSourceSchema: z.ZodEnum<{
13
13
  stock: "stock";
@@ -55,9 +55,9 @@ export declare const projectSchema: z.ZodObject<{
55
55
  export declare const assetSchema: z.ZodObject<{
56
56
  id: z.ZodString;
57
57
  kind: z.ZodEnum<{
58
+ video: "video";
58
59
  image: "image";
59
60
  audio: "audio";
60
- video: "video";
61
61
  }>;
62
62
  sourceType: z.ZodEnum<{
63
63
  stock: "stock";
@@ -83,9 +83,9 @@ export declare const assetManifestSchema: z.ZodObject<{
83
83
  assets: z.ZodArray<z.ZodObject<{
84
84
  id: z.ZodString;
85
85
  kind: z.ZodEnum<{
86
+ video: "video";
86
87
  image: "image";
87
88
  audio: "audio";
88
- video: "video";
89
89
  }>;
90
90
  sourceType: z.ZodEnum<{
91
91
  stock: "stock";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoonion/mimi-seed-mcp",
3
- "version": "0.23.3",
3
+ "version": "0.24.0",
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": {
@@ -20,6 +20,7 @@
20
20
  "mimi-seed-firebase": "dist/firebase/cli.js",
21
21
  "mimi-seed-admob": "dist/admob/cli.js",
22
22
  "mimi-seed-ga4": "dist/ga4/cli.js",
23
+ "mimi-seed-tools": "dist/tools-cli.js",
23
24
  "mimi-seed-release-doctor": "dist/checks/release-doctor-cli.js"
24
25
  },
25
26
  "files": [