Skip to content

satendrakumar/ai-agent-integration-with-mcp-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

# 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

    uv sync
  2. 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
  3. Start MCP Server

    uv run -m mcp_server.server

    Server runs on http://localhost:8080/mcp

  4. Launch Agent Interface

    adk web

    Opens http://127.0.0.1:8000 in your browser

Verification

Test the MCP server independently:

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.

About

AI Agent Integration with MPC tools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages