The Google Developer Knowledge MCP server gives AI-powered development tools
the ability to search Google's official developer documentation and retrieve
information for Google's products such as Firebase, Google Cloud,
Android, Maps, and more. By connecting your AI application straight to our
official library of documentation, it ensures the code and guidance you receive
are up-to-date and based on authoritative context.

After you set up the server, integrated tools can assist with requests such as:

- **Implementation guidance**

  - For example: *What's the best way to implement
    push notifications using Firebase Cloud Messaging in an Android app?*
- **Code generation and explanation**

  - For example: *Search the Google documentation for a Python example to list
    all buckets in a Cloud Storage project.*
- **Troubleshooting and debugging**

  - For example: *Why is my Google Maps API
    key showing a 'For development purposes only' watermark?*
- **Comparative analysis and summarization**

  - For example: *Help me choose between Cloud Run and
    Cloud Functions for a new microservice. Create a Markdown table that
    compares key aspects like primary use case, concurrency, and pricing model.*

## MCP server capabilities

The Google Developer Knowledge MCP server provides the following tools to
your AI application:

| Tool name | Description |
|---|---|
| `search_documents` | Searches Google's developer documentation (Firebase, Google Cloud, Android, Maps, and more) to find relevant pages and snippets for your query. Use `get_documents` with the `parent` from search results to get full page content. |
| `get_documents` | Gets the full content of multiple documents using `parent`s from `search_documents` results. |
| `answer_query` | *(Preview)* Answers queries using the [Developer Knowledge corpus](https://developers.google.com/knowledge/reference/corpus-reference) for grounded generation. |

The `search_documents` tool divides documentation into smaller chunks of text
that are optimized for AI-powered search and retrieval. When you search, the
tool returns one or more document snippets that are relevant to your query. If
you need to view the full page content that surrounds a snippet, use
`get_documents` with the `parent` provided in search results to retrieve full
page content.

Use the `answer_query` tool when you want a direct answer to a question
synthesized from the
[Developer Knowledge corpus](https://developers.google.com/knowledge/reference/corpus-reference), rather
than a list of relevant snippets or full documents.

## Installation

The Google Developer Knowledge MCP server is a remote MCP server that uses the
[Developer Knowledge API](https://developers.google.com/knowledge/api) to search and retrieve documentation.
You can authenticate using either [OAuth](https://developers.google.com/knowledge/mcp#oauth) or an [API key](https://developers.google.com/knowledge/mcp#api-key).

> [!NOTE]
> **Note:** Not all AI applications are compatible with each authentication method. If you don't see your preferred application listed in the configuration section, try using another supported authentication method.

## Authenticate using OAuth

This section guides you through the process of authenticating your AI
application with the Developer Knowledge MCP server using OAuth.

### Prerequisite: Set up the Google Cloud CLI

Before proceeding, make sure you have:

- [A Google Cloud project](https://developers.google.com/workspace/guides/create-project)
- [A local installation of the gcloud CLI](https://cloud.google.com/sdk/docs/install)

### Step 1: Enable the Developer Knowledge API in a project

1. Open the [Developer Knowledge API page](https://console.cloud.google.com/start/api?id=developerknowledge.googleapis.com) in the Google APIs library.
2. Check that you have the correct project selected in which you intend to use the API.
3. Click **Enable**. No specific IAM roles are required to enable or use the API.

### Step 2: Choose your authentication method

The authentication method you choose depends on whether your AI assistant
supports [Application Default Credentials
(ADC)](https://docs.cloud.google.com/docs/authentication/application-default-credentials)
using the gcloud CLI or requires
a standalone OAuth Client ID. Assistants that support ADC can use your existing
Google Cloud login for a seamless setup, while others require
you to manually create and provide your own credentials to
establish a secure connection.

Select the tab that corresponds to your specific AI assistant's setup
requirements.

### ADC

#### Connect your account

1. To grant the MCP server the ability to act on your behalf, run the
   following command, replacing <var translate="no">PROJECT_ID</var> with your
   Google Cloud project ID:

       gcloud auth application-default login
       --project=PROJECT_ID

2. When prompted, choose an account, then click **Continue**.

#### Configure your AI application

Once authenticated, the final step is to configure your AI application to
connect to the MCP server.

- **Google Antigravity**:

  1. Click the **Additional options** menu in the Agent pane \> **MCP Servers**
  2. Search for the **Google Developer Knowledge** MCP server.
  3. Click the **Install** icon to install the server. The required JSON configuration is added automatically.
- **Other AI coding agents**:
  To configure other MCP-capable AI coding agents, you can manually add
  the server configuration to your tool's settings. While the exact JSON
  structure varies by application, you can use the following example as a
  template:

      {
        "mcpServers": {
          "google-developer-knowledge": {
            "httpUrl": "https://developerknowledge.googleapis.com/mcp",
            "authProviderType": "google_credentials",
            "oauth": {
              "scopes": [
                "https://www.googleapis.com/auth/cloud-platform"
              ]
            },
            "timeout": 30000,
            "headers": {
              "X-goog-user-project": "PROJECT_ID"
            }
          }
        }
      }

To check whether the MCP server is working as expected, continue on to [verify installation](https://developers.google.com/knowledge/mcp#verify-installation).

### Manual Credentials

#### Configure the OAuth consent screen

Configure the project's OAuth consent screen and add yourself as a test
user. If you've already completed this step for your
Google Cloud project, skip to the next step.

1. Open the [Google Cloud console Auth overview page](https://console.cloud.google.com/auth/overview?project=_), and click **Get started**.
2. Enter an **App name** , select your **Support email** , and click **Next**.
3. Within **Audience** , select **External** , and click **Next**.
4. Enter your email address within **Contact information** , and click **Next**.
5. Review and agree to the Google API Services: User Data Policy, and then click **Continue**.
6. Click **Create**.

#### Add test users

1. In the Google Auth Platform, click [**Audience**](https://console.cloud.google.com/auth/audience?project=_).
2. Under **Test users** , click **Add users**.
3. Enter your email address and any other authorized test users, then click **Save**.

#### Create an OAuth client

To authenticate as an end user and access user data in your app, you need to
create an OAuth 2.0 Client IDs. A client ID is used to identify a
single app to Google's OAuth servers.

1. In the Google Auth Platform, click [**Clients**](https://console.cloud.google.com/auth/clients?project=_).
2. Click **Create client**.
3. From the **Application type** selector, choose **Desktop app**.
4. In the **Name** field, type a name for the credential. This name is only shown in the Google Cloud console.
5. Click **Create**. The OAuth client created screen appears, showing your new Client ID and Client secret.
6. Click **OK** . The newly created credential appears under **OAuth 2.0 Client IDs**.
7. Click your newly created client ID. In the **Client secrets** section, click the download icon to save the JSON file. You'll use the `client_id` and `client_secret` values in this file in a [subsequent step](https://developers.google.com/knowledge/mcp#configure-creds).

#### Configure your AI application

Next, you need to provide your AI application with
the server configuration details. While the exact series of steps varies by
application, you can use the following example as a template.

- **Google Antigravity** :
  1. Click the **Additional options** menu in the Agent pane \> **MCP Servers**
  2. Search for the **Google Developer Knowledge** MCP server.
  3. Click the **Install** icon to install the server. The required JSON configuration is added automatically.
- **Other AI coding agents**:
  To configure other MCP-capable AI coding agents, you can manually add
  the server configuration to your tool's settings. While the exact JSON
  structure varies by application, you can use the following example as a
  template:

      {
        "mcpServers": {
          "google-developer-knowledge": {
            "httpUrl": "https://developerknowledge.googleapis.com/mcp"
          }
        }
      }

#### Add OAuth credentials

The first time you attempt to use the Developer Knowledge MCP server, your AI assistant will
prompt you to complete setup:

1. Ask the agent to use the Developer Knowledge MCP server with a prompt such as:

       How do I list Cloud Storage buckets?

2. If you see a message asking you to register one or more redirect URIs,
   click the option to proceed. Because you set up the client ID as a
   Desktop app, there's no need to add these specific URIs in the
   Google Auth Platform.

3. When your AI assistant prompts you for the **Client ID** and
   **Client Secret** , paste each corresponding key from the client
   secret JSON file you saved [earlier](https://developers.google.com/knowledge/mcp#oauth-client-setup).

4. When prompted, choose an account, then click **Continue**.

5. Return to your AI assistant. The agent will now process your request
   using the newly authenticated server.

## Authenticate using an API key

This section guides you through the process of authenticating your AI
application with the Developer Knowledge MCP server using an API key.

> [!NOTE]
> **Note:** Check our dedicated codelab on how to [set up the MCP server in Google Antigravity](https://codelabs.developers.google.com/developer-knowledge-mcp-antigravity).

### Step 1: Create an API key

You can generate a Developer Knowledge API key in your Google Cloud project
using either the Google Cloud console or the
gcloud CLI:

### Google Cloud Console

#### Enable the API

1. Open the [Developer Knowledge API page](https://console.cloud.google.com/start/api?id=developerknowledge.googleapis.com) in the Google APIs library.
2. Check that you have the correct project selected in which you intend to use the API.
3. Click **Enable**. No specific IAM roles are required to enable or use the API.

#### Create and secure the API key

1. In the Google Cloud console for the project in which you enabled the API, go to the [Credentials page](https://console.cloud.google.com/apis/credentials).
2. Click **Create credentials** , and then select **API key** from the menu.
3. In the **Name** field, provide a name for the key.
4.
   Click the **Select API restrictions** drop-down, and then type
   **Developer Knowledge API** . Click the result, and then click
   **OK**.

   **Notes:**
   - If you just enabled the Developer Knowledge API, there may be a delay before it appears in the list. Wait a few minutes and try again.
   - If you plan to use this same key for your AI client's general model calls (for example, `GEMINI_API_KEY`), you must also select **Generative Language API**. Otherwise, those calls will be blocked.
5. Click **Create**.

After the key is created, click **Show key** to view it. Make a note of it for
use when [configuring your AI application](https://developers.google.com/knowledge/mcp#config-api).

### gcloud CLI

1. If you haven't already, [download and install the gcloud CLI](https://docs.cloud.google.com/sdk/docs/install-sdk).
2. Enable the Developer Knowledge API, replacing <var translate="no">PROJECT_ID</var> with your
   Google Cloud project ID:

       gcloud services enable developerknowledge.googleapis.com --project=PROJECT_ID

3. Create an API key using the same Google Cloud project ID:

       gcloud services api-keys create --project=PROJECT_ID --display-name="DK API Key"

   This command returns two values to make a note of:
   - The `keyString` is your API key. You'll need this when [configuring your AI application](https://developers.google.com/knowledge/mcp#config-api).
   - The `name` is used in the next step when securing your key.
4. Restrict the key to the Developer Knowledge API, replacing <var translate="no">KEY_NAME</var>
   with the name of the key (for example,
   `projects/my-project/locations/global/keys/12345-67890`):

       gcloud services api-keys update KEY_NAME --api-target=service=developerknowledge.googleapis.com

   **Important:** If you plan to use this same key for your AI client's
   general model calls (for example, `GEMINI_API_KEY`), you must
   also allow the Generative Language API:

       gcloud services api-keys update KEY_NAME \
         --api-target=service=developerknowledge.googleapis.com \
         --api-target=service=generativelanguage.googleapis.com

> [!NOTE]
> **Note:** Quota usage of your private API key can be viewed and managed by going to the **IAM \& Admin** \> **Quotas \& System Limits** page in the Google Cloud console, selecting **Service** , and then selecting **[Developer Knowledge API](https://console.cloud.google.com/apis/api/developerknowledge.googleapis.com/quotas)** in the filter field.

### Step 2: Enable the Developer Knowledge MCP server in a project

> [!NOTE]
> **Note:** After March 17, the Developer Knowledge MCP server is automatically enabled when you enable the Developer Knowledge API.

To enable the Developer Knowledge MCP server in your Google Cloud project,
[download and install the
gcloud CLI](https://docs.cloud.google.com/sdk/gcloud#download_and_install_the),
and then run the following command, replacing
<var translate="no">PROJECT_ID</var> with your Google Cloud project ID:

    gcloud beta services mcp enable developerknowledge.googleapis.com --project=PROJECT_ID

If the Developer Knowledge service isn't enabled for your Google Cloud
project, you'll be prompted to enable the service before enabling the remote MCP
server.

As a security best practice, we recommend that you enable MCP servers only for
the services required for your AI application to function.

> [!TIP]
> **Tip:** If you encounter an error while running the `gcloud` command, run `gcloud components update beta` to update components, and then try again.

### Step 3: Configure your AI application

Configure popular AI applications using these instructions. Replace
<var translate="no">YOUR_API_KEY</var> with the Developer Knowledge API key you generated in
the previous step:

### Claude Code

To configure Claude Code, run the following command under your app folder.

    claude mcp add google-dev-knowledge --transport http https://developerknowledge.googleapis.com/mcp --header "X-Goog-Api-Key: YOUR_API_KEY"

### Cursor

To configure Cursor, edit either `.cursor/mcp.json` (for a specific project)
or `~/.cursor/mcp.json` (for all projects).

    {
      "mcpServers": {
        "google-developer-knowledge": {
          "url": "https://developerknowledge.googleapis.com/mcp",
          "headers": {
            "X-Goog-Api-Key": "YOUR_API_KEY"
          }
        }
      }
    }

### GitHub Copilot

To configure GitHub Copilot in VS Code for a single project, edit the
`.vscode/mcp.json` file in your workspace.

    {
      "servers": {
        "google-developer-knowledge": {
          "url": "https://developerknowledge.googleapis.com/mcp",
          "headers": {
            "X-Goog-Api-Key": "YOUR_API_KEY"
          }
        }
      }
    }

To make the server available in every project, edit your
[user settings](https://code.visualstudio.com/docs/getstarted/personalize-vscode).
Click the **Open Settings (JSON)** button.

    {
      "mcp": {
        "servers": {
          "google-developer-knowledge": {
            "url": "https://developerknowledge.googleapis.com/mcp",
            "headers": {
              "X-Goog-Api-Key": "YOUR_API_KEY"
            }
          }
        }
      }
    }

### Windsurf

To configure Windsurf Editor, edit the `~/.codeium/windsurf/mcp_config.json`
file.

    {
      "mcpServers": {
        "google-developer-knowledge": {
          "url": "https://developerknowledge.googleapis.com/mcp",
          "headers": {
            "X-Goog-Api-Key": "YOUR_API_KEY"
          }
        }
      }
    }

## Verify installation

Once configured, open your AI application and enter a prompt such as:

    How do I list Cloud Storage buckets?

If you see a tool call to `search_documents` or another Developer Knowledge MCP server tool, the
server is working correctly.

## Manage token usage

Retrieving document content--especially when using `batch_get_documents`--consumes
tokens within your AI application's context window. Because some Google
developer documentation pages are quite large, fetching multiple documents can
quickly lead to higher costs, slower model response times, and context window
overflow.

To optimize performance and avoid an unexpected bill, craft specific prompts
that target only the information you need. Avoid broad requests (for example,
"Compare all Firebase products") that force the agent to ingest massive
amounts of data at once.

## Included documentation

See [Corpus reference](https://developers.google.com/knowledge/reference/corpus-reference) for information
about which documents are searched by the server.

## Known limitations

- **Content Scope:** Only publicly visible pages on the [Corpus reference](https://developers.google.com/knowledge/reference/corpus-reference) are included. Content from other sources like GitHub, OSS sites, blogs, or YouTube is not included.
- **English-only results:** The server only supports results in English.
- **Network-dependent**: The server's tools rely on live Google Cloud services. If you experience persistent errors, check your internet connection and Developer Knowledge API key configuration.

## Optional security and safety configurations

MCP introduces new security risks and considerations due to the wide variety of
actions that you can do with the MCP tools. To minimize and manage these risks,
Google Cloud offers default settings and customizable
policies to control the use of MCP tools in your Google Cloud
organization or project.

For more information about MCP security and governance, see
[AI security and safety](https://docs.cloud.google.com/mcp/ai-security-safety).

### Use Model Armor

[Model Armor](https://docs.cloud.google.com/model-armor/overview) is a
Google Cloud service designed to enhance the security and
safety of your AI applications. It works by proactively screening LLM prompts
and responses, protecting against various risks and supporting responsible AI
practices. Whether you are deploying AI in your cloud environment, or on
external cloud providers, Model Armor can help
you prevent malicious input, verify content safety, protect sensitive data,
maintain compliance, and enforce your AI safety and security policies
consistently across your diverse AI landscape.

When Model Armor is enabled with
[logging enabled](https://docs.cloud.google.com/model-armor/configure-logging), Model Armor logs the entire
payload. This might expose sensitive information in your logs.

> [!CAUTION]
> **Caution:** Model Armor is available in [certain regions](https://docs.cloud.google.com/model-armor/locations). When Model Armor is enabled and you use an MCP server in a jurisdiction that Model Armor doesn't support, the routing behavior of the call might be different for different MCP servers. For more information about the behavior of individual MCP servers, see [Model Armor supported products](https://docs.cloud.google.com/mcp/model-armor-supported-products).

#### Enable Model Armor

Follow the steps in
[Integrate with Google and Google Cloud MCP servers](https://docs.cloud.google.com/model-armor/model-armor-mcp-google-cloud-integration)
to enable Model Armor.

#### Configure protection for Google and Google Cloud remote MCP servers

To help protect your MCP tool calls and responses you can use
Model Armor floor settings. A floor setting defines the minimum
security filters that apply across the project. This configuration applies a
consistent set of filters to all MCP tool calls and responses within
the project.

> [!TIP]
> **Tip:** Don't enable the prompt injection and jailbreak filter unless your MCP traffic carries natural language data.

Set up a Model Armor floor setting with MCP sanitization
enabled. For more information, see [Configure Model Armor floor
settings](https://docs.cloud.google.com/model-armor/configure-floor-settings).

> [!NOTE]
> **Note:** If the agent and the MCP server are in different projects, you can create floor settings in both projects (the client project and the resource project). In this case, Model Armor is invoked twice, once for each project.

See the following example command:

```bash
gcloud model-armor floorsettings update \
--full-uri='projects/PROJECT_ID/locations/global/floorSetting' \
--enable-floor-setting-enforcement=TRUE \
--add-integrated-services=GOOGLE_MCP_SERVER \
--google-mcp-server-enforcement-type=INSPECT_AND_BLOCK \
--enable-google-mcp-server-cloud-logging \
--malicious-uri-filter-settings-enforcement=ENABLED \
--add-rai-settings-filters='[{"confidenceLevel": "MEDIUM_AND_ABOVE", "filterType": "DANGEROUS"}]'
```

Replace `PROJECT_ID` with your project ID.

Note the following settings:

- <var translate="no">`INSPECT_AND_BLOCK`</var>: The enforcement type that inspects content for the Google MCP server and blocks prompts and responses that match the filters.
- <var translate="no">`ENABLED`</var>: The setting that enables a filter or enforcement.
- <var translate="no">`MEDIUM_AND_ABOVE`</var>: The confidence level for the Responsible AI - Dangerous filter settings. You can modify this setting, though lower values might result in more false positives. For more information, see [Model Armor confidence levels](https://docs.cloud.google.com/model-armor/overview#ma-confidence-levels).

#### Disable scanning MCP traffic with Model Armor

To stop Model Armor from automatically scanning traffic to and
from Google MCP servers based on the project's floor settings, run the following
command:

    gcloud model-armor floorsettings update \
      --full-uri='projects/PROJECT_ID/locations/global/floorSetting' \
      --remove-integrated-services=GOOGLE_MCP_SERVER

Replace `PROJECT_ID` with the project
ID. Model Armor doesn't automatically apply the rules defined in
this project's floor settings to any Google MCP server traffic.

Model Armor floor settings and general configuration can impact
more than just MCP. Because Model Armor integrates with services
like Vertex AI, any changes you make to floor settings can affect
traffic scanning and safety behaviors across all integrated services, not just
MCP.

#### Adjust Model Armor settings

If you're using
[Model Armor](https://docs.cloud.google.com/model-armor/overview)
to protect your application, you might encounter `403 PERMISSION_DENIED` errors
for some queries. Because the Developer Knowledge MCP server only returns public documentation from
trusted Google sources, we recommend setting Prompt Injection and Jailbreak
(PIJB) filters to `HIGH_AND_ABOVE` confidence levels to reduce false positives.
If your use case doesn't involve other tools that access private or sensitive
data, you can also consider disabling PIJB filters.

## Troubleshooting

If you encounter issues, verify the following:

- Your MCP configuration file for your AI tool is correctly formatted.
- If using the [API authentication method](https://developers.google.com/knowledge/mcp#api-key), you used a valid Developer Knowledge API key in your configuration file that [has the Developer Knowledge API enabled](https://developers.google.com/knowledge/mcp#create-api-key).
- You haven't exhausted your [Developer Knowledge API quota](https://developers.google.com/knowledge/quota).