GovNavigator

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.

Category
访问服务器

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 sections
  • get_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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选