mcp-google-map 0.6.0 → 0.7.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/README.md +14 -14
- package/dist/cli.js +84 -60
- package/dist/cli.js.map +1 -1
- package/docs/CONFIGURATION.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# mcp-google-map (0.
|
|
1
|
+
# mcp-google-map (0.7.0)
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://img.shields.io/badge/node-%3E%3D22-339933?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >= 22">
|
|
@@ -98,11 +98,11 @@ npm install -g mcp-google-map
|
|
|
98
98
|
mcp-google-map setup --write-env # scaffold .env in the current directory (never overwrites)
|
|
99
99
|
$EDITOR .env # set GOOGLE_MAPS_API_KEY
|
|
100
100
|
mcp-google-map doctor # local self-check: Node, package, key, config (no network)
|
|
101
|
-
mcp-google-map --stdio
|
|
102
|
-
mcp-google-map
|
|
101
|
+
mcp-google-map start --stdio # MCP server over stdio
|
|
102
|
+
mcp-google-map start # MCP server over Streamable HTTP at http://127.0.0.1:3000/mcp
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
One-shot alternative without a global install: `npx -y mcp-google-map --stdio`.
|
|
105
|
+
One-shot alternative without a global install: `npx -y mcp-google-map start --stdio`.
|
|
106
106
|
|
|
107
107
|
### From source (this repository) — cross-platform, no bash required
|
|
108
108
|
|
|
@@ -111,8 +111,8 @@ git clone https://github.com/Ogekuri/mcp-google-map.git
|
|
|
111
111
|
cd mcp-google-map
|
|
112
112
|
npm ci # install dependencies from the lockfile
|
|
113
113
|
npm run build # tsup -> dist/ (ESM)
|
|
114
|
-
node dist/cli.js --stdio # MCP server over stdio
|
|
115
|
-
node dist/cli.js --host 127.0.0.1 --port 3000 # Streamable HTTP at /mcp
|
|
114
|
+
node dist/cli.js start --stdio # MCP server over stdio
|
|
115
|
+
node dist/cli.js start --host 127.0.0.1 --port 3000 # Streamable HTTP at /mcp
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
On Linux/macOS the bash helpers in `scripts/` wrap the same commands (`scripts/setup.sh`, `scripts/build.sh`, `scripts/start-mcp.sh`, `scripts/start-http.sh`, `scripts/test.sh`); each helper fails with remediation guidance instead of chaining implicit installs or builds. On Windows use the `npm`/`node` commands above.
|
|
@@ -124,7 +124,7 @@ MCP client registration over stdio works cross-platform with plain `node`:
|
|
|
124
124
|
"mcpServers": {
|
|
125
125
|
"mcp-google-map": {
|
|
126
126
|
"command": "node",
|
|
127
|
-
"args": ["/absolute/path/to/mcp-google-map/dist/cli.js", "--stdio"],
|
|
127
|
+
"args": ["/absolute/path/to/mcp-google-map/dist/cli.js", "start", "--stdio"],
|
|
128
128
|
"env": { "GOOGLE_MAPS_API_KEY": "AIza..." }
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -155,8 +155,8 @@ mcp-google-map snippet --transport http --port 3100 # HTTP URL snip
|
|
|
155
155
|
All commands work through the `mcp-google-map` binary (npm install) or `node dist/cli.js` (from source).
|
|
156
156
|
|
|
157
157
|
```bash
|
|
158
|
-
mcp-google-map --stdio
|
|
159
|
-
mcp-google-map --host 127.0.0.1 --port 3000
|
|
158
|
+
mcp-google-map start --stdio # MCP server over stdio
|
|
159
|
+
mcp-google-map start --host 127.0.0.1 --port 3000 # MCP server over Streamable HTTP at /mcp (loopback default)
|
|
160
160
|
mcp-google-map setup --write-env # onboarding: readiness checks + .env scaffold (no network, no prompts)
|
|
161
161
|
mcp-google-map doctor # local self-check: Node, package, key, config, tool profiles (no network)
|
|
162
162
|
mcp-google-map doctor --live --apikey "AIza..." # also probes Geocoding, Places (New), Routes (billable calls)
|
|
@@ -178,7 +178,7 @@ mcp-google-map snippet --client cursor # print an MCP client re
|
|
|
178
178
|
- `snippet` prints a valid `mcpServers` JSON registration to stdout (guidance notes on stderr) and never writes or edits configuration files; by default it embeds a literal placeholder, and `--env-key NAME` emits a `${NAME}` reference whose expansion is client-specific.
|
|
179
179
|
- `--env-file <path>` loads exactly the given environment file for any command and exits 1 with a JSON error when the file is missing (no implicit `.env` fallback).
|
|
180
180
|
- `enable <cli>` / `disable <cli>` manage the persisted enabled-CLI set at `~/.config/mcp-google-map/config.json`; accepted names (case-insensitive): `pi`, `openclaw`, `codex`, `antigravity`, `claude`; unsupported names exit 2 listing the supported ones.
|
|
181
|
-
- `install` registers for every enabled CLI the stdio server entry `mcp-google-map` (`npx -y mcp-google-map --stdio`, embedding the resolved `GOOGLE_MAPS_API_KEY` when set) and installs every bundled skill; `uninstall` is the reciprocal removal. Per-CLI targets: pi `~/.pi/agent/mcp.json` + `~/.pi/agent/skills`, openclaw `~/.openclaw/openclaw.json` + `~/.openclaw/workspace/skills`, codex `~/.codex/config.toml` (`mcp_servers` table) + `~/.codex/skills`, antigravity `~/.gemini/settings.json` + `~/.gemini/config/skills`, claude `~/.claude.json` + `~/.claude/skills`. Existing unrelated configuration entries are always preserved.
|
|
181
|
+
- `install` registers for every enabled CLI the stdio server entry `mcp-google-map` (`npx -y mcp-google-map start --stdio`, embedding the resolved `GOOGLE_MAPS_API_KEY` when set) and installs every bundled skill; `uninstall` is the reciprocal removal. Per-CLI targets: pi `~/.pi/agent/mcp.json` + `~/.pi/agent/skills`, openclaw `~/.openclaw/openclaw.json` + `~/.openclaw/workspace/skills`, codex `~/.codex/config.toml` (`mcp_servers` table) + `~/.codex/skills`, antigravity `~/.gemini/settings.json` + `~/.gemini/config/skills`, claude `~/.claude.json` + `~/.claude/skills`. Existing unrelated configuration entries are always preserved.
|
|
182
182
|
- `show` prints two human-readable tables: CLI Configuration (CLI, Enabled, MCP Config Path, Skills Config Path for all five CLIs) and Installation Status (Type, Name, CLI, Enabled, Installed with OK/MISSING/STALE per enabled CLI).
|
|
183
183
|
- HTTP mode starts even without an API key and logs a warning; stdio mode and the CLI commands require a key (`--apikey` or `GOOGLE_MAPS_API_KEY`). When no HTTP instance can start (invalid or taken port), the process exits non-zero.
|
|
184
184
|
|
|
@@ -220,14 +220,14 @@ pi reads MCP servers from `~/.pi/agent/mcp.json` (user) or `.pi/mcp.json` (proje
|
|
|
220
220
|
"mcpServers": {
|
|
221
221
|
"maps": {
|
|
222
222
|
"command": "node",
|
|
223
|
-
"args": ["/absolute/path/to/mcp-google-map/dist/cli.js", "--stdio"],
|
|
223
|
+
"args": ["/absolute/path/to/mcp-google-map/dist/cli.js", "start", "--stdio"],
|
|
224
224
|
"env": { "GOOGLE_MAPS_API_KEY": "${GOOGLE_MAPS_API_KEY}" }
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
- From a terminal: `pi mcp add maps -- node /absolute/path/to/mcp-google-map/dist/cli.js --stdio` (add `--env GOOGLE_MAPS_API_KEY=...` to pass the key).
|
|
230
|
+
- From a terminal: `pi mcp add maps -- node /absolute/path/to/mcp-google-map/dist/cli.js start --stdio` (add `--env GOOGLE_MAPS_API_KEY=...` to pass the key).
|
|
231
231
|
- `${GOOGLE_MAPS_API_KEY}` expands the environment variable on the fly: the key never stays hard-coded in the configuration file.
|
|
232
232
|
- After editing `mcp.json` outside the session, run `/reload` in pi; `/mcp` inspects status, tools, and connection errors.
|
|
233
233
|
- Tools appear with the `mcp__<server>__` prefix: `mcp__maps__maps_geocode`, `mcp__maps__maps_search_places`, ...
|
|
@@ -237,10 +237,10 @@ pi reads MCP servers from `~/.pi/agent/mcp.json` (user) or `.pi/mcp.json` (proje
|
|
|
237
237
|
OpenClaw manages MCP servers in `~/.openclaw/openclaw.json` through its CLI (verified on OpenClaw 2026.4.21):
|
|
238
238
|
|
|
239
239
|
```bash
|
|
240
|
-
openclaw mcp set maps '{"command":"node","args":["/absolute/path/to/mcp-google-map/dist/cli.js","--stdio"],"env":{"GOOGLE_MAPS_API_KEY":"AIza..."},"description":"Google Maps: Places API (New), geocoding, routes, weather"}'
|
|
240
|
+
openclaw mcp set maps '{"command":"node","args":["/absolute/path/to/mcp-google-map/dist/cli.js","start","--stdio"],"env":{"GOOGLE_MAPS_API_KEY":"AIza..."},"description":"Google Maps: Places API (New), geocoding, routes, weather"}'
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
- Without a local install: use `"command":"npx","args":["-y","mcp-google-map","--stdio"]` (runs the published npm package).
|
|
243
|
+
- Without a local install: use `"command":"npx","args":["-y","mcp-google-map","start","--stdio"]` (runs the published npm package).
|
|
244
244
|
- After the change, reload the gateway or restart the agent session so the new server gets connected.
|
|
245
245
|
- Inspect and remove: `openclaw mcp list`, `openclaw mcp show maps`, `openclaw mcp unset maps`.
|
|
246
246
|
- The OpenClaw agent can install and configure the server on its own (shell + `openclaw mcp set`); creating the API key in Google Cloud Console remains a human task.
|
package/dist/cli.js
CHANGED
|
@@ -1594,7 +1594,6 @@ async function checkVersionIdle(deps = {}) {
|
|
|
1594
1594
|
case "current":
|
|
1595
1595
|
lastSuccess = now();
|
|
1596
1596
|
result.currentVersion = probe.currentVersion;
|
|
1597
|
-
logger.error(red("Version check: no newer version available."));
|
|
1598
1597
|
break;
|
|
1599
1598
|
case "newer": {
|
|
1600
1599
|
lastSuccess = now();
|
|
@@ -1788,14 +1787,14 @@ function renderClientSnippet(options = {}) {
|
|
|
1788
1787
|
const host = options.host ?? SNIPPET_DEFAULT_HOST;
|
|
1789
1788
|
const port = options.port ?? SNIPPET_DEFAULT_PORT;
|
|
1790
1789
|
entry = { url: `http://${host}:${port}/mcp` };
|
|
1791
|
-
notes.push(`Start the server first: mcp-google-map --host ${host} --port ${port}.`);
|
|
1790
|
+
notes.push(`Start the server first: mcp-google-map start --host ${host} --port ${port}.`);
|
|
1792
1791
|
} else {
|
|
1793
1792
|
const launcher = options.launcher ?? "npx";
|
|
1794
1793
|
if (launcher === "node" && !options.commandPath) {
|
|
1795
1794
|
throw new Error("--launcher node requires --command <path> pointing at dist/cli.js");
|
|
1796
1795
|
}
|
|
1797
1796
|
const command = launcher === "npx" ? "npx" : launcher === "bin" ? "mcp-google-map" : "node";
|
|
1798
|
-
const args = launcher === "npx" ? ["-y", "mcp-google-map", "--stdio"] : launcher === "bin" ? ["--stdio"] : [options.commandPath, "--stdio"];
|
|
1797
|
+
const args = launcher === "npx" ? ["-y", "mcp-google-map", "start", "--stdio"] : launcher === "bin" ? ["start", "--stdio"] : [options.commandPath, "start", "--stdio"];
|
|
1799
1798
|
if (launcher === "npx") {
|
|
1800
1799
|
notes.push("The npx launcher runs the published package; npm must be available on PATH.");
|
|
1801
1800
|
}
|
|
@@ -2068,7 +2067,7 @@ function buildServerRegistration(apiKey) {
|
|
|
2068
2067
|
if (apiKey !== void 0 && apiKey.length > 0) {
|
|
2069
2068
|
env.GOOGLE_MAPS_API_KEY = apiKey;
|
|
2070
2069
|
}
|
|
2071
|
-
return { command: "npx", args: ["-y", MCP_SERVER_NAME, "--stdio"], env };
|
|
2070
|
+
return { command: "npx", args: ["-y", MCP_SERVER_NAME, "start", "--stdio"], env };
|
|
2072
2071
|
}
|
|
2073
2072
|
function resolveSkillsResourcesRoot(packageRoot) {
|
|
2074
2073
|
const candidate = resolve3(packageRoot, "src", "resources", "skills");
|
|
@@ -2834,7 +2833,65 @@ if (isRunDirectly || isMainModule) {
|
|
|
2834
2833
|
process.exitCode = 1;
|
|
2835
2834
|
});
|
|
2836
2835
|
} else {
|
|
2837
|
-
|
|
2836
|
+
const buildServerCommandOptions = (yargs2) => yargs2.option("port", {
|
|
2837
|
+
alias: "p",
|
|
2838
|
+
type: "number",
|
|
2839
|
+
description: "Port to run the MCP server on",
|
|
2840
|
+
default: process.env.MCP_SERVER_PORT ? parseInt(process.env.MCP_SERVER_PORT) : 3e3
|
|
2841
|
+
}).option("host", {
|
|
2842
|
+
type: "string",
|
|
2843
|
+
description: "Hostname to bind the server to (default 127.0.0.1 loopback; 0.0.0.0 for all interfaces)",
|
|
2844
|
+
default: process.env.MCP_SERVER_HOST || "127.0.0.1"
|
|
2845
|
+
}).option("apikey", {
|
|
2846
|
+
alias: "k",
|
|
2847
|
+
type: "string",
|
|
2848
|
+
description: "Google Maps API key",
|
|
2849
|
+
default: process.env.GOOGLE_MAPS_API_KEY
|
|
2850
|
+
}).option("stdio", {
|
|
2851
|
+
type: "boolean",
|
|
2852
|
+
description: "Use stdio transport instead of HTTP",
|
|
2853
|
+
default: false
|
|
2854
|
+
}).example([
|
|
2855
|
+
["$0 start", "Start HTTP server with default settings"],
|
|
2856
|
+
['$0 start --port 3000 --apikey "your_api_key"', "Start HTTP with custom port and API key"],
|
|
2857
|
+
["$0 start --host 0.0.0.0 --port 3000", "Start HTTP accessible from all interfaces"],
|
|
2858
|
+
["$0 start --stdio", "Start in stdio mode (for MCP clients)"],
|
|
2859
|
+
["$0 run --stdio", "Alias: run the server in stdio mode"]
|
|
2860
|
+
]);
|
|
2861
|
+
const runServerCommand = async (argv) => {
|
|
2862
|
+
if (argv.apikey) {
|
|
2863
|
+
process.env.GOOGLE_MAPS_API_KEY = argv.apikey;
|
|
2864
|
+
}
|
|
2865
|
+
void checkVersionIdle({ currentVersion: packageVersion }).catch(() => void 0);
|
|
2866
|
+
const tools = filterTools(config_default[0].tools);
|
|
2867
|
+
if (argv.stdio) {
|
|
2868
|
+
const server = new BaseMcpServer(config_default[0].name, tools);
|
|
2869
|
+
await server.startStdio();
|
|
2870
|
+
} else {
|
|
2871
|
+
Logger.log("\u{1F5FA}\uFE0F Google Maps MCP Server");
|
|
2872
|
+
Logger.log(" A Model Context Protocol server for Google Maps services");
|
|
2873
|
+
Logger.log("");
|
|
2874
|
+
if (!argv.apikey) {
|
|
2875
|
+
Logger.log("\u26A0\uFE0F Google Maps API Key not found!");
|
|
2876
|
+
Logger.log(" Please provide --apikey parameter or set GOOGLE_MAPS_API_KEY in your .env file");
|
|
2877
|
+
Logger.log("");
|
|
2878
|
+
}
|
|
2879
|
+
startServer(argv.port, argv.apikey, argv.host).then((outcome) => {
|
|
2880
|
+
if (outcome.started === 0) {
|
|
2881
|
+
process.exit(1);
|
|
2882
|
+
}
|
|
2883
|
+
}).catch((error) => {
|
|
2884
|
+
Logger.error("\u274C Failed to start server:", error);
|
|
2885
|
+
process.exit(1);
|
|
2886
|
+
});
|
|
2887
|
+
}
|
|
2888
|
+
};
|
|
2889
|
+
const cli = yargs(hideBin(process.argv)).scriptName("mcp-google-map").usage(
|
|
2890
|
+
`mcp-google-map v${packageVersion}
|
|
2891
|
+
|
|
2892
|
+
Usage: mcp-google-map <command> [options]
|
|
2893
|
+
mcp-google-map start|run [--stdio] [options]`
|
|
2894
|
+
).command(
|
|
2838
2895
|
"doctor",
|
|
2839
2896
|
"Check standalone CLI readiness without starting an MCP server",
|
|
2840
2897
|
(yargs2) => yargs2.option("live", {
|
|
@@ -3164,67 +3221,34 @@ if (isRunDirectly || isMainModule) {
|
|
|
3164
3221
|
process.exit(failed > 0 ? 1 : 0);
|
|
3165
3222
|
}
|
|
3166
3223
|
).command(
|
|
3167
|
-
"
|
|
3224
|
+
"start",
|
|
3168
3225
|
"Start the MCP server (HTTP by default, --stdio for stdio mode)",
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
description: "Google Maps API key",
|
|
3183
|
-
default: process.env.GOOGLE_MAPS_API_KEY
|
|
3184
|
-
}).option("stdio", {
|
|
3185
|
-
type: "boolean",
|
|
3186
|
-
description: "Use stdio transport instead of HTTP",
|
|
3187
|
-
default: false
|
|
3188
|
-
}).example([
|
|
3189
|
-
["$0", "Start HTTP server with default settings"],
|
|
3190
|
-
['$0 --port 3000 --apikey "your_api_key"', "Start HTTP with custom port and API key"],
|
|
3191
|
-
["$0 --host 0.0.0.0 --port 3000", "Start HTTP accessible from all interfaces"],
|
|
3192
|
-
["$0 --stdio", "Start in stdio mode (for Claude Desktop, Cursor, etc.)"]
|
|
3193
|
-
]);
|
|
3194
|
-
},
|
|
3195
|
-
async (argv) => {
|
|
3196
|
-
if (argv.apikey) {
|
|
3197
|
-
process.env.GOOGLE_MAPS_API_KEY = argv.apikey;
|
|
3198
|
-
}
|
|
3199
|
-
void checkVersionIdle({ currentVersion: packageVersion }).catch(() => void 0);
|
|
3200
|
-
const tools = filterTools(config_default[0].tools);
|
|
3201
|
-
if (argv.stdio) {
|
|
3202
|
-
const server = new BaseMcpServer(config_default[0].name, tools);
|
|
3203
|
-
await server.startStdio();
|
|
3204
|
-
} else {
|
|
3205
|
-
Logger.log("\u{1F5FA}\uFE0F Google Maps MCP Server");
|
|
3206
|
-
Logger.log(" A Model Context Protocol server for Google Maps services");
|
|
3207
|
-
Logger.log("");
|
|
3208
|
-
if (!argv.apikey) {
|
|
3209
|
-
Logger.log("\u26A0\uFE0F Google Maps API Key not found!");
|
|
3210
|
-
Logger.log(" Please provide --apikey parameter or set GOOGLE_MAPS_API_KEY in your .env file");
|
|
3211
|
-
Logger.log("");
|
|
3212
|
-
}
|
|
3213
|
-
startServer(argv.port, argv.apikey, argv.host).then((outcome) => {
|
|
3214
|
-
if (outcome.started === 0) {
|
|
3215
|
-
process.exit(1);
|
|
3216
|
-
}
|
|
3217
|
-
}).catch((error) => {
|
|
3218
|
-
Logger.error("\u274C Failed to start server:", error);
|
|
3219
|
-
process.exit(1);
|
|
3220
|
-
});
|
|
3221
|
-
}
|
|
3226
|
+
buildServerCommandOptions,
|
|
3227
|
+
runServerCommand
|
|
3228
|
+
).command(
|
|
3229
|
+
"run",
|
|
3230
|
+
"Alias of start: run the MCP server (HTTP by default, --stdio for stdio mode)",
|
|
3231
|
+
buildServerCommandOptions,
|
|
3232
|
+
runServerCommand
|
|
3233
|
+
).command(
|
|
3234
|
+
"$0",
|
|
3235
|
+
"Print the help text (use start or run to launch the MCP server)",
|
|
3236
|
+
(yargs2) => yargs2,
|
|
3237
|
+
() => {
|
|
3238
|
+
cli.showHelp("log");
|
|
3222
3239
|
}
|
|
3223
3240
|
).version(packageVersion).alias("version", "v").option("env-file", {
|
|
3224
3241
|
type: "string",
|
|
3225
3242
|
global: true,
|
|
3226
3243
|
description: "Load environment variables from this exact file (error if missing; no implicit .env fallback)"
|
|
3227
|
-
}).
|
|
3244
|
+
}).epilog(
|
|
3245
|
+
`Management commands (single flags, dispatched before subcommands):
|
|
3246
|
+
--ver Print the installed version and force one update check
|
|
3247
|
+
--version Alias of --ver
|
|
3248
|
+
--upgrade Upgrade the global package to the latest version and refresh installed skills
|
|
3249
|
+
--uninstall Remove the globally installed mcp-google-map package`
|
|
3250
|
+
).help();
|
|
3251
|
+
cli.parse();
|
|
3228
3252
|
}
|
|
3229
3253
|
}
|
|
3230
3254
|
export {
|