iTranslated by AI
Beyond llms.txt: Why I Switched to the Google Developer Knowledge API
What you can do with this article
You will be able to search only official Google documentation with a single API call.
Tell me how to deploy a container to Cloud Run
Via MCP, with just this request, your IDE will query the Developer Knowledge API and return five official documentation results. Even in environments where MCP cannot be used, you can obtain the same results by directly calling the REST API.
Before: Search for official documentation using web searches. Old information and unofficial articles get mixed in, making it difficult to reach the correct information.
After: Search using the Developer Knowledge API. Only official documentation is returned, and according to the official blog, it is re-indexed within 24 hours.
What is the Developer Knowledge API?
On February 4, 2026, Google announced the Developer Knowledge API and MCP Server as a Public Preview. In short, it is an API that allows AI to search official Google developer documentation directly.
Why isn't llms.txt enough?
llms.txt has become popular since late 2025. Many services, such as Cloudflare and Anthropic, have started providing it. Google also supports it for some areas:
- ✅
developer.chrome.com/docs/llms.txt - ✅
ai.google.dev/gemini-api/docs/llms.txt - ❌ Google Chat API → 404
- ❌ Cloud Run → 404
- ❌ Firebase → 404
I tried searching for llms.txt while investigating a bug in a Google Chat bot, but all 9 URLs I tried returned 404. Google's documentation is scattered across hundreds of subdomains, making it unrealistic to cover everything with llms.txt.
The answer provided by Google is the Developer Knowledge API. It spans over 11 Google domains and is automatically re-indexed.
Comparison with llms.txt
| Item | llms.txt | Developer Knowledge API |
|---|---|---|
| Format | Static text file | REST API + MCP Server |
| Update frequency | Manual update by the site | Automatic re-indexing |
| Search function | None (full-text download) | Searchable in natural language |
| AI integration | Injects files into context | Directly connected to IDE/Agents via MCP |
| Coverage | Site-by-site | Spans 11+ Google domains |
| Cost | Free | Free (Public Preview) |
Setup: Direct REST API Usage
The most reliable method as of March 2026. No MCP configuration is required; it works as long as you have an API key.
Step 1: Enable the API
Enable the Developer Knowledge API in the Google Cloud Console.
# gcloud services enable: Command to enable the specified API in the project
gcloud services enable developerknowledge.googleapis.com --project=YOUR_PROJECT_ID
Step 2: Create an API Key
# api-keys create: Creates a new API key. You can restrict available APIs with --api-target
gcloud services api-keys create --project=YOUR_PROJECT_ID \
--display-name="DK API Key" \
--api-target=service=developerknowledge.googleapis.com
The key string included in the command output will be your API_KEY.
Step 3: Verification
# Replace YOUR_API_KEY with the key string obtained in Step 2
curl -s "https://developerknowledge.googleapis.com/v1alpha/documents:searchDocumentChunks?query=Firestore&key=YOUR_API_KEY"
Response:
{
"results": [
{
"parent": "documents/docs.cloud.google.com/firestore/...",
"id": "c1",
"content": "..."
}
],
"nextPageToken": "..."
}
If the content of the official documentation is returned in the results array, it is a success.
Use Case: Automatic Tech Watch
A script to regularly check for deprecations or changes in the services you are using.
#!/bin/bash
# Extract the API key value from the .env file
API_KEY="$(grep DEVELOPERKNOWLEDGE_API_KEY .env | cut -d= -f2)"
QUERIES=(
"Gemini model deprecation and migration guide"
"Google Chat API updates and changes"
"Cloud Run new features and updates"
"Firestore new features and best practices"
)
for q in "${QUERIES[@]}"; do
encoded=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$q'))")
echo "=== $q ==="
curl -s "https://developerknowledge.googleapis.com/v1alpha/documents:searchDocumentChunks?query=${encoded}&key=${API_KEY}" \
| python3 -c "import sys,json; r=json.load(sys.stdin); [print(f' {x[\"parent\"]}') for x in r.get('results',[])[:3]]"
echo
done
Setup: Via MCP (Search Directly from IDE)
While the REST API is sufficient, using MCP allows you to call it in natural language from your IDE chat, such as "Search for X using Developer Knowledge." Here are the configuration methods for each tool.
Official Documentation: developers.google.com/knowledge/mcp
Prerequisites
In addition to the REST API setup, you need to enable the MCP Server:
# Enable the MCP Server (not required if using REST API only)
gcloud beta services mcp enable developerknowledge.googleapis.com --project=YOUR_PROJECT_ID
Gemini CLI
// ~/.gemini/settings.json
{
"mcpServers": {
"google-developer-knowledge": {
"httpUrl": "https://developerknowledge.googleapis.com/mcp",
"headers": {
"X-Goog-Api-Key": "YOUR_API_KEY"
}
}
}
}
Claude Code
claude mcp add google-dev-knowledge \
--transport http \
https://developerknowledge.googleapis.com/mcp \
--header "X-Goog-Api-Key: YOUR_API_KEY"
Cursor
// .cursor/mcp.json
{
"mcpServers": {
"google-developer-knowledge": {
"url": "https://developerknowledge.googleapis.com/mcp",
"headers": {
"X-Goog-Api-Key": "YOUR_API_KEY"
}
}
}
}
Antigravity (Via Firebase MCP)
Antigravity may not recognize httpUrl type MCP Servers. Instead, Firebase MCP wraps the Developer Knowledge API. Once the bug is fixed, you can use it with these steps:
- Install via
npm install -g firebase-tools - Search for "Firebase" in the Antigravity MCP Store and Install
- Restart Antigravity (MCP settings are only loaded at the start of a session)
- Specify the Active Project in chat:
Set the Active Project for Firebase to YOUR_PROJECT_ID
My Full Record of Troubleshooting
My custom Google Chat Bot was not responding to DMs. Even though Cloud Run was returning 200 normally, the Chat side displayed "No response." I let Antigravity investigate, but it just looped through code fixes, deployment, and testing for three days without finding the cause. Thinking "if I could pull up the official documentation precisely, I could solve this," I began setting up the Developer Knowledge API, but got stuck for another day.
Tested 9 llms.txt and All Failed
To investigate why the Google Chat bot wasn't responding to DMs, I first looked for llms.txt.
URLs tested (all 404):
- developers.google.com/workspace/chat/llms.txt
- developers.google.com/workspace/chat/docs/llms.txt
- cloud.google.com/run/docs/llms.txt
- cloud.google.com/run/docs/llms-full.txt
- cloud.google.com/docs/llms.txt
- firebase.google.com/llms.txt
- developers.google.com/workspace/docs/llms.txt
- developers.google.com/chat/api/docs/llms.txt
- developers.google.com/apps-script/docs/llms.txt
Total failure. That's when I learned about the existence of the Developer Knowledge API.
403 with API Key, "not found" in MCP, Wrong Config File
This was the start of a flurry of troubleshooting.
First, when I called it with an existing API key, I got API_KEY_SERVICE_BLOCKED. The cause was that I was using a key from a gen-lang-client-* project automatically generated by AI Studio. I resolved this by recreating the key in my own project.
Next, I wrote the MCP configuration in ~/.gemini/settings.json but got server name not found. After worrying for several hours, I realized — Antigravity reads ~/.gemini/antigravity/mcp_config.json, not settings.json. Furthermore, it gives no error even if the settings are empty. It fails silently.
| Tool | Configuration File |
|---|---|
| Gemini CLI | ~/.gemini/settings.json |
| Antigravity | ~/.gemini/antigravity/mcp_config.json |
Determining "Is the Server or Client at Fault?"
Even after fixing mcp_config.json, I still got server name not found. I stopped changing settings blindly and changed my approach to separating the server-side from the client-side. I tried calling the MCP protocol directly from PowerShell:
$body = '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{
"protocolVersion":"2024-11-05",
"capabilities":{},
"clientInfo":{"name":"test","version":"1.0"}}}'
Invoke-RestMethod -Uri "https://developerknowledge.googleapis.com/mcp" `
-Method POST -ContentType "application/json" `
-Headers @{"X-Goog-Api-Key"="YOUR_API_KEY"} -Body $body
{
"result": {
"serverInfo": { "name": "StatelessServer", "version": "ESF" },
"protocolVersion": "2024-11-05"
}
}
The server side was perfectly normal. Calling tools/list also returned search_document_chunks and batch_get_documents. The problem was on the Antigravity side.
When an MCP Server "fails to connect," the ironclad rule is to separate the server and client. If you call the MCP protocol directly, verifying the server side only takes 3 minutes.
Breakthrough with Firebase MCP
If the httpUrl type didn't work, I looked for another route. After installing Firebase MCP via the MCP Store and restarting Antigravity, developerknowledge_search_documents was included in the tool list. Firebase MCP was wrapping the Developer Knowledge API.
However, there was another struggle with the Active Project:
# Try three gen-lang-client-* -> all fail
firebase_update_environment(active_project="gen-lang-client-XXXXXXXXXX")
→ 403: "Project has been deleted" 💀
firebase_update_environment(active_project="gen-lang-client-YYYYYYYYYY")
→ 403: "Project has been deleted" 💀
# Finally succeeded with my own project
firebase_update_environment(active_project="YOUR_PROJECT_ID")
→ Success ✅ — Got 5 official documents
Looking at the results, I was surprised. I had assumed that "Workspace documents (Chat API) are not included in the corpus," but Chat API documentation was indexed normally. The 0-result count was entirely due to issues with the API key and project settings.
If 0 results are returned, suspect the configuration, not the corpus. You can check the target domains in the official corpus reference.
Pinpointing the Chat Bot Bug with Developer Knowledge API

