Ephasme/google-maps-mcp-server
3.1
If you are the rightful owner of google-maps-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project provides a minimal scaffolding for a Model Context Protocol (MCP) server that exposes Google Maps tools using Node.js and TypeScript.
Tools
3
Resources
0
Prompts
0
Google Maps MCP Server (TypeScript, ESM)
- Purpose: Minimal scaffolding for a Model Context Protocol (MCP) server exposing Google Maps tools (geocode, places search, directions).
- Stack: Node.js (ESM), TypeScript, ESLint, Prettier.
Prerequisites
- Node.js >= 18.17
- A Google Maps API key with access to Geocoding, Places, and Directions APIs
Setup (pnpm)
- Enable Corepack (recommended, Node >= 18 ships with it):
corepack enable - Optionally pin pnpm via Corepack:
corepack prepare pnpm@latest --activate - Copy
.env.exampleto.envand setGOOGLE_MAPS_API_KEY. - Install dependencies:
pnpm install - Build:
pnpm build - Start (stdio MCP server):
pnpm start
The server exposes three MCP tools:
- geocode:
{ address: string } - places_search:
{ query: string } - directions:
{ origin: string, destination: string, mode?: 'driving'|'walking'|'bicycling'|'transit' }
These tools call Google Maps REST endpoints and return JSON responses.
Scripts (pnpm)
pnpm dev: Watch and run withtsx(development)pnpm build: Compile TypeScript todist/pnpm start: Run compiled server fromdist/index.jspnpm lint/pnpm lint:fix: ESLintpnpm format/pnpm format:check: Prettier
Project Structure
src/index.ts: MCP server setup and tool registrationsrc/googleMaps.ts: Thin client wrappers for Google Maps APIsdist/: Compiled output (gitignored)
Notes
- This is a skeleton: adjust tool shape and responses as needed for your MCP client.
- Ensure relevant Google Maps APIs are enabled in your Google Cloud project.