A TypeScript MCP server for coding agents.

vetd gives Claude Code, Cursor, Codex and any other MCP client a check tool. The agent sends a diff and gets TypeScript errors, Next.js and web rule violations, affected routes and affected tests back before anything is written to disk.

What the agent gets

  • checkType errors and rule violations for a patch, checked in memory.
  • runTestsOnly the Vitest files the change can affect.
  • impactWho imports or calls a file or symbol, before the agent changes it.
  • explainWhy a rule fired and how to fix it.
  • forkTry two approaches side by side and keep the one that passes.
  • commitWrite the kept fork to disk, atomically per file.

The full tool list is in the docs. Every MCP client talks to the same server command:

npx --no-install vetd mcp

Claude Code

vetd init writes .mcp.json, which Claude Code reads, and adds the agent guide to AGENTS.md. Commit both so the whole team gets it.

npx vetd init

Or add it by hand:

claude mcp add vetd -- npx --no-install vetd mcp

If the project only has a CLAUDE.md, add a line containing @AGENTS.md to it.

Cursor, Windsurf and Gemini CLI

Add the server to .cursor/mcp.json, or the equivalent file for your client:

{ "mcpServers": { "vetd": { "command": "npx", "args": ["--no-install", "vetd", "mcp"] } } }

Codex

Add it to ~/.codex/config.toml:

[mcp_servers.vetd]
command = "npx"
args = ["--no-install", "vetd", "mcp"]

VS Code

Add it to .vscode/mcp.json:

{ "servers": { "vetd": { "type": "stdio", "command": "npx", "args": ["--no-install", "vetd", "mcp"] } } }

The agent guide

Agents follow what AGENTS.md tells them. init appends this section once and leaves the rest of the file alone:

## vetd verification

This project uses vetd for fast TypeScript and framework checks. After changing code, call the vetd MCP `check` tool with a unified diff or whole-file writes. Changes stay in an in-memory fork until you call `commit`. Review `typeErrors`, `ruleViolations`, `recheck`, and `fallback`; do not treat an unsupported or failed check as a pass. Use `runTests` with scope `affected` for relevant Vitest tests. Use `explain` for a diagnostic ID and `impact` before changing shared exports. Run `verify` when the incremental result needs a second check; `verify` with `oracle: true` runs a slow independent full tsgo check. Keep the project's full build and CI checks as the release gate.

FAQ

Which agents work with vetd?

Any client that speaks the Model Context Protocol over stdio, including Claude Code, Cursor, Codex, VS Code, Windsurf and Gemini CLI. Agents without MCP can pipe a diff to npx vetd check --patch -.

Does the agent's edit touch my files before it passes?

No. check applies the patch to an in-memory fork. Files change only when the agent calls commit.

What happens when several agents run at once?

They share one daemon per repository, including across git worktrees, so you get one warm checker instead of one compiler per agent.

What does an agent see when a check fails?

ok: false with typeErrors and ruleViolations, each with a file, position and message. Errors that were already on disk come back marked preexisting and don't fail the check.