Skip to main content
Glama
README.md
# DRIFT

**What changed since your model's training cutoff.**

AI models write code against the libraries they saw in training. Libraries keep moving. A model trained on Zod 3 will happily write Zod 3 code into a Zod 4 project, call hooks that were renamed, import a Go module path that stopped at v1, and reach for classes that moved to another package. DRIFT is an MCP server that closes that gap with live registry data across ten ecosystems, so the model checks before it guesses.

```
whats_new("zod", since: "2025-01")
  Latest 4.6.7 · last release before the cutoff 3.24.1
  136 releases since 2025-01-01, crossing major version 4: expect breaking API changes.

verify_symbol("typescript", "createProgram")
  ❌ createProgram does not appear anywhere in the published files of typescript@7.0.2. Do not use it.

verify_symbol("github.com/gin-gonic/gin", "Context.JSON", ecosystem: "go")
  ✅ JSON is exported by github.com/gin-gonic/gin@v1.12.0
  context.go:1205 → func (c *Context) JSON(code int, obj any) {

whats_new("github.com/jackc/pgx", ecosystem: "go")
  ⚠ Newer major versions of this module exist at a different import path:
    github.com/jackc/pgx/v4, github.com/jackc/pgx/v5
```

## Tools

1. **`whats_new`**: releases since a date or version, new major versions, and the breaking, removed, deprecated, renamed and new APIs pulled from release notes. Pass the model's training cutoff as `since`.
2. **`verify_symbol`**: downloads the package's real published files (npm tarball or PyPI wheel) and checks whether a function, class, method, constant or type exists in a given version. Dotted paths such as `Client.chat.completions.create` are narrowed to the right module. Also surfaces release notes that mention the symbol.
3. **`migrate`**: breaking changes, removals, deprecations and renames between two versions, with links to the notes that mention a migration guide.
4. **`check_dependencies`**: give it a `package.json` or `requirements.txt` worth of dependencies and get the latest version of each, how many majors behind it is, and deprecation notices.

## Ecosystems

| `ecosystem` | Registry | Package name looks like | `verify_symbol` reads |
|---|---|---|---|
| `npm` | npm | `react`, `@anthropic-ai/sdk` | published tarball, `.d.ts` first |
| `pypi` | PyPI | `pydantic` | wheel (or sdist), `.pyi` first |
| `cargo` | crates.io | `serde` | `.crate` source |
| `go` | Go module proxy | `github.com/gin-gonic/gin` | module zip |
| `rubygems` | RubyGems | `rails` | `.gem` source, `.rbs` first |
| `maven` | Maven Central | `com.google.code.gson:gson` | `-sources.jar` (Java, Kotlin, Scala) |
| `nuget` | NuGet | `Newtonsoft.Json` | XML API docs inside the `.nupkg` |
| `packagist` | Packagist | `laravel/framework` | dist zip |
| `pub` | pub.dev | `http` | package archive, `lib/` |
| `hex` | Hex | `phoenix` | package tarball |

Version history comes from each registry; Go, Maven and NuGet are read through [deps.dev](https://deps.dev). Release notes come from GitHub Releases, with `CHANGELOG.md`, `HISTORY.md`, `CHANGES.md` and similar files as fallback.

Registry-specific signals are surfaced, not hidden: npm and NuGet deprecations, yanked crates, retired Hex releases, abandoned Packagist packages, discontinued pub.dev packages, and Go majors that moved to a `/vN` import path.

Maven and NuGet publish compiled code, so `verify_symbol` relies on what the package ships for humans: a sources jar or XML documentation. When neither exists, DRIFT says it cannot verify rather than guessing.

Every answer ends with its sources and the time it was checked.

## Use it

### Local (stdio), any MCP client

```json
{
  "mcpServers": {
    "drift": {
      "command": "npx",
      "args": ["-y", "@pivyon/drift"],
      "env": { "GITHUB_TOKEN": "optional, raises GitHub rate limits" }
    }
  }
}
```

Claude Code:

```bash
claude mcp add drift -- npx -y @pivyon/drift
```

### Remote (Streamable HTTP)

Deploy your own copy to Cloudflare Workers:

```bash
npm install
npx wrangler secret put GITHUB_TOKEN   # a fine-grained token with no scopes is enough
npm run deploy
```

Then add `https://<your-worker>/mcp` as a remote MCP connector in Claude, ChatGPT or any client that supports Streamable HTTP. `verify_symbol` unpacks archives, so it needs the CPU time of the Workers Paid plan; the other tools run comfortably on the free plan.

## How it stays safe

1. **Read-only.** Every tool is annotated read-only and idempotent. Nothing is written anywhere.
2. **Fixed hosts.** Requests go only to the registries above, deps.dev and GitHub, from a hard-coded allowlist in `src/core/http.ts`. Redirects that leave that list are refused.
3. **Validated input.** Package names are checked against npm and PyPI naming rules, and symbols must be plain identifiers, before anything is fetched.
4. **Bounded work.** Downloads, unpacked size, file count and per-file size are capped. Tarballs are decompressed as a stream, and only files that mention the symbol are kept in memory.
5. **No secrets in the code.** The optional `GITHUB_TOKEN` is read from the environment, sent only to `api.github.com`, and dropped automatically if GitHub rejects it.

## Develop

```bash
npm install
npm run typecheck
npm test          # live tests: a real and a fake symbol in each of the ten ecosystems
npm run dev       # local Worker at http://localhost:8787/mcp
npm run build     # stdio build in dist/
```

Issues and pull requests are welcome, especially release-note parsing for projects whose changelogs DRIFT reads poorly. Please include the package name.

## License

MIT. Built by [Pivyon](https://pivyon.com).

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation4/5

whats_new and migrate overlap because both surface breaking changes, deprecations, and renames, but they differ by since-a-date/version vs explicit version range. verify_symbol and check_dependencies are clearly distinct, so most agents can select correctly with only minor risk.

Naming Consistency4/5

All names use lowercase snake_case, and most are action-oriented (verify_symbol, check_dependencies, whats_new). The single-word migrate is a minor deviation from the verb_noun pattern but remains readable and unambiguous.

Tool Count5/5

Four tools is well-scoped for a package-drift lookup server, and each tool has a clear role: discover changes, verify a symbol, plan migration, or audit dependencies. There is no obvious bloat or missing tool in the count.

Completeness4/5

The surface covers the core drift workflows: learning recent changes, checking symbol existence, migrating between versions, and auditing dependencies. Minor gaps remain, such as scanning actual codebase usage or searching replacements at scale, but agents can work around these with the existing tools.