Drift

A local CLI and read-only MCP server that stop agents from breaking API route layering in Next.js

CLILow risk

dadbodgeoff/drift

Install

git clone https://github.com/dadbodgeoff/drift.git && cd drift
pnpm install --frozen-lockfile
pnpm build && pnpm build:engine

Requires Rust. Entry point: node packages/cli/dist/main.js.

This is third-party code. Review the repository files before installing.

What it does

Drift scans a TypeScript or JavaScript repository and infers a convention: Next.js API routes must not import data-access clients such as Prisma directly. Once a human confirms it, the convention becomes a contract and existing violations go into a baseline. drift check inspects a diff and names the file, line and broken rule; in block mode it exits with code 2. The read-only drift-mcp server lets an agent read the contract up front and, via get_task_preflight, get example files that already follow the pattern.

Who it is for. For Next.js teams that let agents write API routes and want to keep a service layer intact.

Good fit when

  • Agents add routes that hit the database around services
  • You need a CI gate for an architecture convention
  • You want to give an agent correct examples before a task

Not a fit when

  • The project is not Next.js or not TypeScript and JavaScript
  • You need general code review or other rules

Example request

Before adding the endpoint, ask Drift for a preflight and follow the examples it returns

Limitations

Beta: not published to npm, built from source only and requires Rust and pnpm; there is no drift binary yet. Supports one convention family for Next.js. Edit-time hooks are not shipped. The driftdetect npm package is unrelated. A get_task_preflight response is around 20,000 tokens.

How to disable. Remove drift-mcp from the MCP config, the drift check step from CI and the ~/.drift directory.

Security check

  • Runs locally, does not modify source code and sends nothing to a server

README in short

The README states the beta status and source build up front and gives install and first-run commands. A scope section limits claims to one language family, one framework and one convention. It reports results on seven open-source Next.js repositories and explains when checks block versus warn. MIT licensed.

FAQ

Why do violations only warn?

If most routes break the convention, Drift treats it as a refactor goal and does not block until a human decides.

Can an agent change rules via MCP?

No, the server is read-only; accepting conventions and suppressing findings stay with humans.

Editors’ pick

A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review

PluginMedium risk286.6K
Editors’ pick

Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture

SkillLow risk262K

Reference MCP servers

Model Context Protocol servers

Editors’ pick

Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything

MCP serverMedium risk90.3K
Editors’ pick

Up-to-date, version-specific library docs and code examples in your agent's context, via MCP or a CLI plus skill

MCP serverMedium risk62K