hayday-mcp-server
A read-only MCP server that serves live HayDay game data (crops, products, animals, machines, level unlocks) for AI agents to help plan your farm without interacting with the game itself.
README
🧑🌾 HayDay MCP Server
<p align="center"> <img src="https://static.wikia.nocookie.net/hayday/images/8/82/Hay_Day-Logo.jpg/revision/latest?cb=20210703105216" alt="Hay Day" width="400"> </p>
Live HayDay game data — crops, products, animals, machines, and level unlocks — served as MCP tools for any AI agent.
Works with opencode, Claude Desktop, Cursor, VS Code, and any MCP-compatible client.
Not a bot. Not an auto-player. This is a read-only data lookup tool. It does not interact with the HayDay game, does not send inputs, does not automate gameplay, and cannot be used to play on your behalf. It only answers questions about game mechanics — like a wiki you can query from your AI.
Why?
HayDay is a deep game with hundreds of items, recipes, and levels. Keeping track of what to plant, what to craft, and what unlocks next is tedious. This MCP server gives your AI assistant the full game data so it can help you plan your farm — not play it for you.
How It Works
AI agent → MCP protocol → HayDay Data MCP → hayday.info API (live) → structured data
↓
1-hour in-memory cache
Data is fetched live from hayday.info on every tool call, with a 1-hour cache to avoid rate limits. When Supercell updates the game, your AI sees the new data automatically — no manual updates needed.
Quick Start
git clone https://github.com/Mohib1992/hayday-mcp-server.git
cd hayday-mcp-server
npm install
node server.js
The server starts and listens for MCP connections via stdio. Nothing happens until an AI client connects.
Tools
| Tool | Description | Example |
|---|---|---|
search_items |
Search items by name or machine | "wheat", "bakery", "cheese" |
get_item |
Full details for a specific product | "Bread" |
get_machines |
List all 48 machine/category names | — |
get_by_machine |
All products from a machine | "Dairy", "Bakery", "Crops" |
get_crops |
All field crops + trees/bushes | — |
get_animals |
All animal products (eggs, milk, etc.) | — |
get_level_unlocks |
What unlocks at a specific level | level: 30 |
get_unlocks_upto |
Everything available up to a level | level: 20 |
get_best_profit |
Top items by profit/hour | limit: 10, minLevel: 1 |
compare_profit |
Compare profit/time for specific items | ["Wheat", "Corn", "Bread"] |
clear_cache |
Force refresh from live source | — |
Example Queries
"What's the most profitable crop at level 15?"
→ Call get_best_profit(minLevel: 1, limit: 5) and filter by machine: "Crops".
"Compare bread vs corn bread"
→ Call compare_profit(products: ["Bread", "Corn bread"]).
"What do I unlock at level 30?"
→ Call get_level_unlocks(level: 30).
Client Setup
opencode
Add to opencode.jsonc in your project root:
{
"mcpServers": {
"hayday-data": {
"command": "node",
"args": ["server.js"],
"cwd": "/path/to/hayday-data-mcp"
}
}
}
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"hayday-data": {
"command": "node",
"args": ["server.js"],
"cwd": "/path/to/hayday-data-mcp"
}
}
}
Cursor
Settings → Features → MCP → Add new server:
| Field | Value |
|---|---|
| Name | hayday-data |
| Type | command |
| Command | node /path/to/hayday-data-mcp/server.js |
VS Code (Continue.dev)
Add to ~/.continue/config.json:
{
"experimental": {
"mcpServers": {
"hayday-data": {
"command": "node",
"args": ["server.js"],
"cwd": "/path/to/hayday-data-mcp"
}
}
}
}
Data Source
All data comes from hayday.info — a community-run HayDay database. The /api/production-data endpoint returns 348 items across 48 categories. Data is cached in memory for 1 hour.
What's included:
- Field crops + trees & bushes
- Animal products (eggs, milk, bacon, wool, etc.)
- All machine-made products (Bakery, Dairy, BBQ Grill, etc.)
- Level unlock information
- Profit/hour calculations (provided by source)
- XP and XP/hour
What's not included:
- Ingredient/recipe details (which items combine to make a product)
- Building upgrade costs
- Derby / boat / town data
Architecture
hayday-mcp-server/
server.js # MCP server (JSON-RPC over stdio, zero framework deps)
lib/
hayday.js # Fetches & indexes live data from hayday.info
cache.js # 1-hour TTL cache
test/
api.test.js # API layer smoke tests
mcp.test.js # MCP protocol smoke tests
package.json
CHANGELOG.md
LICENSE # MIT
Troubleshooting
| Problem | Likely Cause | Fix |
|---|---|---|
| Server starts but tools return nothing | Client not connected to server | Check MCP config path in your client settings |
| "API returned 429" or slow responses | Rate limited by hayday.info | Wait 1 hour (cache auto-cools down), or call clear_cache |
| "Product not found" for a known item | Case mismatch or item name changed | Use search_items first to find exact name |
| "Machine not found" | Name mismatch | Use get_machines to get exact machine names |
| Server crashes after stdin closes | Expected behavior (stdio transport ended) | Just restart the server |
| Data seems outdated | Cache hit (1hr TTL) | Call clear_cache to force a live fetch |
Testing
npm test
Runs 20+ smoke tests covering the API layer and MCP protocol using Node.js built-in node:test.
Contributing
- Fork the repo
- Create a feature branch
- Run
npm testto verify - Open a pull request
License
MIT
Legal notice
This project is an independent data tool and is not affiliated with, endorsed by, or connected to Supercell Oy. HayDay is a trademark of Supercell Oy. All game data is sourced from publicly available community resources. This tool is read-only and does not interact with the HayDay game client, its servers, or its APIs. It is designed for informational and educational purposes only.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。