MCP Server
Install and use the @codehabits/mcp server for real-time convention checks, domain knowledge lookup, reviewer suggestions, and convention feedback.
The Codehabits MCP server (@codehabits/mcp) exposes six tools that read from .codehabits/ in your repo. Agents call these tools on demand to check code against team conventions, look up domain knowledge, and suggest reviewers.
Prerequisites
- Run
npx @codehabits/cli enablefirst so.codehabits/exists - Node.js 20+ and an MCP-compatible client (Cursor, Claude Desktop, etc.)
Install
npx @codehabits/cli mcp-installThis writes to .cursor/mcp.json in your repository:
{
"mcpServers": {
"codehabits": {
"command": "npx",
"args": ["@codehabits/mcp"],
"cwd": "."
}
}
}For all projects on your machine:
npx @codehabits/cli mcp-install --global✦Restart required
Available tools
| Tool | Description |
|---|---|
| get_team_context | Conventions and anti-patterns, optionally filtered by scope or file path |
| check_code | Validate a code snippet against team conventions and anti-patterns |
| get_knowledge | Look up domain knowledge by topic (auth, database, API, etc.) |
| suggest_reviewers | Suggest reviewers based on expertise for a set of changed files |
| record_feedback | Propose a convention change (writes to gitignored proposals.json) |
| approve_proposal | Merge 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.