Before you begin
Before you begin, you need to complete the following steps:
- Complete at least one of the following quickstarts to ensure that you have set up a Google Cloud project and enabled the Agent Platform API:
- Have an AI-powered development tool installed and configured to connect to the Developer Knowledge MCP server. Examples include Antigravity, Gemini CLI, or Gemini Code Assist in your IDE. This connection allows your tool to search and retrieve information from Google's official developer documentation.
- Install the Gen AI SDK for your preferred language.
Connect to the Developer Knowledge MCP server
To let your AI assistant retrieve real-time information from Google's
developer documentation, configure the connection to the
Developer Knowledge MCP server.
The specific steps vary depending on the tool (for example,
Gemini CLI, VS Code with Gemini Code Assist, or
Cursor) but generally involve updating a configuration file for your tool to
include the server URL (https://developerknowledge.googleapis.com/mcp) and
the necessary authentication method.
You can authenticate using Application Default Credentials (ADC) or an API key from your Google Cloud project. ADC is the recommended authentication method for Google Cloud services. See Choose an authentication method in the Developer Knowledge MCP server documentation for instructions on how to configure ADC.
Alternately, if you prefer authenticating using an API key but don't have an
API key, then see
Create an API key.
Then, run the following command to configure Gemini CLI,
replacing YOUR_API_KEY with your API key:
gemini mcp add -t http -H "X-Goog-Api-Key: YOUR_API_KEY" google-developer-knowledge https://developerknowledge.googleapis.com/mcp --scope user
See Connect to the Developer Knowledge MCP server for complete instructions for other tools and authentication methods.
Example prompts
Once your tool is connected to the Developer Knowledge MCP server, you can ask it for help as you write code with the Gen AI SDK. Here are some example prompts you can use with your configured AI tool:
"Using the Gen AI SDK in Python, how do I generate text with Gemini and handle potential API errors?"
"Show me the Gen AI SDK code for Node.js to call the Gemini API for summarizing a long document. What are the best practices for chunking input, according to the official documentation?"
"I'm encountering an authentication error with the Java Gen AI SDK when running on Cloud Run. What are the common causes and how can I troubleshoot?"
"Draft a Python function using the
google-genailibrary to stream responses from Gemini for a chat application.""What are the current rate limits I should be aware of when using the Gemini API using the Go Gen AI SDK? Find the specifics in the Google Cloud documentation."
Your AI tool uses the Developer Knowledge MCP server to provide answers and code snippets based on the official documentation.
What's next
- Explore advanced features of the Gen AI SDK.
- Dive deeper into the Gemini API documentation.
- Review Agent Platform pricing.
- Learn more about other tools available using the Developer Knowledge MCP server.