{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihnownl33llohpbpbytvef5y6vikrmhzxds7fi55d33pcfwmquifm",
"uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mojidcqkqs42"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreiaif3citq6l3lurei4coklgooron6v6avnqmxy5qjnxqxp6uwd6ty"
},
"mimeType": "image/webp",
"size": 73034
},
"path": "/sriram7/setting-up-the-codehabits-mcp-server-in-cursor-5-minutes-4h42",
"publishedAt": "2026-06-17T23:08:00.000Z",
"site": "https://dev.to",
"tags": [
"cursor",
"mcp",
"ai",
"tutorial",
"quickstart",
"MCP server documentation",
"Agent Skills",
"codehabits.dev/agents",
"Codehabits",
"codehabits.dev",
"@codehabits"
],
"textContent": "The **Codehabits MCP server** gives Cursor six tools that read from `.codehabits/` in your repo — convention lookup, code validation, domain knowledge, reviewer suggestions, and a feedback loop for updating conventions.\n\nSetup takes about five minutes if you already ran `codehabits enable`.\n\n## Prerequisites\n\n * Node.js 20+\n * `.codehabits/meta.json` in your repo (from `npx @codehabits/cli enable`)\n * Cursor with MCP support enabled\n\n\n\nIf you don't have intelligence files yet, run enable first — see the quickstart.\n\n## Step 1: Install the MCP server\n\nFrom your repository root:\n\n\n\n npx @codehabits/cli mcp-install\n\n\nThis writes to `.cursor/mcp.json`. Commit it so teammates get the same config:\n\n\n\n git add .cursor/mcp.json\n git commit -m \"chore: add codehabits MCP server\"\n git push\n\n\n## Step 2: Restart Cursor\n\nMCP servers load at startup. Fully quit and reopen Cursor (or reload the window) before testing tools.\n\n## Step 3: Verify tools appear\n\nOpen Cursor Agent and check that the **codehabits** MCP server is connected. You should see these tools:\n\nTool | Purpose\n---|---\n`get_team_context` | Conventions and anti-patterns\n`check_code` | Validate a snippet against team rules\n`get_knowledge` | Domain knowledge by topic\n`suggest_reviewers` | Expertise-based reviewer routing\n`record_feedback` / `approve_proposal` | Propose and merge convention updates\n\nFull reference: MCP server documentation.\n\n## Step 4: Use it in practice\n\nTry these prompts in Cursor Agent:\n\n * _\"Use get_team_context for the api scope before writing this endpoint.\"_\n * _\"Run check_code on this handler before I commit.\"_\n * _\"Who should review changes to files under src/auth/? Use suggest_reviewers.\"_\n\n\n\n## MCP vs Agent Skills\n\nAgent Skills load passively when Cursor starts a task. MCP tools are explicit lookups — use them when you need validation or knowledge mid-task.\n\nMost teams enable both: skills for baseline context, MCP for active checks.\n\n## One-prompt onboarding\n\nThe codehabits.dev/agents page has a bootstrap prompt that runs enable, mcp-install, and reads your intelligence files in one shot. Paste it when onboarding a new repo or teammate.\n\n## Troubleshooting\n\nIf tools return _\"No intelligence data available,\"_ confirm `.codehabits/` exists and the MCP server's working directory is your repo root. Run `codehabits enable` if files are missing.\n\nCommon fixes:\n\nSymptom | Fix\n---|---\nServer not listed | Restart Cursor after editing `mcp.json`\nWrong conventions | Check MCP `cwd` is repo root, not a subfolder\nStale rules | Run `npx @codehabits/cli sync`\n\n## What is Codehabits?\n\nCodehabits extracts team coding conventions from GitHub PR history and delivers them to AI tools via Agent Skills and MCP — so your whole team shares the same evidence-backed patterns, not hand-maintained rule files.\n\n_Originally published at codehabits.dev._",
"title": "Setting Up the Codehabits MCP Server in Cursor (5 Minutes)"
}