Skip to content

docs: add guide for MCP tool authentication and deployment #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lavinigam-gcp
Copy link
Collaborator

This PR addresses a significant documentation gap regarding the use of external, authenticated MCP servers with ADK.

The Problem

Currently, there is no documentation explaining how to pass authentication credentials (e.g., Bearer tokens) to a remote MCP server. While the underlying ADK framework supports this via the standard auth_scheme and auth_credential parameters on MCPToolset, this is not documented anywhere. This leaves users unable to integrate with secured, real-world MCP services.

Additionally, there is no guidance on how to deploy agents that use MCP tools to cloud environments like Cloud Run or Agent Engine, which presents challenges with process management and service-to-service authentication.

The Solution

This PR introduces a comprehensive solution:

  1. New Guide: A new page, docs/tools/mcp-authentication.md, is created to serve as the single source of truth for this topic.
  2. Code Example: A complete, runnable code example is added (agent_with_auth.py and mock_mcp_server.py), to demonstrate the pattern clearly.
  3. Updated MCP Docs: The main mcp-tools.md page is updated to link to the new guide and modernize its connection parameter examples.
  4. Updated Auth Docs: The core authentication.md page is updated to list MCPToolset as a supported tool for the ADK auth framework.
  5. Updated Deployment Docs: Both the cloud-run.md and agent-engine.md guides are updated with new sections on best practices for deploying agents with MCP dependencies.

This change provides a clear, documented path for users to securely integrate ADK with external MCP tools and confidently deploy their agents to production environments.

Addresses #466

@ypenn21
Copy link

ypenn21 commented Jul 18, 2025

can you specify the dependencies that need to be installed?? I am having issues with imports:

from google.adk.auth import HttpAuth, HttpCredentials

from google.adk.auth.auth_schemes import HTTPBearer

my dependencies:

dependencies = [
"google-adk==1.6.1",
"python-dotenv==1.1.0",
"toolbox-core==0.1.0",
"gunicorn",
"whitenoise[brotli]",
"django>=5.0,<5.3",
"google-generativeai>=0.8.5",
"psycopg2-binary",
]

@polong-lin
Copy link
Collaborator

@lavinigam-gcp Could you PTAL at the merge conflict?

@enxilium
Copy link

enxilium commented Aug 5, 2025

can you specify the dependencies that need to be installed?? I am having issues with imports:

from google.adk.auth import HttpAuth, HttpCredentials

from google.adk.auth.auth_schemes import HTTPBearer

my dependencies:

dependencies = [ "google-adk==1.6.1", "python-dotenv==1.1.0", "toolbox-core==0.1.0", "gunicorn", "whitenoise[brotli]", "django>=5.0,<5.3", "google-generativeai>=0.8.5", "psycopg2-binary", ]

Same here, the imports don't seem to exist in the current version of the ADK.

@tpryan
Copy link
Member

tpryan commented Aug 9, 2025

Repinnging @lavinigam-gcp to take a look at the merge conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants