@googlemaps/code-assist-mcp

中文文档
0.2.1发布于 2025/12/05ISCES Module近 30 天下载 7942

Google Maps Platform Code Assist MCP (Model Context Protocol) service

此软件包已被标记为弃用

The npm version of Code Assist is deprecated. It will be decommissioned on June 1, 2026. Please use the remote streamable HTTP version at https://mapscodeassist.googleapis.com/mcp

原始使用文档
文档目录17 节
  1. Description
  2. Benefits
  3. Tools Provided
  4. Supported MCP Transports
  5. Usage
  6. Requirements
  7. Use Code Assist as a Local MCP Server with stdio transport …
  8. Available Settings
  9. Port Configuration
  10. Source Configuration
  11. Local Streamable HTTP Guide
  12. When to Use Local Streamable HTTP
  13. Local Streamable HTTP Setup
  14. Testing Your Local Setup with cURL
  15. Use as a Remote MCP Server on Cloud Run with Streamable HTTP
  16. Terms of Service
  17. Support

npm Alpha License Discord Install MCP Server Try in Firebase Studio

Google Maps Platform Logo Google Maps Platform Code Assist Toolkit

Alpha version

Description

The Google Maps Platform Code Assist toolkit is a Model Context Protocol (MCP) server that enhances the responses from large language models (LLMs) used for developing applications with the Google Maps Platform by grounding the responses in the official, up-to-date documentation and code samples.

Since the MCP server accesses the content when the model is prompted, the LLM's context regarding Google Maps Platform does not have to be limited to the available data at the model's training date.

Google Maps Platform resources that the MCP server can access include:

  • Google Maps Platform Documentation
  • Google Maps Platform Terms of Service
  • Google Maps Platform Trust Center
  • Code repositories in Google Maps Platform official GitHub organizations

Benefits

  • Make your favorite AI assistant or IDE a Google Maps Platform expert. With Code Assist, AI Agents like Gemini CLI, Claude Code, and Cursor can generate code and answer developer questions grounded in up-to-date, official Google Maps Platform documentation and code samples -- directly in your dev workflow.

  • Whether you are making precision AI-Assisted code changes or vibecoding a new app prototype - Code Assist can help you accomplish your task faster and easier.

Below is an example MCP Client response to a user's question with Code Assist MCP installed:

[!NOTE] This is the repository for an MCP server that provides access to Google Maps Platform documentation via a RAG service. It is not a Google Maps Platform Core Service.


Tools Provided

The MCP server exposes the following tools for AI clients:

  1. retrieve-instructions: A helper tool used by the client to get crucial system instructions on how to best reason about user intent and formulate effective calls to the retrieve-google-maps-platform-docs tool.
  2. retrieve-google-maps-platform-docs: The primary tool. It takes a natural language query and submits it to a hosted Retrieval Augmented Generation (RAG) engine. The RAG engine searches fresh versions of official Google Maps Platform documentation, tutorials, and code samples, returning relevant context to the AI to generate an accurate response.

Supported MCP Transports

This server supports two standard MCP communication protocols:

  • stdio: This is the default transport used when a client invokes the server via a command. It communicates over the standard input/output streams, making it ideal for local command-line execution.
  • Streamable HTTP: The server exposes a /mcp endpoint that accepts POST requests. This is used by clients that connect via a url and is the standard for remote server connections. Our implementation supports streaming for real-time, interactive responses.

Usage

You can run the Code Assist MCP server either on your local development machine or remotely on Google Cloud Run.

Requirements

In order to use the Google Maps Platform Code Assist toolkit, you need an environment with Node.js (LTS version recommended) and npm installed in order to clone and run the server, as well as an MCP client to access the server.

Run the server on your local machine and connect clients using stdio protocol for use with AI-assisted IDEs (like VS Code, Android Studio, Cursor) or desktop AI applications (like Gemini CLI). This is the simplest and most common setup.

Configure Your Client

