缅因州焚烧许可MCP服务器
一种模型上下文协议(MCP)服务器,提供用于检查缅因州火灾危险等级和申请焚烧许可证的自动化工具。
概述
此MCP服务器公开了两个主要工具:
- 检查火灾危险 -从缅因州火灾天气系统检索缅因州城镇的当前火灾危险等级
- 申请烧伤许可证 -通过缅因州的官方焚烧许可证系统,使申请露天焚烧许可证的过程自动化
特性
- 🔥 缅因州各地点的实时火灾危险监测
- 📝 自动提交焚烧许可证申请
- 🤖 AI助手兼容性的模型上下文协议集成
- 🌐 使用Puppeteer进行网络抓取以获取最新信息
- ✅ 使用Zod模式进行输入验证
快速入门(从GitHub使用)
将此MCP服务器与Claude Desktop一起使用的最快方法:
- 打开您的Claude Desktop配置文件:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - 窗户: %APPDATA%\Claude\claude_desktop_config.json
- 添加此配置:
{
"mcpServers": {
"maine-burn-permit": {
"command": "npx",
"args": ["-y", "github:yourusername/publicmcp"]
}
}
}- 重新启动克劳德桌面
- 开始询问缅因州的火灾危险或燃烧许可证!
就是这样!无需本地安装。
先决条件
- Node.js(建议使用v18或更高版本)
- npm或纱线
- 铬/铬(用于Puppeter)
安装
- 克隆存储库:
git clone
cd publicmcp- 安装依赖项:
npm install- 构建TypeScript项目:
npm run build用法
启动服务器
运行MCP服务器:
npm start服务器将通过stdio启动和通信,使其与MCP客户端兼容。
发展模式
对于在文件更改时自动重建的开发:
npm run dev部署到GitHub
要使您的MCP服务器可以通过GitHub轻松分发:
- 更新存储库URL
package.json:
替换 yourusername 使用您的实际GitHub用户名:
"repository": {
"type": "git",
"url": "https://github.com/yourusername/publicmcp.git"
}- 提交并推送到GitHub:
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/yourusername/publicmcp.git
git push -u origin main- 标记发布(可选但推荐):
git tag v1.0.0
git push origin v1.0.0一旦推送到GitHub,任何人都可以使用您的MCP服务器,而无需在本地克隆它!
关于 dist 文件夹:
- 这
dist文件夹位于.gitignore并且不会致力于GitHub - 这是故意的!当用户通过npx从GitHub安装时
prepare脚本自动运行npm run build - 这确保了TypeScript在每次安装时都是全新编译的
- 保持
dist在.gitignore用于更清晰的版本控制
连接到MCP客户端
Claude桌面配置
要将此MCP服务器与Claude Desktop一起使用,请将其添加到您的Claude Desktop配置文件中:
地点:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 窗户:
%APPDATA%\Claude\claude_desktop_config.json
配置:
{
"mcpServers": {
"maine-burn-permit": {
"command": "node",
"args": ["/Users/wolfbird/dev/publicmcp/dist/index.js"]
}
}
}替换 /Users/wolfbird/dev/publicmcp 带有项目目录的实际路径。
更新配置后,重新启动Claude Desktop。
直接从GitHub提供服务
您还可以将Claude Desktop配置为直接从GitHub运行此MCP服务器,而无需在本地克隆存储库。此方法会自动使用存储库中的最新版本。
使用npx进行配置:
{
"mcpServers": {
"maine-burn-permit": {
"command": "npx",
"args": [
"-y",
"github:yourusername/publicmcp"
]
}
}
}替换 yourusername/publicmcp 使用实际的GitHub存储库路径(例如。, wolfbird/publicmcp).
GitHub部署的好处:
- ✅ 无需本地安装
- ✅ 自动使用最新版本
- ✅ 更容易与他人分享
- ✅ 跨用户的一致环境
要求:
- 存储库必须是公共的,否则您需要配置GitHub身份验证
- 你的
package.json必须包括bin领域或start脚本(已配置) - Node.js和npm必须在本地安装
替代方案:使用特定版本/分支
要使用特定的分支或提交:
{
"mcpServers": {
"maine-burn-permit": {
"command": "npx",
"args": [
"-y",
"github:yourusername/publicmcp#main"
]
}
}
}或特定的发布标签:
{
"mcpServers": {
"maine-burn-permit": {
"command": "npx",
"args": [
"-y",
"github:yourusername/publicmcp#v1.0.0"
]
}
}
}与其他MCP客户端一起使用
任何兼容MCP的客户端都可以通过stdio连接到此服务器。配置您的客户端以运行:
本地安装:
node /path/to/publicmcp/dist/index.js来自GitHub:
npx -y github:yourusername/publicmcp示例用法
配置后,您可以通过MCP客户端与工具进行交互。以下是一些对话示例:
示例1:检查火灾危险
你: “缅因州奥古斯塔目前的火灾危险是什么?”
Claude(使用check_fire_danger工具):
Fire Weather Data for Augusta (Zone 23):
Burning Index: 15
Fire Moisture (1-hr): 12%
Fire Moisture (10-hr): 15%
Fire Moisture (100-hr): 18%
Weather: 65°F, RH 45%, Wind 5 mph
Note: Please verify the official Class Day (Low/Moderate/High) on the main map...示例2:申请焚烧许可证
你: “我需要申请烧伤许可证。我叫约翰·史密斯,住在缅因州奥古斯塔主街123号,邮编04330。我的电话是207-555-1234,电子邮件是john@example.com.我想在谷仓后面的土地上烧掉灌木丛。我的出生日期是1980年1月15日。”
克劳德(使用apply_for_burn_permit工具):
Permit Application Successful! Permit Number: 123456.
Please download the permit from the provided link or save the confirmation page.示例3:完整工作流
你: “我想在波特兰烧一些刷子。你能检查一下是否安全,帮我拿到许可证吗?”
克劳德: *首先检查波特兰的火灾危险性,然后如果条件合适,帮助收集所需信息并提交许可证申请。*
可用工具
1.检查火灾危险
查看缅因州特定城镇的当前火灾危险等级。
工具名称: check_fire_danger
输入参数:
town(string,必填):要检查火灾危险的城镇名称
示例响应:
Fire Weather Data for Augusta (Zone 23):
Burning Index: 15
Fire Moisture (1-hr): 12%
Fire Moisture (10-hr): 15%
Fire Moisture (100-hr): 18%
Weather: 65°F, RH 45%, Wind 5 mph
Note: Please verify the official Class Day (Low/Moderate/High) on the main map...2.申请焚烧许可证
使申请缅因州露天焚烧许可证的过程自动化。
工具名称: apply_for_burn_permit
输入参数:
town(string,必填):将发生燃烧的城镇address(string,必填):烧伤部位的物理地址city(string,必填):申请人地址所在城市state(字符串,可选):申请人地址的状态(默认值:“ME”)zip(字符串,必填):邮政编码dob(字符串,必填):出生日期,格式为MM/DD/YYYYmaterial(字符串,必填):要燃烧的材料
- 选项:“刷子”、“木屑”、“农业”、“篝火”
applicantName(string,必填):申请人的全名phone(字符串,必填):电话号码(例如207-555-1234)email(字符串,必填):电子邮件地址burnLocation(字符串,必填):财产上烧伤位置的描述
示例响应:
Permit Application Successful! Permit Number: 123456.
Please download the permit from the provided link or save the confirmation page.项目结构
publicmcp/
├── src/
│ ├── index.ts # Main MCP server setup
│ ├── tools/
│ │ ├── applyPermit.ts # Burn permit application tool
│ │ └── fireDanger.ts # Fire danger checking tool
│ ├── test_apply_permit.ts # Test script for permit application
│ └── test_fire_danger.ts # Test script for fire danger check
├── dist/ # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── README.md技术细节
使用的技术
- @模型上下文协议/sdk:用于构建MCP服务器的官方MCP SDK
- 操纵者:用于网页抓取的无头浏览器自动化
- 萨德:TypeScript第一模式验证
- TypeScript:类型安全开发
运作原理
- MCP服务器:主服务器(
src/index.ts)实现模型上下文协议,通过stdio传输公开工具 - 工具操作员:每个工具都使用Puppeteer与缅因州政府网站进行交互
- 验证:Zod模式确保输入参数在处理之前有效
- 错误处理:使用用户友好的错误消息进行全面的错误处理
重要说明
⚠️ 法律和安全免责声明
- 该工具可自动访问缅因州政府的公共网站
- 始终手动验证许可证详细信息和火灾危险等级
- 遵守所有当地法规和燃烧限制
- 焚烧许可证须经批准和天气条件
- 用户负责安全燃烧操作
故障排除
木偶问题
如果Puppeteer无法启动Chrome:
# On Linux, you may need to install additional dependencies
sudo apt-get install chromium-browser网络错误
这些工具需要互联网接入:
- https://mainefireweather.org
- https://www13.maine.gov/burnpermit
确保您的网络允许访问这些域。
贡献
欢迎投稿!请随时提交pull请求或打开bug和功能请求的问题。
许可证
ISC
致谢
- 缅因州林务局提供焚烧许可证制度
- 缅因州火灾天气火灾危险数据
- 模型上下文协议社区
支持
对于问题或疑问,请在GitHub存储库上打开问题。
