Habitica MCP Server
Enables AI assistants to interact with the Habitica API to manage tasks, track habits, and engage in gamified productivity features like pet raising and inventory management. It allows users to control their Habitica account through natural language for a personalized and automated productivity experience.
README
Habitica MCP Server
中文文档请阅读 README.zh-CN.md
A Model Context Protocol (MCP) server that lets AI assistants seamlessly interact with the Habitica API – create tasks, track habits, raise pets and enjoy gamified productivity.
✨ Features
🎮 Core Gameplay Features
- 📋 Smart task management – create / view / update / delete all task types
- ✅ Checklist management – add, update, delete and score checklist items within tasks
- 🎯 Habit tracking – record habit completions and build healthy routines
- 🐾 Pet raising – hatch and feed pets, watch them grow
- 🏇 Mount collection – manage and equip all kinds of mounts
- 🛍️ Shop & rewards – browse and buy in-game items
- ⚡ Skill system – cast class skills to enhance gameplay
📊 Data-oriented Features
- 👤 User profile – fetch detailed user information and stats
- 🏷️ Tag management – create and manage tags for better organisation
- 📬 Notification centre – read and manage system notifications
- 📦 Inventory – list every item and piece of equipment you own
🤖 AI Integration Highlights
- 🧠 Natural-language control – operate Habitica via conversation
- 📝 Task suggestions – AI can create tasks on demand
- 📈 Progress reporting – automatically track and summarise progress
- 🎨 Personalised experience – tailored recommendations based on your habits
🚀 Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
- A valid Habitica account
Installation
- Clone the repo
git clone https://github.com/ibreaker/habitica-mcp-server.git
cd habitica-mcp-server
- Install dependencies
npm install
-
Set API credentials (see next section)
-
Start the server
npm start
⚙️ Configuration
Get Habitica API credentials
- Log into Habitica
- Click your avatar → Settings
- Open the API tab
- Copy User ID and API Token
Environment variables
Method A: export variables
export HABITICA_USER_ID="your-user-id"
export HABITICA_API_TOKEN="your-api-token"
Method B: .env file
HABITICA_USER_ID=your-user-id
HABITICA_API_TOKEN=your-api-token
⚠️ Security tip: never commit your API keys to version control.
🎯 Usage
Start the server
# Production
npm start
# Development (with reload)
npm run dev
MCP client integration
The server follows the MCP spec and works with any AI client that supports MCP. Example Claude Desktop config:
{
"mcpServers": {
"habitica-mcp-server": {
"command": "npx",
"args": ["-y", "habitica-mcp-server"],
"env": {
"HABITICA_USER_ID": "your-id",
"HABITICA_API_TOKEN": "your-token",
"MCP_LANG": "en" // or zh-CN
}
}
}
}
Example dialogue
User: "Create a habit for learning Python"
AI: "Sure, the habit has been created!"
User: "Show me today's tasks"
AI: "Here is your task list for today…"
User: "Add a checklist item to my project task: 'Review code'"
AI: "Added checklist item 'Review code' to your project task!"
User: "I finished my workout, please record it"
AI: "Great job! The workout is logged."
🛠️ Available Tools
User Related
get_user_profile: Get user profile informationget_stats: Get user statisticsget_inventory: Get inventory list
Task Management
get_tasks: Get task list (can specify type: habits, dailys, todos, rewards)create_task: Create new taskupdate_task: Update taskdelete_task: Delete taskscore_task: Complete task or record habit
Checklist Management
get_task_checklist: Get checklist items for a taskadd_checklist_item: Add checklist item to taskupdate_checklist_item: Update checklist itemdelete_checklist_item: Delete checklist itemscore_checklist_item: Score checklist item (mark complete/incomplete)
Tag Management
get_tags: Get tag listcreate_tag: Create new tag
Pets and Mounts
get_pets: Get pet listfeed_pet: Feed pethatch_pet: Hatch petget_mounts: Get mount listequip_item: Equip pet, mount or equipment
Shop and Purchases
get_shop: Get shop item listbuy_item: Buy shop itembuy_reward: Buy reward
Notification Management
get_notifications: Get notification listread_notification: Mark notification as read
Skill System
cast_spell: Cast spell
📖 API Usage Examples
Create Task
{
"type": "todo",
"text": "Complete project documentation",
"notes": "Including API docs and user guide",
"difficulty": 1.5,
"priority": 2,
"checklist": [
{"text": "Write API documentation", "completed": false},
{"text": "Create user guide", "completed": false},
{"text": "Review and proofread", "completed": false}
]
}
Complete Task
{
"taskId": "task-id-here",
"direction": "up"
}
Get Specific Task Type
{
"type": "todos"
}
Pet Management
{
"pet": "Wolf-Base",
"food": "Meat"
}
Buy Item
{
"itemKey": "armor_warrior_1",
"quantity": 1
}
Checklist Management
// Add checklist item
{
"taskId": "task-id-here",
"text": "Research requirements"
}
// Update checklist item
{
"taskId": "task-id-here",
"itemId": "checklist-item-id",
"text": "Updated item text",
"completed": true
}
// Score checklist item (toggle completion)
{
"taskId": "task-id-here",
"itemId": "checklist-item-id"
}
Task Types
habit: Habit (can be recorded positively or negatively)daily: Daily task (resets every day)todo: To-do item (one-time task)reward: Reward (can be purchased with gold)
Difficulty Levels
0.1: Easy1: Medium1.5: Hard2: Extreme
Priority Levels
0.1: Low1: Medium1.5: High2: Extreme
🔧 Troubleshooting
Common Issues
Issue: Server startup failed
Solution:
1. Check Node.js version is 18+
2. Confirm environment variables are set correctly
3. Verify API credentials are valid
Issue: API call failed
Solution:
1. Check network connection
2. Verify Habitica API credentials
3. Confirm API rate limits haven't been exceeded
Issue: Task or pet not found
Solution:
1. Confirm task ID is correct
2. Check if task exists in Habitica
3. Verify user permissions
Debug Mode
# Enable verbose logging
DEBUG=* npm start
Get Help
- 📚 Check Habitica API Documentation
- 🐛 Submit Issues
🤝 Contributing
We welcome all forms of contributions!
How to Contribute
- Fork this project
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Create Pull Request
Development Guidelines
- Follow existing code style
- Add appropriate tests
- Update relevant documentation
- Ensure all tests pass
📄 License
This project is open source under the MIT License - see the LICENSE file for details.
🌟 Acknowledgments
- Thanks to Habitica for providing an excellent API
- Thanks to Anthropic for the MCP protocol
- Thanks to all contributors and users for their support
<div align="center"> <b>Let AI become your Habitica task management assistant!</b> </div>
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。