Add the server to your preferred AI client's MCP configuration file. Find your client below for specific, verified instructions.

  1. Gemini Code Assist & Gemini CLI

    • Option 1 - Add the server directly from your command line (assuming you have Gemini CLI already installed):
       gemini mcp add google-maps-platform-code-assist npx -y @googlemaps/code-assist-mcp@latest
      
      • Verify the installation by running gemini mcp list.
    • Option 2 - Install Code Assist MCP server as a Gemini CLI extension:
      gemini extensions install https://github.com/googlemaps/platform-ai.git
      
    • Option 3 - Add the MCP server config manually to your ~/.gemini/settings.json file.
    {
      "mcpServers": {
        "google-maps-platform-code-assist": {
          "command": "npx",
          "args": ["-y", "@googlemaps/code-assist-mcp@latest"]
        }
      }
    }
    
  2. Claude Code

    • Option 1 - Add the server directly from your command line (assuming you have Claude Code already installed):
          claude mcp add google-maps-platform-code-assist -- npx -y @googlemaps/code-assist-mcp@latest
      
      • Verify the installation by running claude mcp list.
      • Windows Users: On native Windows (not WSL), you must use the cmd /c wrapper for npx commands to work correctly.
      claude mcp add google-maps-platform-code-assist -- cmd /c "npx -y @googlemaps/code-assist-mcp@latest"
      
    • Option 2 - Add the sever manually to your Claude config file ~/.claude.json
    "mcpServers": {
        "google-maps-platform-code-assist": {
          "command": "npx",
          "args": [
            "-y", "@googlemaps/code-assist-mcp@latest"
          ]
        }
      }
    
  3. Cursor

    • Install MCP Server <-- If you already have Cursor installed, click here to install Google Maps Platform Code Assist MCP directly.
    • Otherwise, add it to your workspace's .cursor-settings/mcp.json file.
    {
      "mcpServers": {
        "google-maps-platform-code-assist": {
          "command": "npx",
          "args": ["-y", "@googlemaps/code-assist-mcp@latest"]
        }
      }
    }
    
  4. Firebase Studio

    • Try in Firebase Studio with Code Assist MCP installed
    • Add to your project's mcp.json file in the .idx folder in your Firebase Studio workspace
    {
      "mcpServers": {
        "google-maps-platform-code-assist": {
          "command": "npx",
          "args": ["-y", "@googlemaps/code-assist-mcp@latest"]
        }
      }
    }
    
  5. Android Studio

    • Create a mcp.json file and place it in the configuration directory of Android Studio. Add the Code Assist server to the list:
    {
      "mcpServers": {
        "google-maps-platform-code-assist": {
          "command": "npx",
          "args": ["-y", "@googlemaps/code-assist-mcp@latest"]
        }
      }
    }
    
  6. Cline

    • Option 1: install using the Cline MCP GUI
    • Option 2: manually / programatically install using the Cline MCP config file. The config file is located at:
      • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
      • Windows: %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
      • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
      • Add the following to your MCP configuration in cline_mcp_settings.json:
        {
          "mcpServers": {
            "google-maps-platform-code-assist": {
              "command": "npx",
              "args": ["-y", "@googlemaps/code-assist-mcp@latest"],
              "alwaysAllow": [
                "retrieve-instructions",
                "retrieve-google-maps-platform-docs"
              ]
            }
          }
        }
        
  7. Roo Code

    • Option 1: install using the Roo MCP GUI
    • Option 2: manually / programatically install using the Roo Code config file. The config file is located at:
      • macOS: ~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json
      • Windows: %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\mcp_settings.json
      • Linux: ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json
      • Add the following to your MCP configuration in mcp_settings.json:
        {
          "mcpServers": {
            "google-maps-platform-code-assist": {
              "command": "npx",
              "args": ["-y", "@googlemaps/code-assist-mcp@latest"],
              "alwaysAllow": [
                "retrieve-instructions",
                "retrieve-google-maps-platform-docs"
              ]            
            }
          }
        }
        
  8. Microsoft Copilot

    • When in Agent mode, Click "Tools" and then in the top header "Configure Tools" then "Install from an NPM package name" (See screenshots below)
    • image
    • image
    • image
    • Enter pacakge name @googlemaps/code-assist-mcp and ENTER, accepting the install and using the default port 3000, then ENTER one last time to confirm the change
    • image
  9. Windsurf

    • Similar to Cursor instructions above.
  10. Kilo Code

    • Similar to the Cline and Roo Code instructions above

