mcp-google-api 0.25.0 → 0.26.1
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/CHANGELOG.md +382 -449
- package/README.md +5 -2
- package/dist/cli.js +85 -45
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
> * **No Support or Feature Requests:** please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage.
|
|
11
11
|
> * **No Warranty:** this software is provided **"AS IS"**, without warranty of any kind, express or implied. Use it strictly for testing and evaluation purposes at your own sole risk.
|
|
12
12
|
|
|
13
|
-
# mcp-google-api / MCP Google API server (0.
|
|
13
|
+
# mcp-google-api / MCP Google API server (0.26.1)
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<img src="https://img.shields.io/badge/node-%3E%3D24-339933?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >= 24">
|
|
@@ -212,11 +212,14 @@ mcp-google-api snippet --transport http --port 3100 # HTTP URL snippet
|
|
|
212
212
|
```bash
|
|
213
213
|
mcp-google-api --ver # installed version, npmjs latest, GitHub latest (three lines)
|
|
214
214
|
mcp-google-api --upgrade # npm install -g mcp-google-api@latest, then refresh skills and registrations with a summary
|
|
215
|
+
mcp-google-api --upgrade --develop # install the latest tagged GitHub release (any branch)
|
|
216
|
+
mcp-google-api --upgrade --force # force package re-download and complete reinstallation (npm install --force)
|
|
217
|
+
mcp-google-api --upgrade --develop --force # forced reinstall of the latest tagged GitHub release
|
|
215
218
|
mcp-google-api uninstall # remove MCP registrations + skills from every enabled CLI
|
|
216
219
|
mcp-google-api --uninstall # npm uninstall -g mcp-google-api
|
|
217
220
|
```
|
|
218
221
|
|
|
219
|
-
`--upgrade`
|
|
222
|
+
`--upgrade` reinstalls the package in every invocation with no pre-upgrade version comparison; after a successful upgrade it re-runs `install` through the upgraded package and prints the starting → updated version transition plus one entry per processed CLI. `--force` appends the npm `--force` flag so the package is re-downloaded and fully reinstalled (standard runs, with or without `--develop`, stay unforced).
|
|
220
223
|
|
|
221
224
|
# Documentation
|
|
222
225
|
|
package/dist/cli.js
CHANGED
|
@@ -1608,6 +1608,15 @@ var DEFAULT_GITHUB_RELEASES_API_URL = "https://api.github.com/repos/Ogekuri/mcp-
|
|
|
1608
1608
|
function stripReleaseTagPrefix(tag) {
|
|
1609
1609
|
return tag.trim().replace(/^v/i, "");
|
|
1610
1610
|
}
|
|
1611
|
+
async function readGitHubErrorDetail(response) {
|
|
1612
|
+
try {
|
|
1613
|
+
const payload = await response.json();
|
|
1614
|
+
const detail = typeof payload?.message === "string" ? payload.message.trim() : "";
|
|
1615
|
+
return detail.length > 0 ? detail : void 0;
|
|
1616
|
+
} catch {
|
|
1617
|
+
return void 0;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1611
1620
|
async function probeLatestGitHubVersion(deps = {}) {
|
|
1612
1621
|
const releasesUrl = deps.releasesUrl ?? DEFAULT_GITHUB_RELEASES_API_URL;
|
|
1613
1622
|
const timeoutMs = deps.timeoutMs ?? DEFAULT_UPDATE_CHECK_TIMEOUT_MS;
|
|
@@ -1621,9 +1630,11 @@ async function probeLatestGitHubVersion(deps = {}) {
|
|
|
1621
1630
|
signal: AbortSignal.timeout(timeoutMs)
|
|
1622
1631
|
});
|
|
1623
1632
|
if (!response.ok) {
|
|
1633
|
+
const detail = await readGitHubErrorDetail(response);
|
|
1634
|
+
const cause = detail ? `: ${detail.replace(/\.+$/, "")}` : "";
|
|
1624
1635
|
return {
|
|
1625
1636
|
status: "error",
|
|
1626
|
-
message: `GitHub releases API responded with HTTP ${response.status}.`
|
|
1637
|
+
message: `GitHub releases API responded with HTTP ${response.status}${cause}.`
|
|
1627
1638
|
};
|
|
1628
1639
|
}
|
|
1629
1640
|
const payload = await response.json();
|
|
@@ -1660,9 +1671,11 @@ var PACKAGE_UPGRADE_COMMAND = [
|
|
|
1660
1671
|
"-g",
|
|
1661
1672
|
`${DEFAULT_PACKAGE_NAME}@latest`
|
|
1662
1673
|
];
|
|
1674
|
+
var UPGRADE_FORCE_OPTION = "--force";
|
|
1663
1675
|
var GITHUB_UPGRADE_REPOSITORY = "Ogekuri/mcp-google-api";
|
|
1664
|
-
function buildDevelopUpgradeCommand(tag) {
|
|
1665
|
-
|
|
1676
|
+
function buildDevelopUpgradeCommand(tag, force = false) {
|
|
1677
|
+
const command = ["npm", "install", "-g", `github:${GITHUB_UPGRADE_REPOSITORY}#${tag}`];
|
|
1678
|
+
return force ? [...command, UPGRADE_FORCE_OPTION] : command;
|
|
1666
1679
|
}
|
|
1667
1680
|
var PACKAGE_UNINSTALL_COMMAND = [
|
|
1668
1681
|
"npm",
|
|
@@ -1770,25 +1783,40 @@ async function checkVersionIdle(deps = {}) {
|
|
|
1770
1783
|
return result;
|
|
1771
1784
|
}
|
|
1772
1785
|
function parseManagementCommand(args) {
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
if (
|
|
1776
|
-
|
|
1786
|
+
const upgradeCount = args.filter((arg) => arg === "--upgrade").length;
|
|
1787
|
+
if (upgradeCount === 0) {
|
|
1788
|
+
if (args.length === 1) {
|
|
1789
|
+
const arg = args[0];
|
|
1790
|
+
if (arg === "--ver" || arg === "--version" || arg === "--uninstall") {
|
|
1791
|
+
return arg;
|
|
1792
|
+
}
|
|
1777
1793
|
}
|
|
1778
1794
|
return void 0;
|
|
1779
1795
|
}
|
|
1780
|
-
if (
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1796
|
+
if (upgradeCount !== 1) {
|
|
1797
|
+
return void 0;
|
|
1798
|
+
}
|
|
1799
|
+
const optionTokens = args.filter(
|
|
1800
|
+
(arg) => arg === "--develop" || arg === "--dev" || arg === UPGRADE_FORCE_OPTION
|
|
1801
|
+
);
|
|
1802
|
+
if (args.length !== optionTokens.length + 1) {
|
|
1803
|
+
return void 0;
|
|
1804
|
+
}
|
|
1805
|
+
const channelCount = optionTokens.filter(
|
|
1806
|
+
(arg) => arg === "--develop" || arg === "--dev"
|
|
1807
|
+
).length;
|
|
1808
|
+
const forceCount = optionTokens.filter((arg) => arg === UPGRADE_FORCE_OPTION).length;
|
|
1809
|
+
if (channelCount > 1 || forceCount > 1) {
|
|
1810
|
+
return void 0;
|
|
1786
1811
|
}
|
|
1787
|
-
return
|
|
1812
|
+
return "--upgrade";
|
|
1788
1813
|
}
|
|
1789
1814
|
function parseUpgradeChannel(args) {
|
|
1790
1815
|
return args.includes("--develop") || args.includes("--dev") ? "develop" : "npm";
|
|
1791
1816
|
}
|
|
1817
|
+
function parseUpgradeForce(args) {
|
|
1818
|
+
return args.includes(UPGRADE_FORCE_OPTION);
|
|
1819
|
+
}
|
|
1792
1820
|
function runPackageManagerCommand(command, deps = {}) {
|
|
1793
1821
|
const logger = deps.logger ?? Logger;
|
|
1794
1822
|
const spawnImpl = deps.spawn ?? spawnSync;
|
|
@@ -1959,7 +1987,7 @@ async function runVersionCommand(options, deps = {}) {
|
|
|
1959
1987
|
]);
|
|
1960
1988
|
const installedVersion = options.currentVersion || "unknown";
|
|
1961
1989
|
const npmLatest = resolveProbeLatestVersion(npmProbe);
|
|
1962
|
-
const githubLatest = githubProbe.status === "ok" ? githubProbe.version :
|
|
1990
|
+
const githubLatest = githubProbe.status === "ok" ? githubProbe.version : `unknown (${githubProbe.message})`;
|
|
1963
1991
|
const stdout = deps.stdout ?? process.stdout;
|
|
1964
1992
|
stdout.write(`${installedVersion}
|
|
1965
1993
|
npmjs latest: ${npmLatest}
|
|
@@ -1974,7 +2002,10 @@ async function runUpgradeCommand(options, deps = {}) {
|
|
|
1974
2002
|
(deps.logger ?? Logger).error(`GitHub upgrade channel probe failed: ${githubProbe.message}`);
|
|
1975
2003
|
return 1;
|
|
1976
2004
|
}
|
|
1977
|
-
const upgraded2 = runPackageUpdateCommand(
|
|
2005
|
+
const upgraded2 = runPackageUpdateCommand(
|
|
2006
|
+
buildDevelopUpgradeCommand(githubProbe.tag, options.force === true),
|
|
2007
|
+
deps
|
|
2008
|
+
);
|
|
1978
2009
|
if (upgraded2 !== 0) {
|
|
1979
2010
|
return upgraded2;
|
|
1980
2011
|
}
|
|
@@ -1983,7 +2014,8 @@ async function runUpgradeCommand(options, deps = {}) {
|
|
|
1983
2014
|
stdout2.write(renderUpgradeSummary(options.currentVersion, githubProbe.version, outcome2));
|
|
1984
2015
|
return outcome2.exitCode;
|
|
1985
2016
|
}
|
|
1986
|
-
const
|
|
2017
|
+
const updateCommand = options.force === true ? [...PACKAGE_UPGRADE_COMMAND, UPGRADE_FORCE_OPTION] : PACKAGE_UPGRADE_COMMAND;
|
|
2018
|
+
const upgraded = runPackageUpdateCommand(updateCommand, deps);
|
|
1987
2019
|
if (upgraded !== 0) {
|
|
1988
2020
|
return upgraded;
|
|
1989
2021
|
}
|
|
@@ -2173,13 +2205,21 @@ var COPILOT_TARGET = {
|
|
|
2173
2205
|
mcpConfigPath: (home) => join3(homeRoot(home), ".copilot", "mcp.json"),
|
|
2174
2206
|
skillsDir: (home) => join3(homeRoot(home), ".copilot", "skills")
|
|
2175
2207
|
};
|
|
2208
|
+
var OPENCODE_TARGET = {
|
|
2209
|
+
id: "opencode",
|
|
2210
|
+
configFormat: "json",
|
|
2211
|
+
jsonMcpMapKey: "mcp",
|
|
2212
|
+
mcpConfigPath: (home) => join3(homeRoot(home), ".config", "opencode", "opencode.json"),
|
|
2213
|
+
skillsDir: (home) => join3(homeRoot(home), ".config", "opencode", "skills")
|
|
2214
|
+
};
|
|
2176
2215
|
var CLI_TARGETS = {
|
|
2177
|
-
pi: PI_TARGET,
|
|
2178
|
-
openclaw: OPENCLAW_TARGET,
|
|
2179
|
-
codex: CODEX_TARGET,
|
|
2180
2216
|
antigravity: ANTIGRAVITY_TARGET,
|
|
2181
2217
|
claude: CLAUDE_TARGET,
|
|
2182
|
-
|
|
2218
|
+
codex: CODEX_TARGET,
|
|
2219
|
+
copilot: COPILOT_TARGET,
|
|
2220
|
+
openclaw: OPENCLAW_TARGET,
|
|
2221
|
+
opencode: OPENCODE_TARGET,
|
|
2222
|
+
pi: PI_TARGET
|
|
2183
2223
|
};
|
|
2184
2224
|
function resolveCliTarget(name) {
|
|
2185
2225
|
return CLI_TARGETS[name.trim().toLowerCase()];
|
|
@@ -2201,35 +2241,35 @@ function writeJsonConfig(configPath, value) {
|
|
|
2201
2241
|
writeFileSync3(temporary, JSON.stringify(value, null, 2) + "\n", "utf-8");
|
|
2202
2242
|
renameSync2(temporary, configPath);
|
|
2203
2243
|
}
|
|
2204
|
-
function writeJsonMcpServerEntry(configPath, serverName, entry) {
|
|
2244
|
+
function writeJsonMcpServerEntry(configPath, serverName, entry, mapKey = "mcpServers") {
|
|
2205
2245
|
const config = readJsonConfig(configPath);
|
|
2206
|
-
const mcpServers = config
|
|
2246
|
+
const mcpServers = config[mapKey] ?? {};
|
|
2207
2247
|
if (mcpServers === null || typeof mcpServers !== "object" || Array.isArray(mcpServers)) {
|
|
2208
|
-
throw new Error(
|
|
2248
|
+
throw new Error(`${mapKey} is not an object: ${configPath}`);
|
|
2209
2249
|
}
|
|
2210
2250
|
mcpServers[serverName] = entry;
|
|
2211
|
-
config
|
|
2251
|
+
config[mapKey] = mcpServers;
|
|
2212
2252
|
writeJsonConfig(configPath, config);
|
|
2213
2253
|
}
|
|
2214
|
-
function removeJsonMcpServerEntry(configPath, serverName) {
|
|
2254
|
+
function removeJsonMcpServerEntry(configPath, serverName, mapKey = "mcpServers") {
|
|
2215
2255
|
if (!existsSync(configPath)) return false;
|
|
2216
2256
|
const config = readJsonConfig(configPath);
|
|
2217
|
-
const mcpServers = config
|
|
2257
|
+
const mcpServers = config[mapKey];
|
|
2218
2258
|
if (mcpServers === void 0) return false;
|
|
2219
2259
|
if (mcpServers === null || typeof mcpServers !== "object" || Array.isArray(mcpServers)) {
|
|
2220
|
-
throw new Error(
|
|
2260
|
+
throw new Error(`${mapKey} is not an object: ${configPath}`);
|
|
2221
2261
|
}
|
|
2222
2262
|
const map = mcpServers;
|
|
2223
2263
|
if (!(serverName in map)) return false;
|
|
2224
2264
|
delete map[serverName];
|
|
2225
|
-
config
|
|
2265
|
+
config[mapKey] = map;
|
|
2226
2266
|
writeJsonConfig(configPath, config);
|
|
2227
2267
|
return true;
|
|
2228
2268
|
}
|
|
2229
|
-
function readJsonMcpServerEntry(configPath, serverName) {
|
|
2269
|
+
function readJsonMcpServerEntry(configPath, serverName, mapKey = "mcpServers") {
|
|
2230
2270
|
try {
|
|
2231
2271
|
const config = readJsonConfig(configPath);
|
|
2232
|
-
const mcpServers = config
|
|
2272
|
+
const mcpServers = config[mapKey];
|
|
2233
2273
|
if (mcpServers === null || typeof mcpServers !== "object" || Array.isArray(mcpServers)) {
|
|
2234
2274
|
return void 0;
|
|
2235
2275
|
}
|
|
@@ -2372,7 +2412,7 @@ function isServerRegistered(target, serverName, home) {
|
|
|
2372
2412
|
if (target.configFormat === "toml") {
|
|
2373
2413
|
return hasTomlMcpServerSection(configPath, serverName);
|
|
2374
2414
|
}
|
|
2375
|
-
return readJsonMcpServerEntry(configPath, serverName) !== void 0;
|
|
2415
|
+
return readJsonMcpServerEntry(configPath, serverName, target.jsonMcpMapKey) !== void 0;
|
|
2376
2416
|
}
|
|
2377
2417
|
function applyServerRegistration(target, serverName, entry, home) {
|
|
2378
2418
|
const configPath = target.mcpConfigPath(home);
|
|
@@ -2385,9 +2425,9 @@ function applyServerRegistration(target, serverName, entry, home) {
|
|
|
2385
2425
|
return;
|
|
2386
2426
|
}
|
|
2387
2427
|
if (entry === void 0) {
|
|
2388
|
-
removeJsonMcpServerEntry(configPath, serverName);
|
|
2428
|
+
removeJsonMcpServerEntry(configPath, serverName, target.jsonMcpMapKey);
|
|
2389
2429
|
} else {
|
|
2390
|
-
writeJsonMcpServerEntry(configPath, serverName, entry);
|
|
2430
|
+
writeJsonMcpServerEntry(configPath, serverName, entry, target.jsonMcpMapKey);
|
|
2391
2431
|
}
|
|
2392
2432
|
}
|
|
2393
2433
|
|
|
@@ -2540,22 +2580,22 @@ function renderAsciiTable(headers, rows, maxWidth = MAX_CELL_WIDTH) {
|
|
|
2540
2580
|
const lengths = [header.length, ...rows.map((row) => (row[index] ?? "").length)];
|
|
2541
2581
|
return Math.max(1, Math.min(Math.max(...lengths), Math.max(1, maxWidth)));
|
|
2542
2582
|
});
|
|
2543
|
-
const
|
|
2583
|
+
const borderLine = (left, middle, right) => left + widths.map((width) => "\u2500".repeat(width + 2)).join(middle) + right;
|
|
2544
2584
|
const renderRow = (cells) => {
|
|
2545
2585
|
const wrapped = cells.map((cell, index) => wrapCell(cell ?? "", widths[index]));
|
|
2546
2586
|
const height = Math.max(...wrapped.map((part) => part.length));
|
|
2547
2587
|
const lines = [];
|
|
2548
2588
|
for (let line = 0; line < height; line += 1) {
|
|
2549
2589
|
const parts = wrapped.map((part, index) => (part[line] ?? "").padEnd(widths[index]));
|
|
2550
|
-
lines.push("
|
|
2590
|
+
lines.push("\u2502 " + parts.join(" \u2502 ") + " \u2502");
|
|
2551
2591
|
}
|
|
2552
2592
|
return lines;
|
|
2553
2593
|
};
|
|
2554
|
-
const output = [
|
|
2594
|
+
const output = [borderLine("\u250C", "\u252C", "\u2510"), ...renderRow(headers), borderLine("\u251C", "\u253C", "\u2524")];
|
|
2555
2595
|
for (const row of rows) {
|
|
2556
2596
|
output.push(...renderRow(row));
|
|
2557
|
-
output.push(border);
|
|
2558
2597
|
}
|
|
2598
|
+
output.push(borderLine("\u2514", "\u2534", "\u2518"));
|
|
2559
2599
|
return output.join("\n");
|
|
2560
2600
|
}
|
|
2561
2601
|
function buildCliRows(home) {
|
|
@@ -2969,16 +3009,14 @@ function runEnableDisableCliCommand(name, enable, options = {}) {
|
|
|
2969
3009
|
const settings = loadCliSettings(options.home);
|
|
2970
3010
|
const already = settings.enabled.includes(target.id);
|
|
2971
3011
|
if (enable === already) {
|
|
2972
|
-
streams.stdout.write(
|
|
2973
|
-
|
|
2974
|
-
);
|
|
3012
|
+
streams.stdout.write(`${target.id} is already ${enable ? "enabled" : "disabled"}.
|
|
3013
|
+
`);
|
|
2975
3014
|
return 0;
|
|
2976
3015
|
}
|
|
2977
3016
|
settings.enabled = enable ? [...settings.enabled, target.id] : settings.enabled.filter((item) => item !== target.id);
|
|
2978
3017
|
saveCliSettings(settings, options.home);
|
|
2979
|
-
streams.stdout.write(
|
|
2980
|
-
|
|
2981
|
-
);
|
|
3018
|
+
streams.stdout.write(`${enable ? "Enabled" : "Disabled"} ${target.id}.
|
|
3019
|
+
`);
|
|
2982
3020
|
return 0;
|
|
2983
3021
|
}
|
|
2984
3022
|
function runApiKeyCommand(key, options) {
|
|
@@ -3239,7 +3277,8 @@ if (isMainModule) {
|
|
|
3239
3277
|
const managementCommand = parseManagementCommand(hideBin(process.argv));
|
|
3240
3278
|
if (managementCommand !== void 0) {
|
|
3241
3279
|
const upgradeChannel = parseUpgradeChannel(hideBin(process.argv));
|
|
3242
|
-
|
|
3280
|
+
const upgradeForce = parseUpgradeForce(hideBin(process.argv));
|
|
3281
|
+
void runManagementCommand(managementCommand, { currentVersion: packageVersion, channel: upgradeChannel, force: upgradeForce }).then((code) => {
|
|
3243
3282
|
process.exitCode = code;
|
|
3244
3283
|
}).catch((error) => {
|
|
3245
3284
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -3716,6 +3755,7 @@ Usage: mcp-google-api <command> [options]
|
|
|
3716
3755
|
--version Alias of --ver
|
|
3717
3756
|
--upgrade Upgrade the global package to the latest version and refresh installed skills
|
|
3718
3757
|
--develop | --dev: install the latest tagged GitHub release (any branch)
|
|
3758
|
+
--force: force package re-download and complete reinstallation (npm install --force)
|
|
3719
3759
|
--uninstall Remove the globally installed mcp-google-api package`
|
|
3720
3760
|
).help();
|
|
3721
3761
|
cli.parse();
|