@yoonion/mimi-seed-mcp 0.3.33 → 0.3.35
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/LICENSE +75 -75
- package/dist/auth/google-auth.js +8 -7
- package/dist/googleads/tools.js +54 -54
- package/dist/gsc/tools.d.ts +39 -0
- package/dist/gsc/tools.js +68 -0
- package/dist/index.js +2 -0
- package/dist/playstore/tools.js +8 -0
- package/dist/registers/gsc.d.ts +2 -0
- package/dist/registers/gsc.js +80 -0
- package/dist/registers/playstore.js +59 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
# PolyForm Noncommercial License 1.0.0
|
|
2
|
-
|
|
3
|
-
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
-
|
|
5
|
-
Required Notice: Copyright 2026 Pryzm GG (https://mimi-seed.pryzm.gg)
|
|
6
|
-
|
|
7
|
-
## Acceptance
|
|
8
|
-
|
|
9
|
-
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
-
|
|
11
|
-
## Copyright License
|
|
12
|
-
|
|
13
|
-
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
-
|
|
15
|
-
## Distribution License
|
|
16
|
-
|
|
17
|
-
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
-
|
|
19
|
-
## Notices
|
|
20
|
-
|
|
21
|
-
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
-
|
|
23
|
-
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
-
|
|
25
|
-
## Changes and New Works License
|
|
26
|
-
|
|
27
|
-
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
-
|
|
29
|
-
## Patent License
|
|
30
|
-
|
|
31
|
-
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
-
|
|
33
|
-
## Noncommercial Purposes
|
|
34
|
-
|
|
35
|
-
Any noncommercial purpose is a permitted purpose.
|
|
36
|
-
|
|
37
|
-
## Personal Uses
|
|
38
|
-
|
|
39
|
-
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
-
|
|
41
|
-
## Noncommercial Organizations
|
|
42
|
-
|
|
43
|
-
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
-
|
|
45
|
-
## Fair Use
|
|
46
|
-
|
|
47
|
-
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
-
|
|
49
|
-
## No Other Rights
|
|
50
|
-
|
|
51
|
-
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
-
|
|
53
|
-
## Patent Defense
|
|
54
|
-
|
|
55
|
-
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
-
|
|
57
|
-
## Violations
|
|
58
|
-
|
|
59
|
-
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
-
|
|
61
|
-
## No Liability
|
|
62
|
-
|
|
63
|
-
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
64
|
-
|
|
65
|
-
## Definitions
|
|
66
|
-
|
|
67
|
-
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
-
|
|
69
|
-
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
-
|
|
71
|
-
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
-
|
|
73
|
-
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
-
|
|
75
|
-
**Use** means anything you do with the software requiring one of your licenses.
|
|
1
|
+
# PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
Required Notice: Copyright 2026 Pryzm GG (https://mimi-seed.pryzm.gg)
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncommercial Purposes
|
|
34
|
+
|
|
35
|
+
Any noncommercial purpose is a permitted purpose.
|
|
36
|
+
|
|
37
|
+
## Personal Uses
|
|
38
|
+
|
|
39
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
+
|
|
41
|
+
## Noncommercial Organizations
|
|
42
|
+
|
|
43
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
+
|
|
45
|
+
## Fair Use
|
|
46
|
+
|
|
47
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
+
|
|
49
|
+
## No Other Rights
|
|
50
|
+
|
|
51
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
+
|
|
53
|
+
## Patent Defense
|
|
54
|
+
|
|
55
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
+
|
|
57
|
+
## Violations
|
|
58
|
+
|
|
59
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
+
|
|
61
|
+
## No Liability
|
|
62
|
+
|
|
63
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
64
|
+
|
|
65
|
+
## Definitions
|
|
66
|
+
|
|
67
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
+
|
|
69
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
+
|
|
71
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
+
|
|
73
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
+
|
|
75
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/dist/auth/google-auth.js
CHANGED
|
@@ -13,6 +13,7 @@ const SCOPES = [
|
|
|
13
13
|
'https://www.googleapis.com/auth/admob.monetization',
|
|
14
14
|
'https://www.googleapis.com/auth/androidpublisher',
|
|
15
15
|
'https://www.googleapis.com/auth/adwords', // Google Ads API (googleads_* tools)
|
|
16
|
+
'https://www.googleapis.com/auth/webmasters', // Search Console API (gsc_* tools, 사이트맵 제출 포함)
|
|
16
17
|
];
|
|
17
18
|
// Primary config dir. Legacy `~/.preseed` is read as a fallback during the
|
|
18
19
|
// rebrand so existing auth sessions don't force a re-login; new writes go to
|
|
@@ -211,13 +212,13 @@ export function startAuth(clientId, clientSecret, options = {}) {
|
|
|
211
212
|
};
|
|
212
213
|
saveTokens(stored);
|
|
213
214
|
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
|
214
|
-
res.end(`
|
|
215
|
-
<html><body style="font-family:system-ui;display:flex;justify-content:center;align-items:center;height:100vh;margin:0">
|
|
216
|
-
<div style="text-align:center">
|
|
217
|
-
<h1>✅ Mimi Seed 인증 완료!</h1>
|
|
218
|
-
<p>이 창을 닫고 Claude Code 또는 Codex로 돌아가세요.</p>
|
|
219
|
-
</div>
|
|
220
|
-
</body></html>
|
|
215
|
+
res.end(`
|
|
216
|
+
<html><body style="font-family:system-ui;display:flex;justify-content:center;align-items:center;height:100vh;margin:0">
|
|
217
|
+
<div style="text-align:center">
|
|
218
|
+
<h1>✅ Mimi Seed 인증 완료!</h1>
|
|
219
|
+
<p>이 창을 닫고 Claude Code 또는 Codex로 돌아가세요.</p>
|
|
220
|
+
</div>
|
|
221
|
+
</body></html>
|
|
221
222
|
`);
|
|
222
223
|
server.close();
|
|
223
224
|
activeAuthServer = null;
|
package/dist/googleads/tools.js
CHANGED
|
@@ -84,20 +84,20 @@ export async function listAccessibleCustomers(auth, cfg) {
|
|
|
84
84
|
}
|
|
85
85
|
// ─── 캠페인 목록 ─────────────────────────────────────────────
|
|
86
86
|
export async function listCampaigns(auth, cfg) {
|
|
87
|
-
const query = `
|
|
88
|
-
SELECT
|
|
89
|
-
campaign.id,
|
|
90
|
-
campaign.name,
|
|
91
|
-
campaign.status,
|
|
92
|
-
campaign.advertising_channel_type,
|
|
93
|
-
campaign.advertising_channel_sub_type,
|
|
94
|
-
campaign.start_date,
|
|
95
|
-
campaign.end_date,
|
|
96
|
-
campaign_budget.amount_micros
|
|
97
|
-
FROM campaign
|
|
98
|
-
WHERE campaign.status != 'REMOVED'
|
|
99
|
-
ORDER BY campaign.name ASC
|
|
100
|
-
LIMIT 200
|
|
87
|
+
const query = `
|
|
88
|
+
SELECT
|
|
89
|
+
campaign.id,
|
|
90
|
+
campaign.name,
|
|
91
|
+
campaign.status,
|
|
92
|
+
campaign.advertising_channel_type,
|
|
93
|
+
campaign.advertising_channel_sub_type,
|
|
94
|
+
campaign.start_date,
|
|
95
|
+
campaign.end_date,
|
|
96
|
+
campaign_budget.amount_micros
|
|
97
|
+
FROM campaign
|
|
98
|
+
WHERE campaign.status != 'REMOVED'
|
|
99
|
+
ORDER BY campaign.name ASC
|
|
100
|
+
LIMIT 200
|
|
101
101
|
`;
|
|
102
102
|
const rows = await search(auth, cfg, query);
|
|
103
103
|
return rows.map((r) => ({
|
|
@@ -113,26 +113,26 @@ export async function listCampaigns(auth, cfg) {
|
|
|
113
113
|
}
|
|
114
114
|
// ─── 캠페인 성과 리포트 ────────────────────────────────────────
|
|
115
115
|
export async function getCampaignReport(auth, cfg, range) {
|
|
116
|
-
const query = `
|
|
117
|
-
SELECT
|
|
118
|
-
campaign.id,
|
|
119
|
-
campaign.name,
|
|
120
|
-
campaign.status,
|
|
121
|
-
campaign.advertising_channel_type,
|
|
122
|
-
campaign.advertising_channel_sub_type,
|
|
123
|
-
metrics.clicks,
|
|
124
|
-
metrics.impressions,
|
|
125
|
-
metrics.cost_micros,
|
|
126
|
-
metrics.conversions,
|
|
127
|
-
metrics.conversions_value,
|
|
128
|
-
metrics.cost_per_conversion,
|
|
129
|
-
metrics.ctr,
|
|
130
|
-
metrics.average_cpc
|
|
131
|
-
FROM campaign
|
|
132
|
-
WHERE campaign.status != 'REMOVED'
|
|
133
|
-
AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
|
|
134
|
-
ORDER BY metrics.cost_micros DESC
|
|
135
|
-
LIMIT 500
|
|
116
|
+
const query = `
|
|
117
|
+
SELECT
|
|
118
|
+
campaign.id,
|
|
119
|
+
campaign.name,
|
|
120
|
+
campaign.status,
|
|
121
|
+
campaign.advertising_channel_type,
|
|
122
|
+
campaign.advertising_channel_sub_type,
|
|
123
|
+
metrics.clicks,
|
|
124
|
+
metrics.impressions,
|
|
125
|
+
metrics.cost_micros,
|
|
126
|
+
metrics.conversions,
|
|
127
|
+
metrics.conversions_value,
|
|
128
|
+
metrics.cost_per_conversion,
|
|
129
|
+
metrics.ctr,
|
|
130
|
+
metrics.average_cpc
|
|
131
|
+
FROM campaign
|
|
132
|
+
WHERE campaign.status != 'REMOVED'
|
|
133
|
+
AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
|
|
134
|
+
ORDER BY metrics.cost_micros DESC
|
|
135
|
+
LIMIT 500
|
|
136
136
|
`;
|
|
137
137
|
const rows = await search(auth, cfg, query);
|
|
138
138
|
return rows.map((r) => ({
|
|
@@ -153,26 +153,26 @@ export async function getCampaignReport(auth, cfg, range) {
|
|
|
153
153
|
}
|
|
154
154
|
// ─── UAC(앱 캠페인) 리포트 ─────────────────────────────────────
|
|
155
155
|
export async function getUacReport(auth, cfg, range) {
|
|
156
|
-
const query = `
|
|
157
|
-
SELECT
|
|
158
|
-
campaign.id,
|
|
159
|
-
campaign.name,
|
|
160
|
-
campaign.status,
|
|
161
|
-
campaign.advertising_channel_sub_type,
|
|
162
|
-
metrics.clicks,
|
|
163
|
-
metrics.impressions,
|
|
164
|
-
metrics.cost_micros,
|
|
165
|
-
metrics.conversions,
|
|
166
|
-
metrics.conversions_value,
|
|
167
|
-
metrics.cost_per_conversion,
|
|
168
|
-
metrics.ctr,
|
|
169
|
-
segments.date
|
|
170
|
-
FROM campaign
|
|
171
|
-
WHERE campaign.advertising_channel_type = 'MULTI_CHANNEL'
|
|
172
|
-
AND campaign.advertising_channel_sub_type IN ('APP_CAMPAIGN', 'APP_CAMPAIGN_FOR_ENGAGEMENT', 'APP_CAMPAIGN_FOR_PRE_REGISTRATION')
|
|
173
|
-
AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
|
|
174
|
-
ORDER BY segments.date DESC, metrics.cost_micros DESC
|
|
175
|
-
LIMIT 500
|
|
156
|
+
const query = `
|
|
157
|
+
SELECT
|
|
158
|
+
campaign.id,
|
|
159
|
+
campaign.name,
|
|
160
|
+
campaign.status,
|
|
161
|
+
campaign.advertising_channel_sub_type,
|
|
162
|
+
metrics.clicks,
|
|
163
|
+
metrics.impressions,
|
|
164
|
+
metrics.cost_micros,
|
|
165
|
+
metrics.conversions,
|
|
166
|
+
metrics.conversions_value,
|
|
167
|
+
metrics.cost_per_conversion,
|
|
168
|
+
metrics.ctr,
|
|
169
|
+
segments.date
|
|
170
|
+
FROM campaign
|
|
171
|
+
WHERE campaign.advertising_channel_type = 'MULTI_CHANNEL'
|
|
172
|
+
AND campaign.advertising_channel_sub_type IN ('APP_CAMPAIGN', 'APP_CAMPAIGN_FOR_ENGAGEMENT', 'APP_CAMPAIGN_FOR_PRE_REGISTRATION')
|
|
173
|
+
AND segments.date BETWEEN '${range.startDate}' AND '${range.endDate}'
|
|
174
|
+
ORDER BY segments.date DESC, metrics.cost_micros DESC
|
|
175
|
+
LIMIT 500
|
|
176
176
|
`;
|
|
177
177
|
const rows = await search(auth, cfg, query);
|
|
178
178
|
const byId = new Map();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { OAuth2Client } from 'google-auth-library';
|
|
2
|
+
export type GscAuth = OAuth2Client;
|
|
3
|
+
export declare function listSites(auth: GscAuth): Promise<import("googleapis").searchconsole_v1.Schema$WmxSite[]>;
|
|
4
|
+
export declare function listSitemaps(auth: GscAuth, siteUrl: string, sitemapIndex?: string): Promise<import("googleapis").searchconsole_v1.Schema$WmxSitemap[]>;
|
|
5
|
+
export declare function getSitemap(auth: GscAuth, siteUrl: string, feedpath: string): Promise<import("googleapis").searchconsole_v1.Schema$WmxSitemap>;
|
|
6
|
+
/** 사이트맵 제출 — webmasters(read-write) 스코프 필요. 응답 본문은 없음(204). */
|
|
7
|
+
export declare function submitSitemap(auth: GscAuth, siteUrl: string, feedpath: string): Promise<{
|
|
8
|
+
submitted: string;
|
|
9
|
+
siteUrl: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function inspectUrl(auth: GscAuth, siteUrl: string, inspectionUrl: string, languageCode?: string): Promise<import("googleapis").searchconsole_v1.Schema$UrlInspectionResult>;
|
|
12
|
+
export interface SearchAnalyticsParams {
|
|
13
|
+
startDate: string;
|
|
14
|
+
endDate: string;
|
|
15
|
+
dimensions?: string[];
|
|
16
|
+
rowLimit?: number;
|
|
17
|
+
startRow?: number;
|
|
18
|
+
type?: 'web' | 'image' | 'video' | 'news' | 'discover' | 'googleNews';
|
|
19
|
+
}
|
|
20
|
+
export declare function searchAnalytics(auth: GscAuth, siteUrl: string, params: SearchAnalyticsParams): Promise<import("googleapis").searchconsole_v1.Schema$ApiDataRow[]>;
|
|
21
|
+
export interface SearchAnalyticsRow {
|
|
22
|
+
keys?: string[] | null;
|
|
23
|
+
clicks?: number | null;
|
|
24
|
+
impressions?: number | null;
|
|
25
|
+
ctr?: number | null;
|
|
26
|
+
position?: number | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Search Analytics rows 요약.
|
|
30
|
+
* position 은 노출수(impressions) 가중 평균으로 집계한다 — 단순 산술평균은
|
|
31
|
+
* 노출이 1인 행과 1000인 행을 동등 취급해 실제 평균 순위를 왜곡한다.
|
|
32
|
+
*/
|
|
33
|
+
export declare function summarizeRows(rows: SearchAnalyticsRow[]): {
|
|
34
|
+
rowCount: number;
|
|
35
|
+
totalClicks: number;
|
|
36
|
+
totalImpressions: number;
|
|
37
|
+
avgCtr: number;
|
|
38
|
+
avgPosition: number;
|
|
39
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { google } from 'googleapis';
|
|
2
|
+
/**
|
|
3
|
+
* Google Search Console (Webmasters) API v1 래퍼.
|
|
4
|
+
*
|
|
5
|
+
* `searchconsole('v1')` 은 구 `webmasters('v3')` 의 후속으로, sites/sitemaps/
|
|
6
|
+
* searchanalytics 에 더해 URL Inspection(`urlInspection.index.inspect`)을 포함한다.
|
|
7
|
+
* 인증은 mimi-seed OAuth 클라이언트(`requireAuth()`)를 그대로 사용 — webmasters 스코프 필요.
|
|
8
|
+
*/
|
|
9
|
+
const sc = () => google.searchconsole('v1');
|
|
10
|
+
// ─── 속성(사이트) 목록 ───
|
|
11
|
+
export async function listSites(auth) {
|
|
12
|
+
const res = await sc().sites.list({ auth });
|
|
13
|
+
return res.data.siteEntry ?? [];
|
|
14
|
+
}
|
|
15
|
+
// ─── 사이트맵 ───
|
|
16
|
+
export async function listSitemaps(auth, siteUrl, sitemapIndex) {
|
|
17
|
+
const res = await sc().sitemaps.list({ auth, siteUrl, sitemapIndex });
|
|
18
|
+
return res.data.sitemap ?? [];
|
|
19
|
+
}
|
|
20
|
+
export async function getSitemap(auth, siteUrl, feedpath) {
|
|
21
|
+
const res = await sc().sitemaps.get({ auth, siteUrl, feedpath });
|
|
22
|
+
return res.data;
|
|
23
|
+
}
|
|
24
|
+
/** 사이트맵 제출 — webmasters(read-write) 스코프 필요. 응답 본문은 없음(204). */
|
|
25
|
+
export async function submitSitemap(auth, siteUrl, feedpath) {
|
|
26
|
+
await sc().sitemaps.submit({ auth, siteUrl, feedpath });
|
|
27
|
+
return { submitted: feedpath, siteUrl };
|
|
28
|
+
}
|
|
29
|
+
// ─── URL 색인 검사 ───
|
|
30
|
+
export async function inspectUrl(auth, siteUrl, inspectionUrl, languageCode = 'en-US') {
|
|
31
|
+
const res = await sc().urlInspection.index.inspect({
|
|
32
|
+
auth,
|
|
33
|
+
requestBody: { siteUrl, inspectionUrl, languageCode },
|
|
34
|
+
});
|
|
35
|
+
return res.data.inspectionResult ?? {};
|
|
36
|
+
}
|
|
37
|
+
export async function searchAnalytics(auth, siteUrl, params) {
|
|
38
|
+
const res = await sc().searchanalytics.query({
|
|
39
|
+
auth,
|
|
40
|
+
siteUrl,
|
|
41
|
+
requestBody: {
|
|
42
|
+
startDate: params.startDate,
|
|
43
|
+
endDate: params.endDate,
|
|
44
|
+
dimensions: params.dimensions,
|
|
45
|
+
rowLimit: params.rowLimit ?? 1000,
|
|
46
|
+
startRow: params.startRow,
|
|
47
|
+
type: params.type,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
return res.data.rows ?? [];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Search Analytics rows 요약.
|
|
54
|
+
* position 은 노출수(impressions) 가중 평균으로 집계한다 — 단순 산술평균은
|
|
55
|
+
* 노출이 1인 행과 1000인 행을 동등 취급해 실제 평균 순위를 왜곡한다.
|
|
56
|
+
*/
|
|
57
|
+
export function summarizeRows(rows) {
|
|
58
|
+
const totalClicks = rows.reduce((s, r) => s + (r.clicks ?? 0), 0);
|
|
59
|
+
const totalImpressions = rows.reduce((s, r) => s + (r.impressions ?? 0), 0);
|
|
60
|
+
const weightedPos = rows.reduce((s, r) => s + (r.position ?? 0) * (r.impressions ?? 0), 0);
|
|
61
|
+
return {
|
|
62
|
+
rowCount: rows.length,
|
|
63
|
+
totalClicks,
|
|
64
|
+
totalImpressions,
|
|
65
|
+
avgCtr: totalImpressions > 0 ? Math.round((totalClicks / totalImpressions) * 10000) / 10000 : 0,
|
|
66
|
+
avgPosition: totalImpressions > 0 ? Math.round((weightedPos / totalImpressions) * 100) / 100 : 0,
|
|
67
|
+
};
|
|
68
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { registerCiTools } from './registers/ci.js';
|
|
|
15
15
|
import { registerInstagramTools } from './registers/instagram.js';
|
|
16
16
|
import { registerFacebookTools } from './registers/facebook.js';
|
|
17
17
|
import { registerGoogleAdsTools } from './registers/googleads.js';
|
|
18
|
+
import { registerGscTools } from './registers/gsc.js';
|
|
18
19
|
import { registerPrompts } from './prompts.js';
|
|
19
20
|
import { registerResources } from './resources.js';
|
|
20
21
|
// dist/index.js 기준 ../package.json — npm 패키지 루트의 버전을 단일 출처로 사용.
|
|
@@ -37,6 +38,7 @@ registerCiTools(server);
|
|
|
37
38
|
registerInstagramTools(server);
|
|
38
39
|
registerFacebookTools(server);
|
|
39
40
|
registerGoogleAdsTools(server);
|
|
41
|
+
registerGscTools(server);
|
|
40
42
|
registerPrompts(server);
|
|
41
43
|
registerResources(server);
|
|
42
44
|
// `npx -y @yoonion/mimi-seed-mcp <subcommand>` 처리.
|
package/dist/playstore/tools.js
CHANGED
|
@@ -59,6 +59,14 @@ export async function withEdit(auth, packageName, fn, commit = false) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
// ─── Play Developer Reporting API / Android vitals ───
|
|
62
|
+
//
|
|
63
|
+
// ⚠️ DRIFT 주의 — getStatistics 의 요청 빌드 규칙(타임존 HOURLY=UTC, errorCount→reportType,
|
|
64
|
+
// userCohort 게이팅, default 차원/metric)은 웹 콘솔 리포의 복제본과 동일해야 합니다:
|
|
65
|
+
// web: src/lib/mcp/tools/play-vitals.ts (buildPlayVitalsRequest)
|
|
66
|
+
// 양쪽 모두 contract 테스트로 잠겨 있음:
|
|
67
|
+
// sdk: src/__tests__/playstore-statistics.test.ts
|
|
68
|
+
// web: src/__tests__/play-vitals.test.ts
|
|
69
|
+
// 규칙 변경 시 양쪽 코드 + 양쪽 테스트를 함께 수정하세요.
|
|
62
70
|
export async function getStatistics(auth, packageName, query) {
|
|
63
71
|
const metricSet = query.metricSet ?? 'anrRate';
|
|
64
72
|
const resource = METRIC_SET_RESOURCE[metricSet];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { requireAuth } from '../helpers.js';
|
|
3
|
+
import * as gsc from '../gsc/tools.js';
|
|
4
|
+
const SITE_URL_DESC = "Search Console 속성 식별자. 도메인 속성은 'sc-domain:example.com', URL 접두어 속성은 'https://example.com/' 형식.";
|
|
5
|
+
export function registerGscTools(server) {
|
|
6
|
+
server.tool('gsc_list_sites', 'Search Console에 등록된(권한 있는) 속성 목록 + 권한 레벨 조회. siteUrl 값을 확인할 때 먼저 호출.', {}, async () => {
|
|
7
|
+
const auth = await requireAuth();
|
|
8
|
+
const sites = await gsc.listSites(auth);
|
|
9
|
+
return { content: [{ type: 'text', text: JSON.stringify(sites, null, 2) }] };
|
|
10
|
+
});
|
|
11
|
+
server.tool('gsc_list_sitemaps', '속성에 제출된 사이트맵 목록 (마지막 다운로드 시각, 경고/오류 수, submitted/indexed 카운트). ⚠️ 사이트맵 리포트의 indexed 수치는 신뢰도 낮음 — 실제 색인 여부는 gsc_inspect_url 로 확인.', {
|
|
12
|
+
siteUrl: z.string().describe(SITE_URL_DESC),
|
|
13
|
+
sitemapIndex: z.string().optional().describe('사이트맵 인덱스 URL — 인덱스 하위 사이트맵만 보고 싶을 때'),
|
|
14
|
+
}, async ({ siteUrl, sitemapIndex }) => {
|
|
15
|
+
const auth = await requireAuth();
|
|
16
|
+
const sitemaps = await gsc.listSitemaps(auth, siteUrl, sitemapIndex);
|
|
17
|
+
return { content: [{ type: 'text', text: JSON.stringify(sitemaps, null, 2) }] };
|
|
18
|
+
});
|
|
19
|
+
server.tool('gsc_get_sitemap', '특정 사이트맵 1개의 상세(타입별 submitted/indexed, 경고/오류, 처리 시각) 조회.', {
|
|
20
|
+
siteUrl: z.string().describe(SITE_URL_DESC),
|
|
21
|
+
feedpath: z.string().describe('사이트맵 전체 URL (예: https://example.com/sitemap.xml)'),
|
|
22
|
+
}, async ({ siteUrl, feedpath }) => {
|
|
23
|
+
const auth = await requireAuth();
|
|
24
|
+
const sitemap = await gsc.getSitemap(auth, siteUrl, feedpath);
|
|
25
|
+
return { content: [{ type: 'text', text: JSON.stringify(sitemap, null, 2) }] };
|
|
26
|
+
});
|
|
27
|
+
server.tool('gsc_submit_sitemap', '사이트맵을 Search Console에 제출(또는 재제출)해 재크롤을 유도. webmasters read-write 스코프 필요.', {
|
|
28
|
+
siteUrl: z.string().describe(SITE_URL_DESC),
|
|
29
|
+
feedpath: z.string().describe('제출할 사이트맵 전체 URL (예: https://example.com/sitemap.xml)'),
|
|
30
|
+
}, async ({ siteUrl, feedpath }) => {
|
|
31
|
+
const auth = await requireAuth();
|
|
32
|
+
const result = await gsc.submitSitemap(auth, siteUrl, feedpath);
|
|
33
|
+
return {
|
|
34
|
+
content: [{
|
|
35
|
+
type: 'text',
|
|
36
|
+
text: `✅ 사이트맵 제출 완료.\n ${result.submitted}\n\n반영까지 수 분~수 시간 걸려. gsc_list_sitemaps 로 lastDownloaded 갱신을 확인해.`,
|
|
37
|
+
}],
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
server.tool('gsc_inspect_url', 'URL 1개의 실제 색인 상태 검사 (coverageState, robots.txt 허용 여부, 마지막 크롤 시각, 정규 URL, 리치 결과). 사이트맵 리포트보다 정확한 색인 진단의 단일 출처.', {
|
|
41
|
+
siteUrl: z.string().describe(SITE_URL_DESC),
|
|
42
|
+
inspectionUrl: z.string().describe("검사할 전체 URL — 반드시 siteUrl 속성 하위여야 함 (예: 'https://example.com/page')"),
|
|
43
|
+
languageCode: z.string().optional().describe("이슈 메시지 언어 (BCP-47, 예: 'ko', 'en-US'). 기본 en-US"),
|
|
44
|
+
}, async ({ siteUrl, inspectionUrl, languageCode }) => {
|
|
45
|
+
const auth = await requireAuth();
|
|
46
|
+
const result = await gsc.inspectUrl(auth, siteUrl, inspectionUrl, languageCode ?? 'en-US');
|
|
47
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
48
|
+
});
|
|
49
|
+
server.tool('gsc_search_analytics', '검색 성과 데이터 조회 (클릭·노출·CTR·평균순위). dimensions로 query/page/country/device/date/searchAppearance 별 분해. 요약(가중 평균순위 포함) + rows 반환.', {
|
|
50
|
+
siteUrl: z.string().describe(SITE_URL_DESC),
|
|
51
|
+
startDate: z.string().describe('시작일 (YYYY-MM-DD)'),
|
|
52
|
+
endDate: z.string().describe('종료일 (YYYY-MM-DD)'),
|
|
53
|
+
dimensions: z.string().optional().describe('쉼표 구분 분해 차원: query,page,country,device,date,searchAppearance (생략 시 전체 합계)'),
|
|
54
|
+
rowLimit: z.number().int().min(1).max(25000).optional().describe('최대 행 수 (기본 1000, 최대 25000)'),
|
|
55
|
+
type: z.enum(['web', 'image', 'video', 'news', 'discover', 'googleNews']).optional().describe('검색 유형 필터 (기본 web)'),
|
|
56
|
+
}, async ({ siteUrl, startDate, endDate, dimensions, rowLimit, type }) => {
|
|
57
|
+
const auth = await requireAuth();
|
|
58
|
+
const dims = dimensions
|
|
59
|
+
? dimensions.split(',').map((d) => d.trim()).filter(Boolean)
|
|
60
|
+
: undefined;
|
|
61
|
+
const rows = await gsc.searchAnalytics(auth, siteUrl, {
|
|
62
|
+
startDate,
|
|
63
|
+
endDate,
|
|
64
|
+
dimensions: dims,
|
|
65
|
+
rowLimit,
|
|
66
|
+
type,
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
content: [{
|
|
70
|
+
type: 'text',
|
|
71
|
+
text: JSON.stringify({
|
|
72
|
+
period: { startDate, endDate },
|
|
73
|
+
dimensions: dims ?? [],
|
|
74
|
+
summary: gsc.summarizeRows(rows),
|
|
75
|
+
rows,
|
|
76
|
+
}, null, 2),
|
|
77
|
+
}],
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -3,7 +3,8 @@ import * as playstoreRaw from '../playstore/tools.js';
|
|
|
3
3
|
import { friendlyPlayError } from '../playstore/errors.js';
|
|
4
4
|
import { saveServiceAccountJsonForPackage, listRegisteredServiceAccounts, deleteServiceAccountJsonForPackage, } from '../auth/playstore-auth.js';
|
|
5
5
|
import { createGoogleOneTimePurchase, createGoogleSubscription, updateGoogleProduct, deleteGoogleProduct, listGoogleProducts, } from '@onesub/providers';
|
|
6
|
-
import { requirePlayStoreAuth, requireServiceAccountJson } from '../helpers.js';
|
|
6
|
+
import { requirePlayStoreAuth, requireServiceAccountJson, requireAuth } from '../helpers.js';
|
|
7
|
+
import * as iam from '../iam/tools.js';
|
|
7
8
|
import { buildPlayStoreReleasePlan } from '../checks/plan.js';
|
|
8
9
|
import { validatePlayReleaseNotes, formatIssuesForUser } from '../lib/text-validators.js';
|
|
9
10
|
// 모든 playstore tools 호출을 친절 에러로 감싸는 프록시 — 403(권한)/404/edit 충돌/
|
|
@@ -607,4 +608,61 @@ export function registerPlaystoreTools(server) {
|
|
|
607
608
|
}
|
|
608
609
|
return { content: [{ type: 'text', text: `✓ ${productId} 삭제 완료` }] };
|
|
609
610
|
});
|
|
611
|
+
server.tool('setup_playstore_connection', [
|
|
612
|
+
'Play Store 서비스 계정을 한 번에 설정합니다 (SA 생성 → JSON 키 발급 → 로컬 등록).',
|
|
613
|
+
'iam_create_service_account → iam_create_key → playstore_register_service_account 를 순서대로 자동 실행.',
|
|
614
|
+
'완료 후 Play Console에서 서비스 계정 이메일을 초대하는 안내(수동 1단계)가 포함됩니다.',
|
|
615
|
+
'이미 같은 accountId의 SA가 존재하면 키만 새로 발급하고 등록합니다.',
|
|
616
|
+
].join(' '), {
|
|
617
|
+
packageName: z.string().describe('Android 패키지명 (예: gg.pryzm.speakmoney)'),
|
|
618
|
+
projectId: z.string().describe('Google Cloud 프로젝트 ID (예: my-project-123). Firebase 콘솔 → 프로젝트 설정에서 확인.'),
|
|
619
|
+
accountId: z
|
|
620
|
+
.string()
|
|
621
|
+
.regex(/^[a-z][a-z0-9-]{4,28}[a-z0-9]$/, 'lowercase, digits, hyphens; 6-30 chars')
|
|
622
|
+
.default('mimi-play-publisher')
|
|
623
|
+
.describe('서비스 계정 ID (기본: mimi-play-publisher)'),
|
|
624
|
+
}, async ({ packageName, projectId, accountId }) => {
|
|
625
|
+
const auth = await requireAuth();
|
|
626
|
+
const displayName = `Mimi Seed Play Publisher (${packageName})`;
|
|
627
|
+
// 1. 서비스 계정 생성 (이미 존재하면 409 → 이메일만 재구성)
|
|
628
|
+
let saEmail;
|
|
629
|
+
try {
|
|
630
|
+
const account = await iam.createServiceAccount(auth, projectId, accountId, displayName);
|
|
631
|
+
saEmail = account.email;
|
|
632
|
+
}
|
|
633
|
+
catch (err) {
|
|
634
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
635
|
+
if (msg.includes('409') || msg.toLowerCase().includes('already exists')) {
|
|
636
|
+
saEmail = `${accountId}@${projectId}.iam.gserviceaccount.com`;
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
throw err;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
// 2. JSON 키 발급
|
|
643
|
+
const key = await iam.createServiceAccountKey(auth, saEmail);
|
|
644
|
+
// 3. 로컬 등록 (검증은 Play Console 초대 전이라 skip)
|
|
645
|
+
saveServiceAccountJsonForPackage(packageName, key.json);
|
|
646
|
+
return {
|
|
647
|
+
content: [{
|
|
648
|
+
type: 'text',
|
|
649
|
+
text: [
|
|
650
|
+
`✅ Play Store 서비스 계정 설정 완료`,
|
|
651
|
+
'',
|
|
652
|
+
`**패키지**: \`${packageName}\``,
|
|
653
|
+
`**SA 이메일**: \`${saEmail}\``,
|
|
654
|
+
`**저장 경로**: \`~/.mimi-seed/play-service-accounts/${packageName}.json\``,
|
|
655
|
+
'',
|
|
656
|
+
'## 필수 수동 단계 — Play Console 초대',
|
|
657
|
+
'1. https://play.google.com/console/developers 접속',
|
|
658
|
+
'2. **설정 → 사용자 및 권한 → 새 사용자 초대**',
|
|
659
|
+
`3. 이메일 입력: \`${saEmail}\``,
|
|
660
|
+
'4. 권한: **앱 출시** 또는 **릴리스 관리자** 선택 → 초대 전송',
|
|
661
|
+
'5. 권한 적용까지 약 5분 소요',
|
|
662
|
+
'',
|
|
663
|
+
'초대 완료 후 `playstore_verify_service_account` 로 연결 확인 가능합니다.',
|
|
664
|
+
].join('\n'),
|
|
665
|
+
}],
|
|
666
|
+
};
|
|
667
|
+
});
|
|
610
668
|
}
|
package/package.json
CHANGED