MCP Server

Install and use the @codehabits/mcp server for convention checks, repo map navigation, domain knowledge, reviewer suggestions, and feedback.

The Codehabits MCP server (@codehabits/mcp, listed on the official MCP Registry as io.github.codehabits-dev/codehabits-mcp) exposes eight tools that read from .codehabits/ in your repo — including a heuristic map.json via get_repo_map / get_change_routes. Agents call these tools on demand to check code against team conventions, navigate the repo without dumping structure into context, look up domain knowledge, and suggest reviewers.

Official MCP Registry

Registry name: io.github.codehabits-dev/codehabits-mcp. Install remains npx @codehabits/mcp (or npx @codehabits/cli mcp-install for Cursor).

Prerequisites

  • Run npx @codehabits/cli enable first so .codehabits/ exists
  • Node.js 20+ and an MCP-compatible client (Cursor, Claude Desktop, etc.)

Install

Project-level (recommended)
npx @codehabits/cli mcp-install

This writes to .cursor/mcp.json in your repository:

.cursor/mcp.json
{
  "mcpServers": {
    "codehabits": {
      "command": "npx",
      "args": ["@codehabits/mcp"],
      "cwd": "."
    }
  }
}

For all projects on your machine:

Global install
npx @codehabits/cli mcp-install --global

Restart required

Restart your IDE after installing MCP so it picks up the new server configuration.

Available tools

ToolDescription
get_team_contextConventions and anti-patterns, optionally filtered by scope or file path
check_codeValidate a code snippet against team conventions and anti-patterns
get_knowledgeLook up domain knowledge by topic (auth, database, API, etc.)
suggest_reviewersSuggest reviewers based on expertise for a set of changed files
get_repo_mapHeuristic repo map (packages, entrypoints, subsystems, hot files, docs) — prefer over exploring the whole tree
get_change_routesGiven a path or prefix, return dirs/files that often change together (git co-change)
record_feedbackPropose a convention change (writes to gitignored proposals.json)
approve_proposalMerge an approved proposal into active intelligence and regenerate skills

When to use MCP vs skills alone

Agent Skills load passively when agents start working. MCP tools are for active lookups: validating a snippet before committing, querying domain context mid-task, or routing PRs to the right reviewers.

One-prompt setup for agents

The /agents page includes a bootstrap prompt that runs enable, mcp-install, and reads llms.txt in one shot. Paste it into Cursor Agent or Claude Code when onboarding a repo.

Troubleshooting

No intelligence found

MCP reads from process.cwd(). Ensure the server's cwd points at your repo root and .codehabits/meta.json exists. Run codehabits enable if missing.

Tools not appearing

Confirm .cursor/mcp.json is valid JSON, restart the IDE, and check MCP logs in your client's developer tools.