MCP

How to Connect WizardHabits to Other Apps with MCP

Set up WizardHabits as an MCP server, create API keys in Settings, and connect external tools for habit automation.

WizardHabits Team
3 min read

If you use AI tools, automation platforms, or custom scripts, you can now connect them directly to your WizardHabits account through MCP.

In this guide, you’ll learn how to:

  1. Generate an MCP API key in your WizardHabits settings.
  2. Connect an external MCP-capable app.
  3. Read and update habits from that app.
  4. Keep your account secure while using integrations.

What MCP Gives You

MCP (Model Context Protocol) provides a standard way for external apps to call tools in your account.

With WizardHabits MCP, connected apps can:

  • List your habits
  • Create and update habits
  • Archive and unarchive habits
  • Toggle habit completion
  • Read completion and skip history in date ranges
  • Start and cancel habit challenges
  • Check wizard identity eligibility and promote mature habits
  • Reaffirm, rename, or return wizard identities to the habit grid

That means you can build flows like:

  • "When I finish a Pomodoro, mark my deep-work habit complete."
  • "If I miss two days, create a follow-up task in another app."
  • "Summarize my completion data every Sunday."

Step 1: Create an API Key

Inside WizardHabits:

  1. Open your dashboard.
  2. Click your profile icon in the top-right navigation.
  3. Click Settings.
  4. In the MCP API Keys card, click Create Key.
  5. Name the key after the client that will use it (like "Claude Desktop" or "Grok Bot") and pick an optional expiration.

You’ll see the full key one time. Copy it and store it in your password manager or secrets manager.

You can create a separate key for every client, so revoking or rotating one never breaks the others. Rotating a key issues a new secret under the same name and revokes only that key.

Step 2: Configure Your MCP Client

Your MCP endpoint is:

/api/mcp/

Use this header for authentication:

Authorization: Bearer wh_mcp_...

WizardHabits now speaks MCP Streamable HTTP on that endpoint:

  • POST /api/mcp/ for JSON-RPC requests
  • GET /api/mcp/ with Accept: text/event-stream for an authenticated SSE stream
  • DELETE /api/mcp/ with Mcp-Session-Id when your client wants to close the session

During initialization, the server returns an Mcp-Session-Id header. Send that header on later MCP requests from the same client session.

Your client should still call the standard MCP methods:

  • initialize
  • tools/list
  • tools/call

Step 3: Call WizardHabits Tools

After connection, start with tools/list to discover available operations.

Then call tools/call with one of these tool names:

  • list_habits
  • create_habit
  • update_habit
  • archive_habit
  • unarchive_habit
  • toggle_habit_completion
  • list_completions
  • list_skips
  • get_habit_challenge_options
  • list_habit_challenges
  • create_habit_challenge
  • cancel_habit_challenge
  • list_wizard_identities
  • get_habit_identity_eligibility
  • promote_habit_to_identity
  • update_wizard_identity
  • reaffirm_wizard_identity
  • mark_wizard_identity_slipped
  • return_wizard_identity_to_habits

Example: Mark a Habit Complete

Use tools/call with:

{
  "name": "toggle_habit_completion",
  "arguments": {
    "habit_id": "your-habit-uuid",
    "date": "2026-02-19"
  }
}

If there is already a completion for that date, the same call will remove it. This makes automation flows easier because the action is idempotent around current state.

Security Best Practices

Treat your API keys like passwords:

  • Never paste them into shared chats or public logs.
  • Store them in environment variables or a secret vault.
  • Use a separate named key per client so one exposure never affects the rest.
  • Rotate a key immediately if you suspect exposure, and periodically as part of your normal security routine.
  • Set an expiration (30 or 90 days) on keys for clients you only use occasionally.
  • Revoke keys you no longer use — the last-used date in Settings shows which ones are stale.

Suggested First Automation

Start simple:

  1. Pick one habit that is easy to detect externally (for example, a coding session or workout).
  2. Connect your MCP client.
  3. Trigger toggle_habit_completion from your external app when that event happens.
  4. Review your streak quality after one week.

You’ll quickly see where automation helps and where manual check-ins still give better signal.

If you build something useful with WizardHabits MCP, share it with us. The best workflows usually start from one tiny automation that removes daily friction.

Written by
WizardHabits Team

Writes about rituals, identity, and the systems that make habits stick for years instead of weeks.