habitica-mcp
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-mcplist my habits and dailys"
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
An MCP server for a self-hosted Habitica instance, served over Streamable HTTP so it can run as a normal networked service rather than a per-client stdio subprocess.
Why this exists
The existing community server (iBreaker/habitica-mcp-server) hardcodes
https://habitica.com/api/v3, is stdio-only, and has been unmaintained since three days
after it was created. None of that works for a self-hosted instance behind an ingress.
Here, HABITICA_BASE_URL is required with no default — pointing at the wrong
instance is made impossible rather than merely discouraged.
Related MCP server: habitca-mcp
Tools
Tool | Notes |
| Optional type filter; history excluded (see below) |
| |
| Not idempotent — Habitica has no idempotency key |
| Partial update |
| Destructive |
| Destructive — mutates gold/XP/streaks, cannot be undone |
| |
| Take a tag name, resolved to its UUID |
| Server-side projection, not the full user document |
Configuration
Variable | Required | Default | Purpose |
| yes | — | e.g. |
| yes | — |
|
| yes | — |
|
| no | (empty — validation off) | Comma-separated Host allowlist for |
| no |
| |
| no |
| |
| no |
|
Endpoints: POST/GET/DELETE /mcp, and GET /healthz.
Design notes
Four decisions that are load-bearing and non-obvious:
Response projection, not pagination. Habitica's GET /tasks/user returns
history: [{date, value}] on every habit and daily — one entry per scoring event for the
life of the account, and it is on by default. The API offers no limit/offset, so the
fix is projection: this server always sends history=false and additionally projects each
task to a fixed field set, so an upstream schema change cannot silently reintroduce
hundreds of KB into a model's context. get_user_stats uses ?userFields= for the same
reason.
The list filter is plural and irregular. GET /tasks/user?type= accepts
habits | dailys | todos | rewards | completedTodos (note dailys), while the create
body takes the singular habit | daily | todo | reward. Tools expose the singular form
and map internally; passing the singular form to the list endpoint 400s.
Host validation is scoped to /mcp, never app-wide. createMcpExpressApp applies it
globally, which would break both kubelet probes (an httpGet probe sends
Host: <podIP>, and pod IPs can never be allowlisted) and blackbox monitoring (which
sends Host: <svc>.<ns>.svc). /healthz therefore sits outside the guard; it exposes
nothing, and DNS-rebinding protection only matters for the JSON-RPC surface.
/healthz reports process liveness only — never Habitica reachability. A
connectivity check would turn a Habitica restart into a CrashLoopBackOff here, and the
liveness probe would then keep killing a process that is perfectly healthy and simply has
nothing to talk to. Habitica outages surface as clean per-tool JSON-RPC errors instead.
Transport
Stateless Streamable HTTP (sessionIdGenerator: undefined), built on
@modelcontextprotocol/server v2 — the current stable major, whose HTTP transport lives
in the separate @modelcontextprotocol/express / @modelcontextprotocol/node adapters.
The negotiated protocol version is 2025-11-25 (LATEST_PROTOCOL_VERSION in the SDK);
v1.x is now security-and-bugfix only.
A fresh McpServer + transport is created per request, torn down on the response's
close event. Per-request construction is required rather than tidy: SDK v1 throws
outright on stateless transport reuse ("Stateless transport cannot be reused across
requests"), because reuse causes message-ID collisions between concurrent clients.
The cost is real and worth knowing: each request rebuilds 11 zod→JSON-Schema conversions, which measured at roughly 0.5 MB of garbage per call. It is reclaimed under GC pressure (1500 sequential calls settled at ~193 MiB with a 96 MB heap cap) rather than leaking, but it is why the deployment requests more memory than the idle footprint suggests.
GET /mcp returns 405 with Allow: POST. This is spec-legal (a server may refuse the
standalone stream) and is what the MCP client explicitly expects — it special-cases 405 as
"no server stream here" and stops.
An earlier version tried to be accommodating by returning an empty SSE stream instead. That caused an infinite reconnect loop: the client treats a cleanly-ended stream that carried no response as a dropped connection and reschedules, but its retry counter only advances on failure, so a successful empty stream reset nothing. Measured at ~1 req/s forever — 1 → 4 → 8 → 12 GETs over 12s idle, roughly 86k requests/day per connected client, with no error surfaced anywhere. Returning 405 holds it at exactly 1.
Stateless has a real cost, not just upside: server→client round-trips (sampling,
elicitation) and unsolicited *ListChanged notifications cannot work, because the
client's reply arrives as a new HTTP request that lands on a fresh server instance with no
memory of the pending call. Progress notifications do work — they ride the originating
request's own stream. None of that matters for a CRUD tool surface, but do not build on
those capabilities here.
Security
The /mcp endpoint is unauthenticated. The Habitica credential lives server-side, so
anyone who can reach the endpoint can read and write the account's entire task list. This
is deliberate — an auth proxy in front of an MCP endpoint breaks MCP clients — and it is
why the deployment is restricted to a private network and a single replica.
The API token is a user-level Habitica credential (stored in plaintext by Habitica itself), so leaking it is full account compromise. All log output passes through a redacting logger, with a test asserting the token never appears in any emitted line.
Development
npm ci
npm test
npm run lint && npm run typecheck
npm run build && node dist/index.jsLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA standalone MCP server for managing habits and quit trackers through a jhabit instance. It enables users to list trackers, log entries, and retrieve detailed statistics like streaks and abstinence time.
- FlicenseBqualityDmaintenanceExposes the Habitica v3 API as MCP tools, allowing AI assistants to read and manage tasks, habits, dailies, rewards, pets, inventory, and notifications.28
- AlicenseCqualityBmaintenanceHabitica MCP server built with Effect v4, currently exposing a hello-world tool, resource, and prompt over stdio for early development and testing.130MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for managing Habitica as a daily execution layer, enabling agents to read and (with explicit confirmation) create, complete, and score tasks via the Habitica API.30MIT
Related MCP Connectors
A basic MCP server to operate on the Postman API.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
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/sharkusmanch/habitica-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server