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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@locallens.mcp_serverAnalyze Sri Sai Dental Clinic in Mangalagiri and show how we stack up against nearby dentists"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LocalLens
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: Local SEO Data
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.
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 & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Local business intel for AI agents: audits, lead scoring, tech stack, prospecting.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to access SurfRank's AI visibility analytics platform through 24 tools. It allows agents to run AI-visibility reports, research keywords, track competitors, and manage projects directly from chat interfaces.249 npmMIT

Local SEO Dataofficial
AlicenseAqualityCmaintenance42 local SEO tools for AI assistants. SERP tracking, Google Business Profile data, review monitoring, keyword research, AI visibility scoring, geogrid rank scans, citation audits, and competitive analysis.124220 npm3MIT- -licenseNot gradedqualityCmaintenanceEnables AI assistants to perform comprehensive SEO and GEO measurements, including site audits, keyword research, ranking tracking, and brand visibility analysis across search engines and generative AI platforms.-
- AlicenseAqualityAmaintenanceProvides 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.15156 npmMIT