MunicipalMCP
Provides programmatic access to municipal codes, ordinances, and zoning regulations from thousands of US cities and counties through the Municode digital library, enabling search, navigation, and retrieval of local government legal documents.
README
MunicipalMCP
A Model Context Protocol (MCP) server for accessing municipal codes and ordinances from the Municode digital library. This server provides programmatic access to municipal legal documents including city ordinances, zoning codes, and other local regulations for thousands of municipalities across the United States.
🏛️ Overview
Municode hosts municipal codes for thousands of cities and counties across the United States. This MCP server leverages the unofficial Municode API to provide structured access to this valuable public information through a standardized MCP interface.
Features
- 🏛️ Municipal Discovery: Find municipalities by state
- 📜 Code Navigation: Browse municipal code structures
- 🔍 Search Capabilities: Search through ordinances and codes
- 📋 Content Retrieval: Get specific code sections and content
- 🌐 URL Generation: Generate direct links to municipal codes
- 🔗 MCP Integration: Works with any MCP-compatible client
🚀 Quick Start
Installation
-
Clone the repository:
git clone https://github.com/yourusername/MunicipalMCP.git cd MunicipalMCP -
Install dependencies:
pip install -r requirements.txt -
Test the server:
python3 test_server.py
Adding to MCP Clients
Warp Terminal
Create or update your MCP configuration file at ~/.config/mcp/mcp.json:
{
"mcpServers": {
"municode": {
"command": "python3",
"args": ["/path/to/MunicipalMCP/municode-mcp-server.py"],
"description": "Access municipal codes and ordinances from Municode digital library"
}
}
}
Claude Desktop App
Add to your claude_desktop_config.json:
{
"mcpServers": {
"municode": {
"command": "python3",
"args": ["/path/to/MunicipalMCP/municode-mcp-server.py"]
}
}
}
🛠️ Available Tools
1. get_states_info
Get information about a US state by its abbreviation.
- Parameters:
state_abbr(string) - Two-character state abbreviation
2. list_municipalities
List all municipalities in a state that use Municode.
- Parameters:
state_abbr(string) - Two-character state abbreviation
3. get_municipality_info
Get detailed information about a specific municipality.
- Parameters:
municipality_name(string) - Name of the municipalitystate_abbr(string) - Two-character state abbreviation
4. get_code_structure
Get the table of contents structure for a municipality's code.
- Parameters:
municipality_name(string) - Name of the municipalitystate_abbr(string) - Two-character state abbreviationnode_id(string, optional) - Specific node ID (defaults to root)
5. get_code_section
Get the content of a specific section of municipal code.
- Parameters:
municipality_name(string) - Name of the municipalitystate_abbr(string) - Two-character state abbreviationnode_id(string) - Node ID of the specific code section
6. search_municipal_codes
Search through municipal codes and ordinances.
- Parameters:
municipality_name(string) - Name of the municipalitystate_abbr(string) - Two-character state abbreviationsearch_query(string) - Text to search forpage_size(integer, optional) - Results per page (default: 10)page_number(integer, optional) - Page number (default: 1)titles_only(boolean, optional) - Search only titles (default: false)
7. get_municipality_url
Get the URL for a municipality's code library page.
- Parameters:
municipality_name(string) - Name of the municipalitystate_abbr(string) - Two-character state abbreviation
📝 Example Usage
Basic Municipal Research
User: "List all municipalities in Virginia that use Municode"
Tool: list_municipalities({"state_abbr": "VA"})
User: "Get information about Norfolk, Virginia"
Tool: get_municipality_info({"municipality_name": "Norfolk", "state_abbr": "VA"})
User: "What's the structure of Norfolk's municipal code?"
Tool: get_code_structure({"municipality_name": "Norfolk", "state_abbr": "VA"})
Searching Municipal Codes
User: "Search Norfolk VA municipal codes for zoning ordinances"
Tool: search_municipal_codes({
"municipality_name": "Norfolk",
"state_abbr": "VA",
"search_query": "zoning"
})
User: "Find building code requirements for crawl space ventilation in Norfolk"
Tool: search_municipal_codes({
"municipality_name": "Norfolk",
"state_abbr": "VA",
"search_query": "crawl space ventilation"
})
🏗️ Use Cases
Urban Planning & Development
- Compare zoning ordinances across municipalities
- Research building code requirements
- Analyze development regulations and procedures
Legal & Compliance Research
- Find relevant municipal ordinances for compliance
- Research local law requirements
- Cross-reference regulations across jurisdictions
Academic & Policy Research
- Study municipal governance structures
- Analyze regulatory patterns across regions
- Research evolution of local laws
Civic Engagement
- Understand local regulations affecting residents
- Prepare for city council meetings
- Research municipal procedures and policies
⚙️ Technical Details
API Integration
This server uses the unofficial Municode API with endpoints including:
- State and municipality discovery
- Code structure navigation
- Content retrieval
- Full-text search capabilities
Data Structure
Municipal codes are organized hierarchically:
State → Municipality → Products → Sections → Content
Each municipality may have multiple products (Code of Ordinances, Zoning Ordinance, etc.), each with its own hierarchical structure.
⚠️ Limitations
- Uses unofficial API endpoints that may change
- Not all municipalities have all features available
- Some content may be in PDF format and not searchable via API
- Rate limiting may apply to API requests
- Municipality names must match Municode's exact formatting
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Based on the unofficial Municode API documentation by ~partytax
- Municode and CivicPlus for providing public access to municipal code information
- The MCP community for developing the Model Context Protocol standard
⚖️ Legal Notice
This is an unofficial tool created to provide programmatic access to publicly available municipal code information. It is not affiliated with or endorsed by Municode or CivicPlus. Always verify critical legal information with official sources and respect Municode's terms of service.
Made with ❤️ for civic transparency and accessibility
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。