gmaps: fix missing dependency install + wire verify (v6 / 1.1.0)
The connector shipped no requirements.txt, so ensure_installed_host()
installed nothing and every tool call failed with "No module named
'googlemaps'" while the server still answered tools/list — skald logged
"connected — 6 tool(s)" on a connector that could not work.
- add requirements.txt (googlemaps>=4.10.0); deps were declared in the
manifest's `dependencies` field, which skald only uses for the card
- wire the shipped verify.py through a `verify` manifest block, so a
broken install fails visibly at enable time instead of silently
- verify.py puts .pydeps on sys.path: skald sets PYTHONPATH only for the
server process, not for the `sh -c "python3 verify.py"` verify step
- drop the inert mcp_config.env {SECRET:…} placeholder — those tokens are
substituted in the URL only, never in env values
- realign manifest/fragment versions (were 2/1.0.1 vs 5/1.0.4); skald
prefers the manifest, so "update available" could never appear
- requires ENV -> API_KEY; drop deprecated secrets/ path from error text
- regenerate the index
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"id": "gmaps",
|
||||
"name": "Google Maps",
|
||||
"version": 2,
|
||||
"version_string": "1.0.1",
|
||||
"version_release_date": "2026-07-23",
|
||||
"version": 6,
|
||||
"version_string": "1.1.0",
|
||||
"version_release_date": "2026-08-10",
|
||||
"type": "mcp_local",
|
||||
"scope": "global",
|
||||
"launch_command": "python3 gmaps_mcp_server.py",
|
||||
"transport": "stdio",
|
||||
"requires": [
|
||||
"PYTHON",
|
||||
"ENV"
|
||||
"API_KEY"
|
||||
],
|
||||
"tags": [
|
||||
"maps",
|
||||
@@ -36,8 +36,12 @@
|
||||
"setup_instructions": [
|
||||
"Ensure the Google Maps APIs are enabled in your GCP project: Directions, Geocoding, Places, Distance Matrix.",
|
||||
"Create an API key in Google Cloud Console \u2192 Credentials, restricting it to those four APIs.",
|
||||
"Install the Python package: pip install googlemaps"
|
||||
"Paste the key into the connector form; the googlemaps package is installed automatically from requirements.txt."
|
||||
],
|
||||
"verify": {
|
||||
"command": "python3 verify.py",
|
||||
"timeout_secs": 20
|
||||
},
|
||||
"docs": [
|
||||
{
|
||||
"lang": "en",
|
||||
@@ -84,9 +88,7 @@
|
||||
"args": [
|
||||
"gmaps_mcp_server.py"
|
||||
],
|
||||
"env": {
|
||||
"GOOGLE_MAPS_API_KEY": "{SECRET:GOOGLE_MAPS_API_KEY}"
|
||||
}
|
||||
"transport": "stdio"
|
||||
},
|
||||
"homepage": "https://maps.google.com",
|
||||
"icon_small": "icon_sm.svg",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"user_description": "Get transit, driving, walking and cycling directions, geocode addresses, search nearby places, and compute distance matrices \u2014 powered by Google Maps Platform.",
|
||||
"requires": [
|
||||
"PYTHON",
|
||||
"ENV"
|
||||
"API_KEY"
|
||||
],
|
||||
"tags": [
|
||||
"maps",
|
||||
@@ -24,9 +24,9 @@
|
||||
"param": "GOOGLE_MAPS_API_KEY"
|
||||
},
|
||||
"folder": "gmaps",
|
||||
"version": 5,
|
||||
"version_string": "1.0.4",
|
||||
"version_release_date": "2026-07-23",
|
||||
"version": 6,
|
||||
"version_string": "1.1.0",
|
||||
"version_release_date": "2026-08-10",
|
||||
"tools": [
|
||||
{
|
||||
"name": "status",
|
||||
|
||||
@@ -9,8 +9,9 @@ Capabilities (callable as `mcp__gmaps__<tool>`):
|
||||
distance_matrix — travel time & distance between multiple origins/destinations
|
||||
|
||||
Auth:
|
||||
API key is read from env var GOOGLE_MAPS_API_KEY, or from the file at
|
||||
GOOGLE_MAPS_API_KEY_FILE (default: ./secrets/gmaps_api_key.txt).
|
||||
API key is read from env var GOOGLE_MAPS_API_KEY, injected by Skald from the
|
||||
connector's `env[]` form field. A file fallback (GOOGLE_MAPS_API_KEY_FILE)
|
||||
exists for standalone runs only.
|
||||
|
||||
Required Google Cloud APIs to enable:
|
||||
- Directions API
|
||||
@@ -81,8 +82,8 @@ def _get_client():
|
||||
if not api_key:
|
||||
_init_error = (
|
||||
"Google Maps API key not found. "
|
||||
"Set GOOGLE_MAPS_API_KEY env var or create secrets/gmaps_api_key.txt "
|
||||
"with just the key on the first line."
|
||||
"Open the Google Maps connector in Skald and paste the API key into "
|
||||
"the 'Google Maps API key' field, then re-enable it."
|
||||
)
|
||||
log(_init_error)
|
||||
return None
|
||||
@@ -119,7 +120,7 @@ def _format_gmaps_error(e: Exception, api_label: str) -> str:
|
||||
if status == "REQUEST_DENIED":
|
||||
return (
|
||||
f"Error: {api_label} API request denied (REQUEST_DENIED). "
|
||||
"Verify that the API key in secrets/gmaps_api_key.txt is valid and that "
|
||||
"Verify that the API key configured for this connector is valid and that "
|
||||
f"the {api_label} API is enabled in the Google Cloud Console."
|
||||
)
|
||||
if status == "INVALID_REQUEST":
|
||||
@@ -163,8 +164,9 @@ def _maps_status(args: dict) -> str:
|
||||
if not api_key:
|
||||
return (
|
||||
"Error: Google Maps API key not found. "
|
||||
"Set GOOGLE_MAPS_API_KEY env var or create secrets/gmaps_api_key.txt "
|
||||
"with the key on the first line. No Google Maps tool will work until this is fixed."
|
||||
"Ask the administrator to open the Google Maps connector in Skald and paste "
|
||||
"the API key into the 'Google Maps API key' field. "
|
||||
"No Google Maps tool will work until this is fixed."
|
||||
)
|
||||
|
||||
# Step 2: dependency present + client built?
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
googlemaps>=4.10.0
|
||||
@@ -12,6 +12,14 @@ import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Skald installs our deps with `pip install --target .pydeps` beside this file and
|
||||
# puts that dir on PYTHONPATH for the *server* process only — the verify step gets
|
||||
# a bare `sh -c "python3 verify.py"`, so `import googlemaps` would fail here even
|
||||
# on a correctly installed connector. Put .pydeps on sys.path ourselves.
|
||||
_PYDEPS = os.path.join(os.path.dirname(os.path.abspath(__file__)), ".pydeps")
|
||||
if os.path.isdir(_PYDEPS):
|
||||
sys.path.insert(0, _PYDEPS)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
api_key = os.environ.get("GOOGLE_MAPS_API_KEY", "").strip()
|
||||
|
||||
Reference in New Issue
Block a user