A smart financial assistant that combines Google Agent Development Kit with Model Context Protocol for real-time stock market data
# Clone and setup
git clone https://github.com/satendrakumar/ai-agent-integration-with-mcp-tools.git
cd ai-agent-integration-with-mcp-tools
# Install dependencies
uv sync
# Start MCP server
uv run -m mcp_server.server
# Configure environment (copy .env-example to .env)
cp .env-example .env
# Launch agent interface
adk web
Visit http://127.0.0.1:8000
and ask: "What's Apple's stock price today?"
Transform natural language into real-time financial insights:
- "Get me Tesla's current price" → Live TSLA data with daily changes
- "How is AAPL performing?" → Comprehensive Apple stock analysis
- "Show me Microsoft and Google prices" → Multi-stock comparison
┌─────────────────┐ HTTP/MCP ┌──────────────────┐ API Call ┌─────────────┐
│ Google ADK │ ◄──────────────► │ MCP Server │ ◄─────────────► │ Yahoo │
│ Agent │ │ (Tools Layer) │ │ Finance │
│ │ │ │ │ │
│ • NL Processing │ │ • get_stock_price│ │ • Real-time │
│ • Conversation │ │ • Tool Discovery │ │ • Historical│
│ • Context Mgmt │ │ • Error Handling │ │ • Metadata │
└─────────────────┘ └──────────────────┘ └─────────────┘
Component | Purpose | Technology |
---|---|---|
Agent Layer | Natural language understanding & conversation | Google ADK |
Protocol Layer | Tool discovery & standardized communication | Model Context Protocol |
Tools Layer | Stock data retrieval & processing | Python + yfinance |
Data Layer | Real-time financial market data | Yahoo Finance API |
- Python 3.11+
- UV package manager
- Ollama (for local LLM) or API access to hosted models
-
Install Dependencies
uv sync
-
Configure Environment
cp .env-example .env
Edit
.env
with your settings:AGENT_MODEL_NAME=ollama_chat/qwen3:1.7b API_BASE=http://localhost:11434 MCP_SERVER_URL=http://localhost:8080/mcp
-
Start MCP Server
uv run -m mcp_server.server
Server runs on
http://localhost:8080/mcp
-
Launch Agent Interface
adk web
Opens
http://127.0.0.1:8000
in your browser
Test the MCP server independently:
npx @modelcontextprotocol/inspector
User: "What's the current price of Apple?"
Agent: Apple (AAPL) is trading at $175.43, up $2.15 (+1.24%) today.
User: "Get Tesla's stock info"
Agent: Tesla (TSLA) is at $248.87, down $5.32 (-2.09%) in current session.
User: "How is MSFT performing?"
Agent: Microsoft (MSFT) shares are $378.91, up $4.55 (+1.22%) today.