An open API service indexing awesome lists of open source software.

https://github.com/satendrakumar/ai-agent-integration-with-mcp-tools

AI Agent Integration with MPC tools
https://github.com/satendrakumar/ai-agent-integration-with-mcp-tools

agentic-ai google-adk mcp-server mcp-tools ollama python

Last synced: about 1 month ago
JSON representation

AI Agent Integration with MPC tools

Awesome Lists containing this project

README

          

# ai-agent-integration-with-mcp-tools

> **A smart financial assistant that combines Google Agent Development Kit with Model Context Protocol for real-time stock market data**

## πŸš€ Quick Start

```bash
# 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?"*

## πŸ’‘ What This Does

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

## πŸ—οΈ Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” 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 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Components

| 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 |

## πŸ“¦ Installation

### Prerequisites
- Python 3.11+
- UV package manager
- Ollama (for local LLM) or API access to hosted models

### Step-by-Step Setup

1. **Install Dependencies**
```bash
uv sync
```

2. **Configure Environment**
```bash
cp .env-example .env
```

Edit `.env` with your settings:
```env
AGENT_MODEL_NAME=ollama_chat/qwen3:1.7b
API_BASE=http://localhost:11434
MCP_SERVER_URL=http://localhost:8080/mcp
```

3. **Start MCP Server**
```bash
uv run -m mcp_server.server
```
Server runs on `http://localhost:8080/mcp`

4. **Launch Agent Interface**
```bash
adk web
```
Opens `http://127.0.0.1:8000` in your browser

### Verification

Test the MCP server independently:
```bash
npx @modelcontextprotocol/inspector
```

## πŸ› οΈ Usage Examples

### Basic Queries
```
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.
```