locallens.mcp_server
Provides tools for analyzing local businesses on Google Maps via SerpApi, including resolving business listings, finding nearby competitors, tracking local search rankings, and extracting review intelligence.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
LocalLens — Autonomous Local Business Intelligence & Alexa+ MCP Server
Why is this shop losing to its neighbours on Google, and what should it fix first?
India has more than 60 million small businesses, and for clinics, gyms, coaching centres, bakeries and boutiques, "near me" searches on Google Maps decide who gets the walk-in. The owner can see they're behind. They can't see why, or what to fix first.
LocalLens is an AI agent that plans, searches, compares and acts on live search data from SerpApi:
Resolves the business on Google Maps (
google_maps, search + place details).Finds its real competitors: the businesses Google actually ranks around its coordinates (
google_mapswithll).Tracks rank for three real intent searches ("dental clinic in Mangalagiri", "best dental clinic Mangalagiri", "dental clinic near me").
Reads reviews for the business and its top 3 competitors (
google_maps_reviews): 90-day velocity, owner-reply rate, unanswered negatives, and what customers praise or complain about.Audits the website linked from the listing (HTTPS, mobile, speed, SEO basics).
Scores everything into a transparent Visibility Score (0–100), side by side with each competitor.
Acts: a prioritised fix list where every fix cites its evidence ("You reply to 5% of reviews; competitors reply to 60%"), a shareable report, and a WhatsApp-ready summary in English and Telugu.
It also has a Scan-an-area mode for web agencies and consultants (one search → every business in a category, ranked by fixable gap), and an MCP server so any agent (Claude, Alexa+, IDE agents) can call it as a tool.

Quick start (≤ 5 commands)
git clone <repo-url> locallens && cd locallens
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
export SERPAPI_KEY=your_key # optional: without it LocalLens runs on labelled demo data
uvicorn locallens.web.app:app --port 8000 # open http://localhost:8000MCP server (Streamable HTTP, spec 2025-11-25): python -m locallens.mcp_server → http://127.0.0.1:8765/mcp,
then python examples/mcp_client.py. Tests: pytest -q.
Related MCP server: AEO Scanner
🎙️ Amazon Alexa+ Multimodal Companion (/alexa)
When a user asks:
"Alexa, ask LocalLens how Sunrise Dental Care in Mangalagiri is doing against competitors."
Self-Hosted MCP Intelligence Server (
locallens/mcp_server.py):Exposes streamable HTTP tools (
analyze_business_tool,compare_competitors,scan_area_tool,alexa_morning_briefing).Adheres to the latest Model Context Protocol specification (2025-11-25+).
Echo Show 10 Multimodal Smart Display Simulator (
/alexa):Authentic smart display dark-mode interface featuring circular score gauges, competitive rank badges, and spoken audio synthesis via browser SpeechSynthesis.
Nebius Studio NVIDIA H100 Synthesis (
/api/nebius/synthesis):Multi-agent competitor reasoning and web reputation synthesis accelerated on NVIDIA H100 Hopper tensor cores (>50 tokens/sec).
Instant WhatsApp Lead Digest Generator (
/api/whatsapp):Formats one-click
wa.melinks with bilingual (English + Telugu) action plans for local business owners.
How it uses SerpApi
Step | Engine | Calls per analysis |
Resolve the business |
| 1 |
Place details (hours, photos, description) |
| 0–1 |
Competitors + rank for 3 intent queries |
| 3 |
Review intelligence (business + top 3 competitors) |
| 4 |
Total | ≈ 9 searches |
Every response is cached on disk by its parameters, so re-running an analysis costs 0 searches, and a per-analysis budget (default 14) makes runaway loops impossible. Area scan costs 1 search.
Architecture
flowchart LR
U[Owner / agency / agent] --> W[Web UI · FastAPI]
U --> M[MCP server · Streamable HTTP]
W --> E[LocalLens agent]
M --> E
E --> S[SerpApi client<br/>cache · budget · fixtures]
S --> GM[google_maps]
S --> GR[google_maps_reviews]
E --> A[Website audit]
E --> SC[Visibility Score] --> F[Fix list] --> R[Report · WhatsApp EN/TE]The Visibility Score
Component | Points | What it measures |
Map visibility | 25 | Rank for three real intent searches near the business |
Reputation | 25 | Star rating (15) + review count vs the competitor median (10) |
Profile completeness | 15 | Website, phone, hours, 10+ photos, description |
Review momentum | 15 | Reviews in the last 90 days vs competitors (10) + days since the last review (5) |
Owner replies | 10 | Share of recent reviews with an owner response |
Website health | 10 | Audit score of the linked site (0 if missing or down) |
Competitors are scored the same way, except their website isn't audited (presence only), so the comparison is conservative.
Demo data
Without SERPAPI_KEY, LocalLens uses fixtures/: two fictional scenarios (a Mangalagiri dental clinic and a Vijayawada gym)
recorded in SerpApi's documented response shapes (python scripts/make_fixtures.py). The UI shows a DEMO DATA badge.
With a key, the same code path runs on live Google results.
Project layout
locallens/serp.py SerpApi client: cache, budget, fixtures
locallens/engine.py the agent: resolve → competitors → ranks → reviews → audit → score → fixes
locallens/reviews.py review velocity, reply rate, praise/complaint themes
locallens/scoring.py Visibility Score
locallens/fixes.py evidence-backed fix list (+ Telugu)
locallens/report.py printable HTML report
locallens/web/ FastAPI app + single-page UI
locallens/mcp_server.py MCP tools: analyze_business_tool, compare_competitors, scan_area_tool
vendor/sitecheck.py website audit engine (pre-existing, see SUBMISSION.md)MIT licensed.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI-answer-engine visibility scans for local businesses, as agent tools
AI visibility + fact-checks (ChatGPT/Perplexity), review gaps & competitor scans, local SEO.
SEO and AI visibility for agents: keywords, SERPs, backlinks, audits, rank and AI answer tracking.
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides AI-visibility scoring and site auditing capabilities for websites, enabling agents to check how sites appear in AI engines like ChatGPT and Perplexity, run full SEO/security audits, and monitor changes over time.20457 npm1MIT
- AlicenseAqualityDmaintenanceEnables users to scan any website for AI search visibility, producing AEO, GEO, agent readiness, and mention-readiness scores along with AI identity and business profile insights. Paid tools extend this to competitive comparisons, detailed audits, and generated fixes.41MIT
- AlicenseAqualityBmaintenanceEnables AI agents to scrape Google Maps business leads, including contact details, emails, websites, and social profiles, and export them as CSV or XLSX.627 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to run Google Maps geo-grid rank scans and local SEO research, including keyword discovery, rank maps, competitor leaderboards, and rank lookups at specific places. It connects stdio MCP clients to a hosted endpoint using a single API token, so every tool is scoped to the user's account.1MIT