{"_id":"@adarsh-pandey/maven","name":"@adarsh-pandey/maven","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@adarsh-pandey/maven","version":"0.1.0","description":"MCP server that learns coding conventions from PR review comments and enforces them","type":"module","packageManager":"pnpm@11.22.0","main":"dist/mcp/index.js","types":"dist/mcp/index.d.ts","exports":{".":{"types":"./dist/mcp/index.d.ts","import":"./dist/mcp/index.js"}},"bin":{"maven-mcp":"dist/mcp/index.js"},"keywords":["mcp","model-context-protocol","mcp-server","code-review","conventions","linting","bitbucket","pull-request","claude","ai"],"author":{"name":"Adarsh Pandey"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/adarshpandey-cs21/maven.git"},"bugs":{"url":"https://github.com/adarshpandey-cs21/maven/issues"},"homepage":"https://github.com/adarshpandey-cs21/maven#readme","engines":{"node":">=20.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","start":"node dist/mcp/index.js","dev":"tsc --watch","lint":"biome check src/","lint:fix":"biome check --write src/","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.30.0","better-sqlite3":"^12.11.1","nanoid":"^5.1.0","zod":"^3.24.0"},"devDependencies":{"@biomejs/biome":"^1.9.0","@types/better-sqlite3":"^9.6.0","@types/node":"^22.0.0","typescript":"^5.7.0"},"_id":"@adarsh-pandey/maven@0.1.0","gitHead":"333e4ae8bf77071d6a060bbc2576c73966d68763","_nodeVersion":"18.20.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-0mSwAK7r5WU0XeRJbQ9J30R0ixZ4X8kJGJTaxKq5PYGOHT60WbmlIztnGIEHz9gw3HOMgBXkrIvDWb4QPcmkZQ==","shasum":"f95ec464697399984a4a86bc7c70ef5795fab5e1","tarball":"https://registry.npmjs.org/@adarsh-pandey/maven/-/maven-0.1.0.tgz","fileCount":55,"unpackedSize":79780,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDpaxPInKVe/+10ryT5ef+BNFXZm2u77ZxxYn6pOo2ZUQIhAPwHh2vWp+cFDSUMN/JaWHuz62ncTpUuEOMnRM+JenSy"}]},"_npmUser":{"name":"adarsh-pandey","email":"adarsh.cse21@gmail.com"},"directories":{},"maintainers":[{"name":"adarsh-pandey","email":"adarsh.cse21@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/maven_0.1.0_1787019818834_0.7112567483476158"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-18T02:23:38.682Z","0.1.0":"2026-08-18T02:23:38.990Z","modified":"2026-08-18T02:23:39.199Z"},"maintainers":[{"name":"adarsh-pandey","email":"adarsh.cse21@gmail.com"}],"description":"MCP server that learns coding conventions from PR review comments and enforces them","homepage":"https://github.com/adarshpandey-cs21/maven#readme","keywords":["mcp","model-context-protocol","mcp-server","code-review","conventions","linting","bitbucket","pull-request","claude","ai"],"repository":{"type":"git","url":"git+https://github.com/adarshpandey-cs21/maven.git"},"author":{"name":"Adarsh Pandey"},"bugs":{"url":"https://github.com/adarshpandey-cs21/maven/issues"},"license":"MIT","readme":"# @adarsh-pandey/maven\n\n[![npm version](https://img.shields.io/npm/v/@adarsh-pandey/maven.svg)](https://www.npmjs.com/package/@adarsh-pandey/maven)\n[![CI](https://github.com/adarshpandey-cs21/maven/actions/workflows/ci.yml/badge.svg)](https://github.com/adarshpandey-cs21/maven/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\nMCP server that learns coding conventions from PR review comments and enforces them.\n\n- Learn conventions from Bitbucket PR comments and tasks\n- Store rules in a local SQLite database\n- Validate diffs against rules\n- One database per machine, keyed by repo — share it and the whole team benefits\n\n## Install\n\n```bash\nnpm install -g @adarsh-pandey/maven\n```\n\nOr use directly with npx — no install needed:\n\n```bash\nnpx -y @adarsh-pandey/maven      # or: pnpm dlx @adarsh-pandey/maven\n```\n\nRequires Node.js 20 or newer.\n\n## Setup\n\nAdd to your Claude Code config (`~/.claude.json` under `mcpServers`):\n\n```json\n{\n  \"maven-mcp\": {\n    \"type\": \"stdio\",\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"@adarsh-pandey/maven\"]\n  }\n}\n```\n\nOr if installed globally (the package exposes a `maven-mcp` binary):\n\n```json\n{\n  \"maven-mcp\": {\n    \"type\": \"stdio\",\n    \"command\": \"maven-mcp\"\n  }\n}\n```\n\n## Tools\n\n| Tool | What it does |\n|------|-------------|\n| `learn` | Takes PR comments, filters blocked users, returns all comments for Claude to extract conventions |\n| `get_rules` | Returns rules for a repo — filter by category, source, compact/detailed view |\n| `save_rule` | Add/update/disable rules — supports batch save (multiple rules in one call) |\n| `validate_diff` | Check a diff against rules, return violations, increment violation counter |\n| `manage_reviewers` | Set reviewer tiers: lead (3x), senior (2x), blocked (ignored) |\n\n## Usage\n\n### 1. Block bots (one-time)\n\n```\nBlock sonarqube-bot in maven-mcp, it's a bot\n```\n\n### 2. Set trusted reviewers (one-time)\n\n```\nAdd john.smith as lead in maven-mcp\n```\n\n### 3. Learn from PRs\n\n```\nFetch all comments and tasks from PR #142 in backend-api (project PROJ)\nand learn conventions from them using maven-mcp\n```\n\nClaude will:\n1. Fetch comments + tasks from Bitbucket (with `include_tasks=true`)\n2. Pass them to `learn` — blocked users filtered out\n3. Read all comments and propose a numbered list of rules\n4. Wait for you to pick: `\"save all\"`, `\"save 1,3,5\"`, `\"save all except 2\"`\n5. Batch-save your picks\n\n### 4. Validate a PR\n\n```\nReview PR #205 against maven-mcp rules\n```\n\n### 5. View stored rules\n\n```\nShow me all rules for backend-api in detail\nShow only typescript rules for backend-api\nShow my manual rules for backend-api\n```\n\nOr query SQLite directly:\n\n```bash\nsqlite3 ~/.maven-mcp/maven.db \"SELECT * FROM rules;\"\n```\n\n## Where rules are stored\n\nOne database for everything, at `~/.maven-mcp/maven.db`. Rules carry a `repo`\ncolumn, so a single file holds the conventions for every repository you work on —\nthere is no per-project database to keep track of, and nothing to commit.\n\nPoint `MAVEN_DB_PATH` at a different absolute path to override it.\n\n## Sharing rules with your team\n\nThe database is a plain SQLite file, so sharing it is a file copy. Export with\n`VACUUM INTO` rather than `cp` — a plain copy can miss recent writes still sitting\nin the write-ahead log:\n\n```bash\nrm -f /tmp/team-rules.db   # VACUUM INTO refuses to overwrite an existing file\nsqlite3 ~/.maven-mcp/maven.db \"VACUUM INTO '/tmp/team-rules.db'\"\n```\n\nSend that file to a teammate. They can either drop it in as their database:\n\n```bash\nmkdir -p ~/.maven-mcp && cp team-rules.db ~/.maven-mcp/maven.db\n```\n\nor keep their own and point at yours for a single project:\n\n```json\n{\n  \"maven-mcp\": {\n    \"type\": \"stdio\",\n    \"command\": \"npx\",\n    \"args\": [\"-y\", \"@adarsh-pandey/maven\"],\n    \"env\": { \"MAVEN_DB_PATH\": \"/abs/path/to/team-rules.db\" }\n  }\n}\n```\n\nRules and reviewer tiers carry across as-is — nothing in the schema is tied to a\nmachine or a user.\n\n## Schema\n\n```sql\nrules (\n  id, repo, category, severity, rule, match, fix,\n  confidence, violations, source, status, created_at, updated_at\n)\n\nreviewers (\n  username, tier, created_at\n)\n```\n\n**Rules fields:**\n- `category` — typescript, svelte, general, css, etc.\n- `severity` — nit, suggestion, important, critical\n- `source` — `manual` (you added it) or `learned` (from PR comments)\n- `violations` — counter incremented each time `validate_diff` catches a hit\n- `match` — optional regex for auto-detection in diffs\n- `fix` — optional fix hint shown with violations\n\n**Reviewer tiers:**\n- `lead` — 3x weight in scoring\n- `senior` — 2x weight\n- `blocked` — comments ignored during learn\n- Everyone else — peer, 1x weight (no entry needed)\n\n## How rules look to Claude\n\nPlain text, zero overhead:\n\n```\n[backend-api / typescript / critical]\n- Always handle default case in switch\n- Use Result<T,E> pattern, never throw from service functions\n\n[backend-api / general / important]\n- PR must have ticket ID in title\n- Clear naming — function names must match what they return\n```\n\n## Environment\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `MAVEN_DB_PATH` | `~/.maven-mcp/maven.db` | Override database location. Use an absolute path. |\n| `MAVEN_DEBUG` | unset | Set to enable debug logging |\n\n## Contributing\n\nIssues and PRs welcome at [adarshpandey-cs21/maven](https://github.com/adarshpandey-cs21/maven).\n\nThis project uses [pnpm](https://pnpm.io), **version 10 or newer**. The exact\nversion is pinned in the `packageManager` field, and pnpm 10+ reads that field and\nswitches itself to the pinned version automatically — so any recent pnpm will do:\n\n```bash\ngit clone https://github.com/adarshpandey-cs21/maven.git\ncd maven\npnpm install\npnpm build\npnpm lint\n```\n\npnpm 9 and older will not work: they ignore both `packageManager` and the\n`allowBuilds` setting below, and will silently produce a broken install.\n\n`better-sqlite3` and `biome` both run install scripts, which pnpm blocks by\ndefault. They are approved in `pnpm-workspace.yaml`:\n\n```yaml\nallowBuilds:\n  better-sqlite3: true\n  '@biomejs/biome': true\n```\n\nThat file is required even though this is not a monorepo — pnpm 11 moved its\nsettings out of `package.json` into `pnpm-workspace.yaml`, and an `allowBuilds`\nblock in `package.json` is silently ignored. Skipping it leaves `better-sqlite3`\nwithout its native binding and the server crashes on startup with\n`Could not locate the bindings file`.\n\nReleases are automated: merge into the `release` branch and the\n[release workflow](.github/workflows/release.yml) bumps the version from the\ncommit message (Conventional Commits), publishes to npm via trusted publishing,\ntags, and cuts a GitHub Release.\n\n## License\n\n[MIT](./LICENSE) © Adarsh Pandey\n","readmeFilename":"README.md","_rev":"1-dc5783b707402105444491c4b00ccb07"}