A newer version of the Gradio SDK is available: 6.28.0
title: FixMyNeighborhood App
emoji: ποΈ
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 6.0.0
app_file: app.py
pinned: false
tags:
- mcp-in-action-track-enterprise
- mcp-in-action-track-consumer
- mcp-in-action-track-customer
- mcp-in-action-track-creative
- agents
- mcp-client
- multi-agent
- smolagents
FixMyNeighborhood - Multi-Agent AI Infrastructure Reporter
Potholes cause thousands of cyclist injuries yearly, and broken streetlights leave most public-housing residents feeling unsafe at night. That's why we built FixMyNeighborhoodβan AI-powered system that makes reporting these problems simple and fast.
FixMyNeighborhood is an autonomous multi-agent AI platform that helps NYC residents report infrastructure problemsβpotholes, broken streetlights, blocked drainsβdirectly to the city. Powered by a Full Multi-Agent Controller (MAC) architecture, it handles the paperwork, follow-ups, and routing automatically.
You simply describe the issueβour AI agents take care of the bureaucracy.
Demo
Social Media
Architecture Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Gradio UI (app.py) β
β Streaming + Real-time Updates β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β Security Layer β
β Rate Limit β Validationβ
β Prompt Guard β Masking β
ββββββββββββββ¬βββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Autonomous Controller (Claude Sonnet) β
β β
β FULL AUTONOMY: Plans β Reasons β Delegates β Self-Evaluates β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β π― Triage β β π Researchβ β π Report β
β Agent β β Agent β β Agent β
β (Haiku) β β (Haiku) β β (Haiku) β
ββββββββββββββ ββββββββββββββ ββββββββββββββ
β β β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β
βββββββββββββ΄ββββββββββββ
β MCP Server β
β (8 Tools) β
β β
β Weather.gov (real) β
β Photon/OSM (real) β
β NYC Open Data (real) β
βββββββββββββββββββββββββ
Quickstart
1. Run on HuggingFace Spaces
Visit: FixMyNeighborhood Space
2. Local Development
# Clone
git clone https://huggingface.co/spaces/MCP-1st-Birthday/fixmyneighborhood-app
cd fixmyneighborhood-app
# Install
pip install -r requirements.txt
# Configure
export ANTHROPIC_API_KEY=your_key_here
# Run
python app.py
3. Example Session
User: "There's a huge pothole on Broadway near Times Square"
π― Triage Agent
ββ Geocoding Address β β Manhattan, NYC
π Research Agent
ββ Looking Up City Records β RD-MN-0042, 3 complaints
ββ Checking Nearby Reports β 2 reports (1 open)
ββ Getting Weather β 45Β°F, Clear
π Report Agent
ββ Getting Department Info β DOT (24-48h response)
ββ Generating PDF Report β π FMN-20251129
---
Report ID: FMN-20251129-001
Priority: Medium
Department: NYC DOT
Expected Response: 24-48 hours
Key Features
| Feature | Description |
|---|---|
| Autonomous Controller | Claude Sonnet makes ALL decisions - plans, reasons, delegates |
| 3 Specialized Workers | Triage, Research, Report agents (Claude Haiku) |
| 8 MCP Tools | Real APIs (Weather.gov, Photon, NYC Open Data) |
| Multi-turn Conversation | Controller maintains context across messages |
| Image Analysis | Claude Vision identifies infrastructure issues from photos |
| Real-time Streaming | See agent progress as it happens |
MCP Tools
| Tool | Description | Data Source |
|---|---|---|
geo_search_address |
Geocode addresses to coordinates | Photon API (OpenStreetMap) |
validate_address |
Validate NYC addresses | NYC GeoSearch API |
cityinfra_lookup_asset |
Look up infrastructure assets | NYC Open Data (DOT) |
get_nearby_reports |
Find nearby 311 reports | NYC 311 Open Data |
weather_get_current |
Get current weather conditions | Weather.gov (NOAA) |
get_department_info |
Get responsible department & SLA | NYC 311 SLA Data |
pdf_generate_report |
Generate PDF report | ReportLab (local) |
sendgrid_send_email |
Send email notification | Resend API |
Tech Stack
| Component | Technology |
|---|---|
| UI Framework | Gradio 6.0 |
| Agent Framework | smolagents (HuggingFace) |
| LLM Provider | Anthropic Claude (via LiteLLM) |
| Controller Model | Claude Sonnet 4.5 |
| Worker Models | Claude Haiku 4.5 |
| Maps | Folium (Leaflet.js) |
| Tool Protocol | Model Context Protocol (MCP) |
Security
| Layer | Protection |
|---|---|
| Rate Limiting | Per-session sliding window (prevents abuse) |
| Input Validation | Length limits, HTML/XSS detection |
| Prompt Injection | Pattern detection for jailbreaks |
| Cross-User Isolation | gr.State per-session (no data leakage) |
| Output Masking | PII anonymization in logs |
| Error Handling | User-friendly messages, no stack traces exposed |
Geographic validation is handled by MCP tools (validate_address, geo_search_address) using real NYC APIs.
Project Structure
fixmyneighborhood-app/
βββ app.py # Gradio UI entry point
βββ config.py # Environment config
β
βββ agents/ # Multi-agent system
β βββ controller.py # Autonomous MAC (Claude Sonnet)
β βββ subagents.py # Worker definitions (Claude Haiku)
β βββ prompts.py # System prompts
β βββ reasoning.py # ReasoningTrace for observability
β βββ thought_parser.py # Parse agent thinking/tool calls
β
βββ core/ # Core utilities
β βββ session.py # Session management
β βββ events.py # Event types and handling
β βββ image_analysis.py # Claude Vision integration
β
βββ tools/ # MCP integration
β βββ mcp_client.py # MCP server client
β βββ mcp_tools.py # smolagents tool wrappers
β
βββ security/ # Security layer
β βββ rate_limiter.py # Per-session rate limiting
β βββ input_validator.py # Input sanitization
β βββ prompt_guard.py # Prompt injection detection
β βββ output_masker.py # PII masking
β βββ error_handler.py # Friendly error messages
β
βββ observability/ # Logging & tracing
β βββ structured_logger.py # JSON-friendly logging
β βββ decision_tracker.py # Agent decision tracking
β βββ audit_trail.py # Request lifecycle audit
β
βββ ui/ # UI utilities
β βββ mapping.py # Folium map display
β βββ logging.py # Log capture & parsing
β βββ chat_messages.py # Chat message formatting
β βββ timeline.py # Agent execution timeline
β
βββ docs/ # Detailed documentation
βββ architecture.md # Full architecture details
βββ security.md # Security deep-dive
βββ ux.md # UX & streaming
βββ observability.md # Logging & tracing
Environment Variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes | Anthropic API key |
MCP_SERVER_URL |
No | MCP server URL (defaults to HF Spaces) |
GRADIO_THEME |
No | UI theme (default: gstaff/xkcd) |
Documentation
- Architecture - Controller, subagents, MCP tools
- Security - Rate limiting, validation, isolation
- UX - Streaming, error handling, traceability
- Observability - Logging, decision tracking
- Optional Enhancements - Self-eval, confidence scores
Hackathon
Track 2: MCP in Action - Full-autonomous multi-agent system with MCP tools for real-world citizen value.
License
MIT