Sanbi ADK Agent MCP Server
Enables AI agents to run brand-visibility audits by querying multiple AI engines, generating competitive leaderboards, and identifying growth opportunities. Integrates with any MCP-capable client to measure and act on brand discoverability in AI recommendations.
README
Sanbi ADK Agent π
AI brand-visibility audits as an agent. Ask "How visible is sight360.com for LASIK surgery?" and get a competitive leaderboard of who ChatGPT and Gemini actually recommend β built on Google's Agent Development Kit, Vertex AI, and the Model Context Protocol.
Google for Startups AI Agents Challenge β Track 3: Refactor for Google Cloud Marketplace & Gemini Enterprise. This repo is a refactor of sanbi.ai's production audit engine (live SaaS, FastAPI + Supabase + Railway) onto Google Cloud-native agent infrastructure.
What it does
Brands are losing discoverability as search shifts to AI assistants. Sanbi answers the new question: "When someone asks an AI for a recommendation in my category, do I show up?" β and then acts on the answer.
The agent runs a 5-step measure β act pipeline:
generate_audit_promptsβ researches the brand with Gemini + Google Search grounding (Vertex AI), extracts identity (industry, audience, competitors), and generates realistic branded + unbranded buyer queries.query_enginesβ fires every query at multiple AI engines in parallel (OpenAI + Vertex Gemini with grounded search), capturing raw responses and citations.grade_responsesβ LLM-grades each response (visibility, rank, sentiment, competitors mentioned), computes weighted visibility scores, and builds a competitive leaderboard + gap analysis + executive summary.find_growth_opportunitiesβ classifies every cited source through Sanbi's deterministic platform taxonomy (reddit / forum / Q&A / youtube / reviews / blog / wikiβ¦), ranks them with a replyability-weighted score, and verifies the URLs are real β AI engines hallucinate citations, and we prove which ones (HEAD checks, YouTube oEmbed, Reddit OAuth).draft_growth_actionsβ generates a different growth motion per surface: authentic reply drafts for forums/reddit, expert answers for Q&A, comment + video briefs for YouTube, review-acquisition plays for review platforms, counter-content briefs for blogs. You can't blog your way into a forum thread β the agent routes work to the right channel automatically.
A coordinator agent routes the conversation between two specialists β an audit agent (measure, tools 1β3) and a growth agent (act, tools 4β5) β that share audit data through ADK session state. Raw multi-KB engine responses live in session state, never in the model's context window; only compact summaries flow through the agents.
Architecture
ββββββββββββββββββββββββββββββββββ
user ββ ADK web UI βββΆβ sanbi_coordinator (root agent) β model: gemini-2.5-flash
β routes; no tools of its own β
βββββββ¬βββββββββββββββββ¬ββββββββββ
transferβ βtransfer
βββββββββββββΌββββββββ βββββββββΌβββββββββββββββ
β audit_agent β β growth_agent β
β MEASURE β β ACT β
β 1. generate_audit β β 4. find_growth_ β
β _prompts β β opportunities β
β 2. query_engines β β (classifyβrank β
β 3. grade_responsesβ β βverify URLs) β
β β β 5. draft_growth_ β
β β β actions β
βββββββββββ¬ββββββββββ ββββββββββββ¬ββββββββββ
β shared ADK session state β
β ("audit:<id>" entries) β
βββββββββββββββΌββββββββββββββ
β sanbi_core/ ββββΆ Vertex Gemini + Google Search grounding
βββββββββββββββ¬βββββββββββββββββΆ OpenAI β₯ Vertex Gemini (parallel)
β
βββββββββββββββΌββββββββββββββ
any MCP client βββββββΆβ MCP server (FastMCP) β
(Claude, Gemini CLI) β run_visibility_audit ββββΆ full pipeline incl. growth inbox
βββββββββββββββββββββββββββ
deployed on Cloud Run
sanbi_core/β the engine, ported from production: planning (brand research + prompt generation), execution (multi-engine querying), analysis (grading + leaderboard), platforms (deterministic citation-source taxonomy), verifier (anti-hallucination URL checks), growth (opportunity scoring + platform playbooks).agents/sanbi_audit/β the ADK multi-agent system: coordinator + audit/growth specialists.mcp_server/β the same audit exposed as a Model Context Protocol tool, so any MCP-capable agent can embed Sanbi audits.
ADK design notes
- Multi-agent delegation β the coordinator owns no tools; it
transfers toaudit_agentorgrowth_agentbased on intent, and the specialists hand off to each other (audit β growth) when the user wants the full pipeline. - Session state, not context stuffing β tools receive ADK's
ToolContextand persist audits intool_context.stateunderaudit:<id>keys. Raw engine responses (5β15k chars each) never enter the model's window. State lives in whateverSessionServicethe runner provides β in-memory in the dev UI, swappable to a persistent service in production without touching tool code. - Demo-robust tool contracts β every post-planning tool takes
audit_id: str = ""and falls back to the session'sactive_audit_id, so a model that forgets to thread the id still lands on the right audit. - Agent evaluation β a starter evalset lives in agents/sanbi_audit/evalsets/ (generated by
scripts/make_evalset.pyfrom ADK's own schema models):
adk eval agents/sanbi_audit agents/sanbi_audit/evalsets/routing.evalset.json \
--config_file_path agents/sanbi_audit/evalsets/test_config.json
Quickstart
# 1. Clone + install
git clone https://github.com/AdityaDREXEL/sanbi-adk-agent && cd sanbi-adk-agent
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2. Configure
cp .env.example .env # fill in GOOGLE_CLOUD_PROJECT + OPENAI_API_KEY
gcloud auth application-default login
# 3. Verify clients
python scripts/smoke_test.py
# 4. Run the agent (ADK dev UI at http://localhost:8000)
adk web agents
Then chat: "Audit sight360.com for LASIK surgery in Philadelphia β then find where AI engines cite from, verify which sources are real, and draft growth actions for the top opportunities."
Run the MCP server
# stdio (Claude Desktop / MCP Inspector)
python -m mcp_server.server
# HTTP (Cloud Run style)
MCP_TRANSPORT=http MCP_PORT=8081 python -m mcp_server.server
Deploy to Cloud Run
gcloud run deploy sanbi-adk-agent \
--source . \
--region us-central1 \
--allow-unauthenticated \
--set-env-vars GOOGLE_GENAI_USE_VERTEXAI=TRUE,GOOGLE_CLOUD_PROJECT=$PROJECT,GOOGLE_CLOUD_LOCATION=us-central1 \
--set-secrets OPENAI_API_KEY=openai-api-key:latest
Tests
244 offline tests cover the scoring formula, LLM-output coercion (None/string ranks, fenced JSON), citation extraction + Google-redirect filtering, leaderboard aggregation, engine-failure isolation, the platform classifier taxonomy, URL-verification verdicts (incl. the Reddit-OAuth and YouTube-oEmbed edge cases), growth-opportunity scoring to the decimal, the agents' session-state flow, and the MCP tool contract. All LLM/HTTP calls are mocked β the suite runs with zero credentials and zero API spend.
pip install -r requirements-dev.txt
pytest
Tech
| Layer | Tech |
|---|---|
| Agent framework | Google Agent Development Kit (ADK) |
| LLM | Gemini 2.5 Flash via Vertex AI (agent brain, research, grading, grounded search) |
| Audited engines | OpenAI + Vertex Gemini |
| Protocol | Model Context Protocol (MCP) |
| Runtime | Cloud Run (containerized, serverless) |
| Grounding | Vertex AI Google Search tool |
Marketplace & Gemini Enterprise roadmap
This refactor is step 1 of bringing Sanbi to Google Cloud Marketplace:
- Marketplace listing β containerized Cloud Run service with usage-based billing hooks.
- Gemini Enterprise / Agentspace β register the agent so enterprise marketing teams can invoke audits from their Google Workspace.
- AlloyDB β replace production Supabase persistence for audit history & trend tracking.
- Identity Platform β multi-tenant auth for agency use.
- Scheduled audits β Cloud Scheduler β Cloud Run jobs for weekly visibility tracking (production Sanbi already does this on Railway; the port is mechanical).
Relationship to production
sanbi.ai runs this same pipeline in production across 4 engines (OpenAI, Gemini, Perplexity, Claude) with batch execution, Supabase persistence, citation-growth mining (1,000+ community opportunities per brand), and Stripe billing. This repo extracts the core audit loop, re-routes all Gemini traffic through Vertex AI, and rebuilds the interface as an ADK agent + MCP tool β the agent-native form factor of the product.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.