MCP architecture, connection types, and production patterns.
Blog Post: https://arjunprabhulal.com/adk-mcp-deep-dive/
Model Context Protocol is a standardized way for AI agents to connect to external services and data sources. Key benefits:
- Standardized interface - One protocol for many services
- Dynamic tool discovery - Agents learn available tools at runtime
- Secure connections - Built-in authentication support
- Python 3.10+
- Gemini API key from AI Studio
- GitHub Personal Access Token
- Node.js (for Firecrawl MCP - optional)
- Navigate to this module:
cd 15-mcp-deep-dive- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install -r ../requirements.txt- Set up environment variables in
mcp_agent/.env:
GOOGLE_API_KEY=your-api-key-here
GITHUB_TOKEN=your-github-token
FIRECRAWL_API_KEY=your-firecrawl-api-key # Optional
| Type | Class | Use Case |
|---|---|---|
| HTTP | StreamableHTTPServerParams |
Cloud-hosted MCP servers (GitHub Copilot MCP) |
| Stdio | StdioConnectionParams |
Local process-based servers (npx tools) |
StreamableHTTPServerParams(
url="https://api.githubcopilot.com/mcp/",
headers={"Authorization": f"Bearer {token}"},
)StdioConnectionParams(
server_params=StdioServerParameters(
command="npx",
args=["-y", "firecrawl-mcp"],
),
)cd mcp_agent
python agent.pyTest Queries:
- "Explain MCP and its use in ADK"
- "Find ADK repositories on GitHub"
Continue to 16. Session, State & Memory