Available Settings

Port Configuration

By default, the server runs on port 3000. You can specify a different port using the --port flag or a PORT environment variable. The --port flag takes precedence.

Example: Use port 5000

In your mcp.json:

"google-maps-platform-code-assist": {
  "command": "npx",
  "args": ["-y", "@googlemaps/code-assist-mcp@latest", "--port", "5000"]
}

Or with an environment variable:

"google-maps-platform-code-assist": {
  "command": "npx",
  "args": ["-y", "@googlemaps/code-assist-mcp@latest"],
  "env": {
    "PORT": "5000"
  }
}

If the specified port is unavailable, the server will automatically find and start on a random available port.

Source Configuration

You can specify a SOURCE environment variable to track the origin of the requests. The default value is github.

Example: Set source to my_company_name

In your mcp.json:

"google-maps-platform-code-assist": {
  "command": "npx",
  "args": ["-y", "@googlemaps/code-assist-mcp@latest"],
  "env": {
    "SOURCE": "my_company_name"
  }
}

Local Streamable HTTP Guide

For developers who need to integrate the Google Maps Platform Code Assist MCP server using the Streamable HTTP transport on their local machine, this guide provides setup instructions and testing steps.

When to Use Local Streamable HTTP

Use the local Streamable HTTP transport when:

  • Your client requires a URL-based connection instead of command execution
  • Your local development environment requires HTTP-based communication
  • You're building and testing custom integrations that communicate over HTTP

Local Streamable HTTP Setup

1. Start the Server

Run the MCP server locally, specifying a port:

npx -y @googlemaps/code-assist-mcp@latest --port 3215

The server will be available at http://localhost:3215/mcp.

2. Configure Your Client

Update your client's MCP configuration to connect to the local server URL.

Note: Check that the type parameter in your MCP configuration is set correctly for your specific client. For example, Roo Code uses "type": "streamable-http", while Cline uses "type": "streamableHttp".

Roo Code (VS Code Extension)

Add to mcp_settings.json:

{
  "mcpServers": {
    "google-maps-platform-code-assist": {
      "type": "streamable-http",
      "url": "http://localhost:3215/mcp",
      "alwaysAllow": [
        "retrieve-instructions",
        "retrieve-google-maps-platform-docs"
      ]
    }
  }
}

Cline (VS Code Extension)

Add to cline_mcp_settings.json:

{
  "mcpServers": {
    "google-maps-platform-code-assist": {
      "type": "streamableHttp",
      "url": "http://localhost:3215/mcp",
      "alwaysAllow": [
        "retrieve-instructions",
        "retrieve-google-maps-platform-docs"
      ]
    }
  }
}

Testing Your Local Setup with cURL

Verify your server is working correctly by sending an initialize request:

# Test server initialization
curl -X POST http://localhost:3215/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-03-26",
      "capabilities": {},
      "clientInfo": {"name": "test-client", "version": "1.0.0"}
    }
  }'

Expected Response: The server will respond with an SSE event containing its capabilities.

event: message
data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-03-26","capabilities":{"tools":{},"logging":{},"resources":{}},"serverInfo":{"name":"code-assist-mcp","version":"0.1.3"}}}

Use as a Remote MCP Server on Cloud Run with Streamable HTTP

Run the server on Google Cloud Run and connect to it from your local machine. This is useful if your client requires a remotely-hosted, streamable HTTP endpoint.

[!WARNING] These instructions secure the server so only you can access it with the proper IAM roles for your applications, MCP Clients, or Agents.

1. Prerequisites

Install the Google Cloud SDK and authenticate your account:

gcloud auth login
gcloud config set project YOUR_PROJECT_ID

2. Deploy to Cloud Run

This command deploys the server from this repository's source code and ensures it is not publicly accessible.

gcloud run deploy google-maps-code-assist-mcp --source . --no-allow-unauthenticated

When prompted, select a region (e.g., us-central1).

3. Connect Securely

Run a Cloud Run proxy on your local machine. This creates a secure tunnel from a local port to your remote server, authenticated with your gcloud identity.

gcloud run services proxy google-maps-code-assist-mcp --port=8999 --region=YOUR_REGION

Now, http://localhost:8999 on your machine securely connects to your Cloud Run service.

4. Configure Your Client

Update your client's MCP configuration to point to the local proxy.

  • Connect using the url attribute over Streamable HTTP:

    "google-maps-platform-code-assist": {
      "url": "http://localhost:8999/mcp",
      "type": //Either "streamableHttp" or "streamable-http", depending on your MCP client
    }
    

5. Connect GCP Services (Alternative to Local Proxy)

To connect another GCP service to the remotely deployed Cloud Run MCP server, such as an Agent Development Kit (ADK) agent on GCP Cloud Run or Vertex AI Agent Engine, you can connect the client directly to the remote MCP service over Streamable HTTP using the following IAM roles:

# Grant Cloud Run Invoker role to the service account
gcloud run services add-iam-policy-binding google-maps-code-assist-mcp \
 --member="serviceAccount:[email protected]" \
 --role="roles/run.invoker" \
 --region=YOUR_REGION

Now your GCP hosted app or agent can connect directly to the remotely hosted MCP server URL over Streamable HTTP.

6. Health Check Endpoint

This server implementation includes a standard /health endpoint. This is a best practice for services deployed on platforms like Cloud Run, which use it to check the server's operational status.

  • HTTP /health Endpoint: A simple GET request to this endpoint (e.g., https://your-service-url/health) will return a 200 OK status with a JSON payload containing the server status, number of active sessions, and a timestamp if the server is running. This is used for infrastructure-level health checks.
  • MCP ping Utility: This is different from the in-protocol ping utility defined by the MCP specification. The ping utility is a JSON-RPC request sent after a session is established to check the liveness of the protocol connection, whereas the /health endpoint checks the liveness of the HTTP server itself.

Terms of Service

This toolkit provides tools to describe the use of Google Maps Platform services. Use of Google Maps Platform services is subject to the Google Maps Platform Terms of Service, however, if your billing address is in the European Economic Area, the Google Maps Platform EEA Terms of Service will apply to your use of the Services. Functionality varies by region. Learn more.

This toolkit is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this repository or the RAG service called by it.

Support

This toolkit is offered via an open source license. It is not governed by the Google Maps Platform Support (Technical Support Services Guidelines, the SLA, or the Deprecation Policy). However, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service.

If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels. If you'd like to contribute, please check the contributing guide.

You can also discuss this toolkit on our Discord server.

版本与发布记录

@googlemaps/code-assist-mcp 共发布 10 个版本,首次发布于 2025/07/31;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.2.1latest2025/12/0511 个月前
0.2.02025/09/101.2 年前
0.1.72025/08/291.2 年前
0.1.62025/08/291.2 年前
0.1.52025/08/111.3 年前
0.1.42025/08/111.3 年前

关于 @googlemaps/code-assist-mcp 的常见问题

@googlemaps/code-assist-mcp 是什么?

Google Maps Platform Code Assist MCP (Model Context Protocol) service注意:该包已被作者标记为弃用——The npm version of Code Assist is deprecated. It will be decommissioned on June 1, 2026. Please use the remote streamable HTTP version at https://mapscodeassist.googleapis.com/mcp

如何安装 @googlemaps/code-assist-mcp?

在项目目录运行 npm install @googlemaps/code-assist-mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 code-assist-mcp,可以用 npx code-assist-mcp 直接运行。

@googlemaps/code-assist-mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/googlemaps__code-assist-mcp 是否存在。

@googlemaps/code-assist-mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@googlemaps/code-assist-mcp 可以商用吗?

@googlemaps/code-assist-mcp 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@googlemaps/code-assist-mcp 的下载量有多少?

根据 npm 官方下载统计,@googlemaps/code-assist-mcp 在 2026/10/17 – 2026/11/15 这 30 天内被下载 7,942 次,日均约 265 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@googlemaps/code-assist-mcp 还在维护吗?

最新版本 0.2.1 发布于 2025/12/05(11 个月前);至今共发布 10 个版本,其中过去 12 个月发布了 1 个;首次发布于 2025/07/31。作者已将其标记为弃用,新项目建议寻找替代方案。