pollen-alert-mcp
Provides real-time pollen level alerts and hayfever mitigation tips using the Ambee API.
README
Pollen Alert MCP Server
An MCP (Model Context Protocol) server that provides real-time pollen level alerts and hayfever mitigation tips. It uses the Ambee API to fetch pollen data for any location worldwide, making it available to AI assistants like Claude.
This project is created based on Claude Code Course
Features
Tools
get_coordinates— Convert a place name into latitude and longitudeget_pollen_forecast— Get current pollen counts, risk levels, and species-level breakdown for a location
Resources
pollen://mitigation-guide— Hayfever mitigation strategiespollen://allergen-info— Common allergen types and their peak seasons
Prompts
analyze_pollen_risk— A guided prompt that chains coordinate lookup, pollen forecast, and mitigation advice for a given place
Prerequisites
Installation
- Clone the repository:
git clone https://github.com/jaygaha/pollen-alert-mcp.git
cd pollen-alert-mcp
- Install dependencies with uv:
uv sync
- Create a
.envfile in the project root with your Ambee API key:
API_KEY=your_ambee_api_key_here
Usage
Running the server directly
uv run pollen_alert_server
Configuring with Claude Desktop
Add the following to your Claude Desktop configuration file (claude_desktop_config.json):
{
"mcpServers": {
"pollen-alert": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/pollen-alert-mcp",
"run",
"pollen_alert_server"
]
}
}
}
Configuring with Claude Code (CLI)
- Add the server:
claude mcp add pollen-alert -- uv --directory /absolute/path/to/pollen-alert-mcp run pollen_alert_server
- Verify it was registered:
claude mcp list
- Start a new Claude Code session and ask naturally:
What are the pollen levels in Nerima, Tokyo?
Claude Code will automatically discover and call the get_coordinates and get_pollen_forecast tools.
Note: The MCP server loads when a Claude Code session starts. If you modify the server code, you need to restart your session (
/exitthenclaude) for changes to take effect.
Configuring with Ollama (local models)
You can use this MCP server with locally running models via Ollama using an MCP-compatible client. One option is mcp-cli, which bridges MCP servers to Ollama models.
- Install an Ollama model with tool-calling support:
ollama pull llama3.1
- Install mcp-cli:
npx @wong2/mcp-cli
- Create an MCP configuration file (e.g.
mcp.json):
{
"mcpServers": {
"pollen-alert": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/pollen-alert-mcp",
"run",
"pollen_alert_server"
]
}
}
}
- Run mcp-cli with your config:
npx @wong2/mcp-cli --config mcp.json
This connects the pollen alert server to your local Ollama model, allowing it to call the get_coordinates and get_pollen_forecast tools.
Note: Tool-calling quality depends on the model. Models like
llama3.1,mistral, andqwen2.5support tool use. Smaller models may not invoke tools reliably.
Example interactions
Once connected, you can ask your AI assistant things like:
- "What are the pollen levels in Tokyo right now?"
- "Check the pollen forecast for Butwal and tell me if it's safe to go outside."
- "Use the analyze_pollen_risk prompt for Kathmandu."
Project Structure
pollen-alert-mcp/
├── src/
│ ├── __init__.py
│ └── pollen_alert_server/
│ ├── __init__.py # Entry point
│ ├── server.py # MCP server implementation
│ └── api_response_model.py # Pydantic data models
├── pyproject.toml
└── .env # API key (not committed)
Architecture Note
This project intentionally uses the low-level Server class from the MCP SDK rather than the higher-level FastMCP wrapper. This makes the MCP protocol mechanics (JSON-RPC, tool registration, resource handling) explicit and easier to understand for beginners learning how MCP servers work.
Future Ideas & Contributions
Here are ideas to improve and extend this project. Contributions are welcome!
Migrate to FastMCP
Refactoring from the low-level Server class to FastMCP would:
- Replace manual
list_tools/call_tooldispatching with simple@mcp.tool()decorators - Replace
list_resources/read_resourcewith@mcp.resource()decorators - Replace
list_prompts/get_promptwith@mcp.prompt()decorators - Remove boilerplate
InitializationOptionssetup - Enable
mcp dev server.pyfor the MCP Inspector (currently unsupported with low-level Server)
Pollen Alert Notifications (n8n Automation)
A detailed architecture plan for automating pollen level notifications using n8n is available in notification-plan.md. It covers scheduled pollen checks, threshold-based alerting, duplicate prevention, and notification delivery via Email, Slack, LINE, and FCM push notifications.
Feature Ideas
- Pollen forecast (multi-day) — Add a tool that returns forecast data for the next 3-7 days, not just current levels
- Allergy severity scoring — Combine pollen counts with user-provided allergy profile (e.g., "allergic to birch and grass") to give a personalized risk score
- Historical comparison — Show how today's pollen levels compare to the same period last year
- Push notifications — Alert users when pollen levels exceed a configured threshold for their saved locations
- Multiple data sources — Integrate additional APIs (e.g., Google Pollen API) for cross-referencing and better accuracy
- Caching layer — Cache API responses (e.g., 15-minute TTL) to reduce Ambee API calls and improve response times
- Rate limiting — Add request throttling to stay within Ambee API limits
- Unit tests — Add test coverage using pytest with mocked API responses
- SSE transport — Add Server-Sent Events transport alongside stdio for web-based MCP clients
- Docker support — Add a Dockerfile for containerized deployment
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。