GovNavigator
An MCP server that enables users to search and navigate Madison, Wisconsin municipal ordinances using a TF-IDF search index. It provides specific code sections and citations to answer questions about local regulations like building permits and zoning.
README
GovNavigator - MCP Municipal Code Assistant
An MCP (Model Context Protocol) server that lets Claude search and navigate Madison, WI municipal ordinances. Ask questions like "Can I build a fence in my front yard?" and get real answers with citations!
What is MCP?
Model Context Protocol is Anthropic's open standard for connecting AI assistants to external tools and data. This project demonstrates building a production MCP server.
┌─────────────────────────────────────────────────────┐
│ Claude Desktop │
│ (asks: "fence regulations?") │
└──────────────────────┬──────────────────────────────┘
│ MCP Protocol
▼
┌─────────────────────────────────────────────────────┐
│ GovNavigator MCP Server │
│ (searches our ordinance database) │
└──────────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ TF-IDF Search Index │
│ (30+ chapters of Madison city code) │
└─────────────────────────────────────────────────────┘
Features
- Real Data: Scraped from Madison, WI's actual municipal code
- Semantic Search: TF-IDF based search finds relevant ordinances
- No API Costs: 100% free - no paid APIs needed!
- Citation Support: Returns section numbers and URLs
- MCP Integration: Works with Claude Desktop
Quick Start
1. Install Dependencies
# Create virtual environment
python -m venv .venv
# Activate (Windows PowerShell)
.\.venv\Scripts\Activate.ps1
# Activate (Mac/Linux)
source .venv/bin/activate
# Install dependencies
pip install -e .
2. Scrape Data (Optional - data already included)
python -m src.scraper.municode_scraper
3. Build Search Index
python -m src.search.index
4. Configure Claude Desktop
Add to your Claude Desktop config (%APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"govnavigator": {
"command": "python",
"args": ["-m", "src.mcp_server.server"],
"cwd": "C:\\Users\\Krish\\OneDrive\\Desktop\\GovNavigator"
}
}
}
5. Restart Claude Desktop
After adding the config, restart Claude Desktop. You should see "govnavigator" in the MCP tools list.
Example Queries
Once connected, ask Claude:
- "Can I build a 6-foot fence in my front yard in Madison?"
- "What are the short-term rental regulations in Madison?"
- "Do I need a permit to open a food truck?"
- "What are the noise ordinance quiet hours?"
- "What's required for a building permit?"
Project Structure
GovNavigator/
├── src/
│ ├── scraper/ # Web scraper for Municode
│ │ └── municode_scraper.py
│ ├── search/ # TF-IDF search engine
│ │ └── index.py
│ └── mcp_server/ # MCP server implementation
│ └── server.py
├── data/
│ ├── raw/ # Scraped ordinance data
│ └── processed/ # Search index
└── pyproject.toml # Project configuration
How It Works
1. Web Scraping
Uses Playwright (browser automation) to scrape Madison's municipal code from Municode.com. Handles JavaScript-rendered content.
2. TF-IDF Search
Builds a term-frequency inverse-document-frequency index for semantic search. No AI APIs needed - pure Python math!
3. MCP Server
Exposes two tools to Claude:
search_ordinance: Search for relevant code sectionsget_ordinance_details: Get full text of a specific section
Tech Stack
- Python 3.10+
- MCP SDK - Anthropic's Model Context Protocol
- Playwright - Browser automation for scraping
- BeautifulSoup - HTML parsing
- Pydantic - Data validation
Learning Resources
This project demonstrates:
- Building MCP servers
- Web scraping with Playwright
- TF-IDF search implementation
- Async Python programming
- Data pipeline design
License
MIT License - Use freely for learning and building!
Built with Claude Code by a human learning AI engineering.
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.