4 days of "No response" → Identified cause with Developer Knowledge API → Finally responded
Since the MCP connection was complete, I used it on the main issue: the Chat Bot not responding.
I searched for "Google Workspace Add-ons Chat response format," and 5 official documents were returned. The correct Add-on response format was written in one of them:
// ❌ My code
{"renderActions": {"hostAppAction": {"chatDataAction": ...}}}
// ✅ Official document
{"hostAppDataAction": {"chatDataAction": {"createMessageAction": {"message": {...}}}}}
Root cause: The top-level key name was hostAppDataAction, not renderActions.hostAppAction. One word difference caused the Chat to stop responding.
After correcting it and redeploying via Cloud Run MCP, the Chat Bot finally responded.
Looking back, the flow was:
- Issue occurred where the Chat Bot couldn't communicate two-way.
- Investigated via Antigravity → code fix → deploy to Cloud Run → test in Chat → "No response," loop for 3 days.
- Tried to use Developer Knowledge API and got stuck for another day due to configuration issues.
- The moment the Developer Knowledge API worked, identified the root cause in minutes.
Developer Knowledge API taught me the one-word difference in the key name that I couldn't find in 4 days within minutes. While I couldn't reach the correct part of the official documentation via web search, Developer Knowledge API returned it precisely just by asking "Add-ons Chat response format." This is the strength of a "search-type API" that llms.txt lacks.
There was an additional benefit. By installing Cloud Run MCP, I became able to use deploy-local-folder (directly deploy local folders) and get-service-log (log retrieval), allowing investigations and deployments to be completed within the Antigravity chat.
Future Outlook
Since this is in Public Preview, the following are promised in the official blog for the GA (General Availability) release:
- Addition of support for structured content (code samples, API references)
- Expansion of the corpus (more Google developer documentation)
- Improvement in re-indexing latency
It is free during Public Preview. The pricing structure after GA has not been announced (please check the official blog for the latest information).
Summary
-
The Developer Knowledge API is the best choice for Google documentation search —
llms.txtcannot handle Google's domain distribution. The Developer Knowledge API can perform cross-domain searches across 11+ domains. - Direct REST API usage is most reliable — It works as long as you have an API key. MCP-based connection can be prone to trouble depending on the environment (as of March 2026).
- If 0 results are returned, suspect the configuration, not the query — In the author's verification, almost every query returned 5 results. The cause for 0 results is always an API key, project setting, or parsing error.
- When MCP doesn't connect, separate the server and client — If you call the MCP protocol directly and verify the server side, you won't be swayed by wrong config files or unsupported types.
Discussion