🔗 SME Business Advisor — MCP Connected

AI Agent + MCP Server for E-Commerce Analytics

Python Google ADK MCP Google Gemini 2.0 Flash FastAPI Docker

📋 Project Overview & Problem Statement

Challenge: The base SME Business Advisor loads data directly into memory — tightly coupling the agent to a specific CSV file. Changing the data source means rewriting the agent code.

Solution: This version connects the same AI agent to data through MCP (Model Context Protocol). An MCP server sits between the agent and the data, exposing 7 tools. The data source is now swappable — CSV today, Google Sheets tomorrow — without touching the agent.

How It Works

🖥️ Application Features

🟢 MCP Status Panel

A live status panel in the UI shows the MCP server connection state, data source path, total row count, and a list of all 7 available tools — giving full transparency into what the agent can access.

🔧 7 MCP Tools

mcp_read_orders, mcp_get_sales_summary, mcp_get_profit_summary, mcp_get_discount_comparison, mcp_get_return_rates, mcp_get_customer_segments, mcp_get_delivery_times — each exposed as a callable MCP resource.

🔍 Tool Call Transparency

Every response displays which MCP tools were invoked to generate the answer. Users see the full chain of tool calls — building trust in the agent's reasoning process.

🔄 Swappable Data Source

The MCP server abstracts the data layer from the agent layer. Switch from a local CSV to Google Sheets or a database — the agent code stays exactly the same.

🔌 Live Data Connection

Data is fetched through the MCP protocol at query time. The agent always works with the current state of the data source — no stale snapshots or manual reloads needed.

🧠 Same Agent Intelligence

The underlying Gemini 2.0 Flash agent is identical to the base version. Same analytical reasoning, same recommendation quality — only the data access layer has changed.

🤖 AI Integration & Intelligence

🧠 Google ADK + MCP Protocol

Google ADK manages the agent orchestration while MCP handles the data access layer. The two protocols work together — ADK routes questions to tools, MCP serves the data those tools need.

🗂️ Separated Data Layer

The data layer is fully decoupled from the agent layer. The MCP server owns all data access logic — reading, filtering, aggregating — while the agent focuses purely on reasoning and recommendations.

⚡ Gemini 2.0 Flash

The same Gemini model powers reasoning and recommendation generation. It interprets MCP tool outputs and synthesises them into clear business advice.

💻 In-Process MCP Server

The MCP server runs in-process with the FastAPI application — no external service to manage. Simple deployment while maintaining clean architectural separation.

🛠️ Technical Architecture & Implementation

Frontend Stack

FastAPI HTML / CSS / JavaScript

Backend Stack

Python Google ADK MCP Server pandas

Deployment

Docker Google Cloud Run

System Architecture

📊 Key Metrics

7
MCP Tools
34,500
E-Commerce Orders
17
Data Columns
Swappable
Data Source