habitica-mcp
The habitica-mcp server provides MCP tools to interact with the Habitica API (a gamified task management platform) via the Model Context Protocol over stdio. It enables external applications to manage various aspects of a Habitica account, including:
Smoke testing: A
GreetingTool/HelloWorldToolreturns a deterministic greeting to verify the MCP server is running correctly without requiring credentials.User data: Read and manage user profiles and statistics.
Tasks: Create, read, update, delete, and score tasks; manage tags and checklists.
Notifications: Read notifications.
Rewards & Shop: Buy rewards, browse shop items, and interact with inventory.
Pets & Mounts: Interact with Habitica pets and mounts.
Skills: Cast character skills.
Most operations require Habitica credentials.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@habitica-mcpsay hello"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
habitica-mcp
Habitica Model Context Protocol server built with Effect v4 beta.
The server exposes typed Habitica read/write tools over stdio, with an opt-in
Streamable HTTP transport. Tool handlers depend on an Effect HabiticaGateway
port; the live adapter uses Effect HTTP and schema-decodes Habitica API responses
at the boundary.
Requirements
Node.js
>=22.12.0pnpm
>=10
This repo uses pnpm rather than bun because the server runs on Node stdio, the lockfile is already deterministic, and the Effect MCP docs target Node runtime primitives.
Related MCP server: Basic MCP Server
Install
pnpm add -g habitica-mcp@alphaFor local development:
pnpm installRequired variables:
HABITICA_USER_IDHABITICA_API_TOKENHABITICA_CLIENT_IDHABITICA_API_BASE_URLdefaults tohttps://habitica.com/api/v3
For a local checkout, copy the example env file and fill in your Habitica credentials:
cp .env.example .envCommands
pnpm dev # run the stdio MCP server from TypeScript
pnpm dev:http # run the Streamable HTTP server from TypeScript
pnpm build # emit dist
pnpm check # every gate, mutation included
pnpm check:without-mutation # every gate except mutation
pnpm test # run unit tests
pnpm test:coverage # run unit tests with 100% coverage thresholds
pnpm e2e # run strict effect-bdd Gherkin tests
pnpm mutation # Stryker at 100%, then report health and baselines
pnpm mutation:dev # incremental Stryker run for local iteration
pnpm lint # policy scripts, dep graph, rule tests, oxlint, knippnpm e2e is a deterministic fake-gateway suite. It exercises the full MCP tool
handler surface without live Habitica credentials or network calls.
pnpm test includes a protocol suite that speaks real JSON-RPC to the real
server layer. It swaps the process streams for in-memory ones with
Stdio.layerTest, then drives initialize, tools/list, tools/call,
resources/list, resources/read, resources/templates/list, prompts/list,
prompts/get, and completion/complete. Nothing about the MCP wiring is
stubbed, so a registration that never reaches the protocol fails there rather
than passing an in-memory assertion. A second suite mounts the same layer over
HTTP on an ephemeral port to confirm both transports report the same identity.
Feedback Ladder
Run the smallest relevant command while developing, then widen:
pnpm testpnpm test:coveragepnpm e2epnpm lintpnpm buildpnpm check:without-mutationpnpm mutationpnpm check
Deterministic Gate
pnpm check is pnpm check:without-mutation followed by pnpm mutation.
pnpm check:without-mutation runs build, typecheck (source and policy scripts),
pnpm lint, format check, 100% unit coverage, and the strict effect-bdd
Gherkin e2e suite.
pnpm lint runs, in order:
lint:policy— the deterministic policy scripts inscripts/, covering suppression comments, repository-relative paths, no-op scripts,.cursor/ruleshealth, version pinning, policy-exception health, mutation scope, Stryker config, and coverage config.lint:deps—dependency-cruiserarchitectural boundaries.lint:custom-rule-tests— every custom oxlint rule hasRuleTestercoverage, then runs those rule tests.lint:oxlint— type-aware oxlint withcomplexity: 4and the customhabitica-mcpplugin.lint:knip— unused files, dependencies, and exports.
pnpm mutation runs Stryker at a 100% break threshold, then
lint:mutation-report-health (no survivors, no uncovered mutants) and
lint:mutation-baselines (a ratchet that only moves down, and a mutant-count
floor so the mutate scope cannot quietly shrink).
Coverage and Mutation Scope
Coverage and mutation both start from all of src/**/*.ts. Narrowing is only
possible through a named exception in scripts/policy-exceptions.ts that carries
a rationale, a removal condition, and an owning policy script. lint-coverage-policy
and lint-mutation-scope fail if vitest.config.ts or stryker.config.json
excludes a path that no exception covers, and also if an exception goes stale.
Lefthook runs pnpm check on pre-commit:
pnpm prepareGitHub Actions splits the same work into two jobs: gates runs
check:without-mutation, and mutation runs Stryker incrementally on pull
requests and in full on pushes to main and on a nightly schedule.
Tool Surface
Core tools cover profile, stats, tasks, tags, checklists, and notifications. Expanded tools cover rewards, inventory, shop items, pets, mounts, and skills.
Every tool talks to Habitica, so the credential-free connection check is reading
the habitica-mcp://capabilities resource rather than calling a tool.
All 30 tool names are namespaced lower snake_case, so they stay
distinguishable when a client has several MCP servers connected. Every tool also
carries a human-readable title for approval dialogs, a description, and a
full set of MCP behaviour hints:
Hint | Meaning |
| The tool never changes Habitica state. |
| The tool deletes something that cannot be recovered. |
| Repeating the call with the same arguments adds no effect. |
| The tool talks to Habitica rather than computing locally. |
Mutating tools name their verb explicitly, as in habitica_create_task,
habitica_delete_task, habitica_score_task, and habitica_cast_skill. They
request approval and return typed structured results. Read tools are idempotent;
creates, purchases, casts, and toggles are not, because repeating them spends
gold, mana, or inventory.
Every tool parameter carries a description, since those strings are the only signal the model has when choosing arguments.
Prompts and Resources
Three prompts are registered with snake_case identifiers and completions for
their arguments: habitica_daily_planning, habitica_task_review, and
habitica_habit_check_in.
Two static resources describe the server itself:
habitica-mcp://capabilities(markdown)habitica-mcp://task-template(JSON)
One resource template exposes individual tasks so a client can attach a single task as context instead of pulling the whole list through a tool call:
habitica://task/{taskId}, with completion over the current task ids
Transports
Both transports mount the same capability layer, so they cannot advertise different tools.
stdio (
habitica-mcp) is the default and what MCP clients expect.Streamable HTTP (
habitica-mcp-http) serves MCP atPOST /mcp.
The HTTP transport binds 127.0.0.1:3000 by default and performs no
authentication of its own. It carries live Habitica credentials, so only change
HABITICA_MCP_HTTP_HOST if you are putting an authenticating proxy in front of
it.
HABITICA_MCP_HTTP_HOSTdefaults to127.0.0.1HABITICA_MCP_HTTP_PORTdefaults to3000
Architecture Guardrails
MCP stdout is protocol-owned; logs go to stderr.
Tools import
HabiticaGateway, notHabiticaHttpAdapteror raw route strings. Resource templates may read through the same port.Habitica credentials and auth headers must never be logged.
Every
Tool.makecall declares a success schema.The server reports its version from
package.json, so what a client sees oninitializecannot drift from what was published.Deterministic modules must be listed in coverage and mutation scope. The only exclusions are
src/main.tsandsrc/mainHttp.ts, which bind a transport and launch; anything decidable belongs above them.
MCP Config
Use the local TypeScript entrypoint while developing:
{
"mcpServers": {
"habitica": {
"command": "pnpm",
"args": ["--dir", "/absolute/path/to/habitica-mcp", "dev"]
}
}
}After pnpm build, use the package binary:
{
"mcpServers": {
"habitica": {
"command": "node",
"args": ["/absolute/path/to/habitica-mcp/dist/main.js"]
}
}
}After installing from npm, use the binary:
{
"mcpServers": {
"habitica": {
"command": "habitica-mcp"
}
}
}Publishing
This package is intentionally pre-1.0. Publish early builds with the manual
Publish GitHub Actions workflow. It uses the repository NPM_TOKEN secret,
runs pnpm check, and publishes with npm provenance on the alpha dist-tag.
Equivalent local command:
pnpm check
npm publish --tag alpha --provenanceprepack builds dist/; publishConfig marks the package public and enables npm provenance.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Alicense-qualityDmaintenanceA minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.Last updated4MIT
- Alicense-qualityDmaintenanceA minimal demonstration MCP server showcasing basic tools, resources, and prompts functionality. Built as a template for learning and starting new MCP server projects with Smithery SDK.Last updated28MIT
- Alicense-qualityDmaintenanceA minimal template MCP server demonstrating basic tools, resources, and prompts functionality. Includes example implementations like a hello tool, history resource, and greet prompt for learning MCP development.Last updated4ISC
- Alicense-qualityDmaintenanceA minimal learning-focused MCP server that demonstrates core primitives like tools and resources through simple greeting functions. It provides a foundational example for connecting AI models to external data using both Streamable HTTP and stdio transports.Last updated20MIT
Related MCP Connectors
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tatemz/habitica-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server