DEV Community

Evan Lin for Google Developer Experts

Posted on • Originally published at evanlin.com on

[Gemini CLI] Google Developer Knowledge API and MCP Server: Equipping Your AI Assistant with an Official Knowledge Base

iTerm2 2026-02-08 01.24.09

References:

Background

Remember last week when I was integrating the Gemini API using the Gemini CLI, and it confidently told me, "This is how you use this API parameter." But after running it, I got a bunch of errors. It turned out that Google had changed the API format three months ago. This isn't the AI's fault; its training data cutoff date is what it is. Faced with ever-changing technical documentation, even the strongest models will "become outdated."

Typical scenarios we've encountered in the past:

Developer: "Gemini, help me write an example of Gemini Function Calling"
AI: "Okay, you can write it like this..." [Generates code based on June 2024 documentation]
Developer: [Copy and paste, execute]
Terminal: ❌ Error: Parameter 'tools' format has changed in v2
Developer: 😤 "I have to go look at the official documentation again..."

Enter fullscreen mode Exit fullscreen mode

Are you familiar with this cycle? Even Gemini 1.5 Pro sometimes gives outdated suggestions because its own API updates too quickly. AI's knowledge is static, but technical documentation is dynamic, and this contradiction has always troubled us.

To completely solve this problem, Google released two major killer tools in early 2025:

  • Developer Knowledge API - A machine-readable official documentation API
  • Knowledge MCP Server - A real-time document query service based on the Model Context Protocol

This means that your AI assistant is no longer just "remembering" how to write code, but can actively "consult the latest official documentation" when needed, becoming a development expert truly guaranteed by the official source and never outdated.

What is the Developer Knowledge API?

How AI used to learn documents: The dilemma of web crawlers

Traditionally, AI models learn documents by crawling web pages. But this method has several fatal problems:

❌ Noise Interference

<!-- Actual content seen by AI -->
<nav>...</nav> <!-- Navigation bar -->
<ad>...</ad> <!-- Advertisement -->
<cookie-banner>...</cookie-banner> <!-- Cookie prompt -->
<div class="content">
  <!-- The real document content only accounts for 30% -->
  This is how to use the Gemini API...
</div>
<footer>...</footer> <!-- Footer -->

Enter fullscreen mode Exit fullscreen mode

AI has to "guess" from this pile of HTML which is the real document content.

❌ Inconsistent Formatting

  • Some use <code> tags, some use <pre>
  • Some use Markdown rendering, some use custom syntax
  • Image descriptions may be in alt, title, or figcaption

❌ Update Delay

  • Crawlers may only crawl every few months
  • New API parameters have to wait for the next training to know
  • The training data cutoff date becomes a perpetual pain

Developer Knowledge API: A machine-first document system

Developer Knowledge API completely changes the game, it provides:

  • ✅ Machine-readable source of truth:
    • Directly provides pure Markdown format
    • No noise, no ads, no navigation bar
    • Structured metadata (author, update time, version)
  • ✅ Real-time:
    • Synchronized updates with Google's official documentation (delay < 1 hour)
    • When the API changes, the AI can immediately read the new documents
    • There will never be the problem of "outdated training data"
  • ✅ Comprehensive: It can directly retrieve and obtain documents from the following Google official domains. If your development field is related to these, it is strongly recommended to enable this MCP:
    • ai.google.dev
    • developer.android.com
    • developer.chrome.com
    • developers.home.google.com
    • developers.google.com
    • docs.cloud.google.com
    • docs.apigee.com
    • firebase.google.com
    • fuchsia.dev
    • web.dev
    • www.tensorflow.org

MCP Server: Making AI more "knowledgeable"

Model Context Protocol (MCP) is an open standard, which is like an "add-on slot" for AI tools. Google's Knowledge MCP Server, launched this time, allows various tools that support MCP (such as Claude Code, Cursor, and even our favorite Gemini CLI) to easily integrate.

Through this MCP Server, AI no longer just writes code from memory, but can "consult the books" for specific questions:

  • Implementation guidance: Ask for the best implementation method for a new feature.
  • Troubleshooting: Diagnose directly based on the latest Error Code documentation.
  • Version comparison: Understand the differences between different versions of the API.

If you are interested in MCP applications in a specific field, I also shared in a previous article Google Maps Platform Assist MCP: Let AI help you write more accurate map applications, which is also a very powerful tool that can give AI assistants an advantage when developing map features.

Hands-on: Letting AI assistants import the official knowledge base

To enable AI assistants to read official documentation, we need to complete some simple preparations in Google Cloud.

Step 1: Enable the Developer Knowledge API

  1. Go to the Developer Knowledge API page in the Google API Library.
  2. Make sure you have selected the correct project.
  3. Click "Enable". This API does not require special IAM permissions to use.

Step 2: Create and protect your API key

For security, it is recommended to restrict the key:

  1. In the Google Cloud console, navigate to the "Credentials" page.
  2. Click "Create Credentials", then select "API key".
  3. Click "Edit API key".
  4. Enter a recognizable name in the name field (e.g., Dev-Knowledge-Key).
  5. Under "API restrictions", select "Restrict key".
  6. Select "Developer Knowledge API" from the API list, and then click OK.
  7. Click "Save".

After creation, click "Show Key" and write it down, this is the credential we will use next.

Google Chrome 2026-02-07 20.52.15

If you are using Claude Code or Gemini CLI, you can now make it stronger with a simple configuration.

Configuration Example (using Gemini CLI as an example)

You only need to add Google's MCP Server address to the settings and include your API Key:

# Add Google Developer Knowledge MCP Server
gemini mcp add -t http -H "X-Goog-Api-Key: YOUR_API_KEY" google-developer-knowledge https://developerknowledge.googleapis.com/mcp --scope user

Enter fullscreen mode Exit fullscreen mode

Once the configuration is complete, when you ask "how to use the latest Gemini API for Function Calling", the AI will actively call the MCP Server to retrieve the most accurate and up-to-date document content from the official website to answer you.

Analysis and Outlook: Why is this important?

The launch of this technology marks two major shifts in the development process:

  1. From "relying on memory" to "real-time query" In the past, we pursued making the model bigger and remembering more things. Now, we let the model learn to "look up information" through MCP. This not only greatly reduces hallucinations, but also reduces the pressure on the model to retrain frequently.

  2. More powerful development agents (AI Agents) When AI assistants can read documents, execute instructions, and perform version control, they truly evolve into "digital colleagues" who can handle tasks independently. The structured information provided by the Developer Knowledge API is the fuel that AI Agents need to perform complex reasoning.

Summary

This time, Google not only provides powerful models, but also provides excellent "data interfaces". For developers who pursue efficiency, configuring the Developer Knowledge MCP Server is definitely worth the 5 minutes of investment.

In the future, when writing code, the AI assistant is no longer just a machine that can write code, but a technical consultant who is always consulting the latest official documentation and giving you the most accurate advice. Why not apply for an API Key and try it out?

See you next time!

Top comments (0)