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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。