Connect to the Developer Knowledge MCP server

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_document or batch_get_documents with the parent from search results to get full page content.
get_document Gets the full content of a document using the parent from a search_documents result.
batch_get_documents Gets the full content of multiple documents using parents from search_documents results.

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_document or batch_get_documents with the parent provided in search results to retrieve full page content.

Installation

The Google Developer Knowledge MCP server is a remote MCP server. Connect to it by creating a Developer Knowledge API key, enabling the server, and configuring your AI application.

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 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.
  2. Click Create credentials, and then select API key from the menu. The API key created dialog displays the string for your newly created key.
  3. Click Edit API key.
  4. In the Name field, provide a name for the key.
  5. Under API restrictions, select Restrict key.
  6. From the Select APIs list, enable Developer Knowledge API and click OK.
  7. Click Save.

After the key is created, click Show key to view it. Make a note of it for use when configuring your AI application.

gcloud CLI

  1. If you haven't already, download and install the gcloud CLI.
  2. Enable the Developer Knowledge API, replacing PROJECT_ID 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 an API key string. Make a note of it for use when configuring your AI application.

  4. Secure your API key by adding API key restrictions. For better security, restrict the API key to the Developer Knowledge API.

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

To enable the Developer Knowledge MCP server in your Google Cloud project, download and install the gcloud CLI, and then run the following command:

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

Replace PROJECT_ID with your Google Cloud 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.

Step 3: Configure your AI application

Configure popular AI applications using these instructions. Replace YOUR_API_KEY with the Developer Knowledge API key you generated in the previous step:

Antigravity

To configure Antigravity to use the MCP server:

  1. In Antigravity, click the menu in the Agent pane > MCP Servers > Manage MCP Servers.
  2. In the Manage MCPs pane that opens, click View raw config to edit the mcp_config.json file:

    {
        "mcpServers": {
          "google-developer-knowledge-mcp": {
            "serverUrl": "https://developerknowledge.googleapis.com/mcp",
            "headers": {
              "X-Goog-Api-Key": "YOUR_API_KEY"
            }
          }
        }
      }
    
  3. Return to Manage MCP servers and click Refresh.

Gemini CLI

To configure Gemini CLI, create the configuration file: ~/.gemini/extensions/developerknowledge/gemini-extension.json.

{
    "name": "DeveloperKnowledge",
    "version": "1.0.0",
    "mcpServers": {
      "DeveloperKnowledge": {
        "httpUrl": "https://developerknowledge.googleapis.com/mcp",
        "headers": {
          "X-Goog-Api-Key": "YOUR_API_KEY"
        }
      }
    }
}

Gemini Code Assist

To configure Gemini Code Assist, edit or create one of the following configuration files:

  • In your project: .gemini/settings.json
  • In your home directory: ~/.gemini/settings.json
{
    "mcpServers": {
      "google-developer-knowledge-mcp": {
        "httpUrl": "https://developerknowledge.googleapis.com/mcp",
        "headers": {
          "X-Goog-Api-Key": "YOUR_API_KEY"
        }
      }
    }
}

Firebase Studio

To configure Firebase Studio, edit or create the configuration file: .idx/mcp.json.

Note: If the file doesn't yet exist, create it by right-clicking the parent directory and selecting New file.

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

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-mcp": {
        "url": "https://developerknowledge.googleapis.com/mcp",
        "headers": {
          "X-Goog-Api-Key": "YOUR_API_KEY"
        }
      }
    }
}

GitHub Copilot in VS Code

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

{
    "servers": {
      "google-developer-knowledge-mcp": {
        "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. Click the Open Settings (JSON) button.

{
    "mcp": {
      "servers": {
        "google-developer-knowledge-mcp": {
          "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-mcp": {
        "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 for information about which documents are searched by the server.

Known limitations

  • Content Scope: Only publicly visible pages on the 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.

Troubleshooting

If you encounter issues, verify the following:

Model Armor

If you are using Model Armor 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.