Skip to main content
Glama
vercel-jev-mcp
by Ahesui

vercel-jev-mcp

A local stdio MCP server that gives Cursor, Codex, and other MCP clients typed TypeSafe Jev judgments over the Vercel AI Gateway. Jev returns Choice, Score, and Noul answers; the host agent still edits files and runs commands.

One key, one endpoint, one bill: AI_GATEWAY_API_KEY and POST https://ai-gateway.vercel.sh/v1/evaluate with model typesafe-ai/jev.

Tools

Tool

Purpose

jev_step

Route the next step and select a prepared call in one request

jev_coding_loop

Route the next step and decide whether a partner model is needed

jev_tool_route

Select an exact host-prepared tool call without generating arguments

jev_review

Assess a proposed patch

jev_verify

Check claims against supplied evidence

jev_gate

Combine patch review and claim verification in one upstream call

jev_screen

Screen untrusted content before the host reads it

jev_rank

Rank candidates supplied by the host

jev_evaluate

Ask custom, atomic typed questions

Results include typed answers, token usage, and an action: auto, review, or escalate. Confidence measures model certainty, not factual truth. Incomplete context never permits auto; reduce the input and submit it again for a complete judgment.

Question packs are MCP resources at jev://packs/{coding-loop,tool-route,step,review,verify,screen,rank,gate}.

Related MCP server: use-jev

Why the AI Gateway route

The judgment engine, the question packs, and the typed policy layer are unchanged. What the gateway adds:

  • One credential and one bill. AI_GATEWAY_API_KEY replaces a provider-specific key; model choice, routing, and fallbacks are gateway configuration, and the same key serves every other model you already route there.

  • Real per-call accounting. Each response carries gateway marketCost, a generationId, and token usage. The eval CLI and doctor surface them, so a Jev swarm is measurable instead of estimated.

  • Deadline-aware retry. Transient gateway failures (408, 429, 5xx, connection drops) are retried with exponential backoff, honouring Retry-After, and never past the tool deadline — the same shared budget that already covers ranking rounds.

  • No vendor SDK. The transport is a typed fetch call against the documented wire contract; the internal domain model in src/jev-types.ts stays the single source of truth for what the tools see.

Coding with fewer partner-model turns

jev_step answers the whole loop turn in one request: it routes the step and, when the host supplies prepared calls, selects among them. A host that would otherwise call jev_coding_loop and then jev_tool_route spends one MCP round-trip instead of two, so it spends one host-model turn instead of two. Both original tools remain available.

Let host code execute known steps and prepare exact tool calls from an existing plan. When a semantic choice is needed, pass those calls to jev_step or jev_tool_route; either returns an executable call only for a confident, suitable selection with complete context and validated host facts. The host executes that call and routes again using the new observation. Jev never invents arguments or executes tools.

When a new plan or code may be needed, use jev_coding_loop with trusted execution facts. Its handoff distinguishes tool use, context gathering, review, user input, stopping, and a partner model. Invoke a generative partner only when partner_model.required is true; the legacy model_tier answer alone does not request a model turn. Uncertainty and escalation do not automatically spend a partner turn.

The prepared-call router accepts at most 32 candidates. Empty or wholly ineligible lists return locally with zero Jev usage. Other routing calls use Jev; this reduces unnecessary generative handoffs by policy, but live quality and cost savings have not been measured. See the tool contracts and host workflow.

Quick start

Install Node 20+ and run from a checkout:

npm ci
npm run build

Set an AI Gateway API key in your shell, then run diagnostics:

export AI_GATEWAY_API_KEY=vck_...
node dist/index.js doctor
node dist/index.js doctor --json

PowerShell:

$env:AI_GATEWAY_API_KEY = 'vck_...'
node dist/index.js doctor --json

For a deterministic local demo, set JEV_MCP_MOCK=1 instead. Mock mode is for tests and demos, not production decisions. Neither the CLI nor MCP automatically reads .env; see configuration for explicit environment-file use.

Cursor: copy the MCP example into .cursor/mcp.json, replace its argument with the absolute path to this checkout's dist/index.js, and set the key in env.

Codex: register the absolute path:

codex mcp add jev --env AI_GATEWAY_API_KEY=vck_... -- node /absolute/path/to/vercel-jev-mcp/dist/index.js

Copy the agent skill into the project so the host knows when to call these tools. Detailed setup is in installation.

CLI

node dist/index.js                       # stdio MCP
node dist/index.js doctor                # human-readable diagnostics on stderr
node dist/index.js doctor --json         # structured diagnostics on stdout
node dist/index.js eval --stdin < request.json

An evaluation request contains state and a questions map:

{
  "state": "Production payouts are failing. Urgent.",
  "questions": {
    "urgent": { "type": "noul", "instructions": "Is this urgent?" }
  }
}

eval prints the typed answers plus usage and, on a live call, the gateway's provider block (cost_usd, generation_id):

{
  "answers": { "urgent": { "type": "noul", "noul": 0.92 } },
  "usage": { "input_tokens": 407, "output_tokens": 70 },
  "provider": { "cost_usd": 0.000011592, "generation_id": "gen_01M2YEY6S02VMFPV8BMED0PX0G" }
}

Diagnostics do not log request content or API keys. Calls have a 30-second total deadline by default, configurable with JEV_MCP_TIMEOUT_MS; transient gateway failures retry inside that deadline. API failures and invalid responses return typed errors rather than fabricated judgments.

Limits and policy

State plus questions must fit the estimated 64,000-token total budget and the 32,000-token state-plus-longest-question budget. State may be shortened; results expose incomplete coverage and cannot automatically accept a judgment based on omitted context. Questions alone that exceed the budget are rejected. State is sent to the gateway as text, so a truncated evaluation truncates what Jev reads, not just what you see.

Rank accepts unique candidate IDs and at most 5,000 supplied candidates, with at most 250 options per upstream call. Larger lists use repeated reduction rounds; each candidate text is capped at 2,000 characters. Verify and gate accept at most 1,000 claims. A Score question takes 2 to 10 levels, which is the gateway's own limit and is enforced before any request. It ranks supplied candidates and does not index your repository. Arithmetic and date calculations belong in host code.

All nine tools expose an MCP output schema and return the same successful payload through both structuredContent and the JSON text content. Tool-route and fused-step judgments receive sanitized candidate descriptions and argument shapes; raw host arguments are retained only for the selected, locally validated call.

Development

npm test
npm run typecheck
npm run build
npm run test:package
npm run benchmark

The regular suite runs without a key; the live test is skipped unless AI_GATEWAY_API_KEY is present and mock mode is disabled. Package smoke testing builds and packs the project, installs the tarball into an isolated directory with npm --offline, then runs its shipped CLI. npm run benchmark builds the compiled server and measures the real MCP stdio transport in deterministic mock mode: sequential and concurrent calls, payload-size scaling, and candidate-count scaling. Use npm run benchmark:ci to apply broad sanity budgets; set JEV_BENCH_ITERATIONS, JEV_BENCH_CONCURRENCY, JEV_BENCH_MAX_P95_MS, or JEV_BENCH_MIN_RPS to tune a run. Run npm ci first to populate the dependency cache. No test publishes the package.

npm pack and npm publish build automatically through prepack. CI checks Node 20 and 22 on Windows and Linux, including the offline packed-install smoke test, entirely offline and in mock mode.

Documentation

Document

Contents

Changelog

Unreleased changes, compatibility notes, and validation

Architecture

Request path, gateway transport, policy, limits, and errors

Tools

Arguments and outputs for all nine tools

Install

Host configuration for Cursor, Codex, and other MCP clients

Configuration

Environment, thresholds, diagnostics, tests

Agent skill

Calling guidance for the host

AGENTS.md

Short project guidance

Available Tools

9 tools
jev_coding_loopJev coding-loop routerA
Read-onlyIdempotent

Call before retry/stop/model-tier decisions. One Jev fan-out returns next, risk, focus, and explicit handoff / partner_model fields. Prefer prepared tools or gathering context; request a partner generative model only when needed and confidently supported. Legacy model_tier is conditional, not an instruction to invoke a model. Does not edit files.

Inputs: task (required), observation (required), model, extras, +3 more. Returns: next, risk, focus, model, +12 more

jev_evaluateEvaluate with JevA
Read-onlyIdempotent

Escape hatch: send shared state plus named noul/choice/score questions to TypeSafe Jev. Use when no other jev_* recipe fits. Jev does not write code or prose. Questions in one call run in parallel. Returns typed answers, probabilities, confidence, usage, and action auto|review|escalate.

Inputs: state (required), questions (required), model. Returns: model, usage, action, answers, +2 more

jev_gateJev combined review gateA
Read-onlyIdempotent

Review a proposed patch and verify completion claims against supplied evidence in one Jev request. Returns review and verification reports, coverage, deterministic reason codes, and one overall auto|review|escalate action. Does not apply changes or execute tests.

Inputs: diff (required), claims (required), request (required), evidence (required), +4 more. Returns: model, usage, action, review, +4 more

jev_rankJev candidate rankerA
Read-onlyIdempotent

Rank files, symbols, errors, or skills against a plain-language query. No embeddings. One Choice over candidate ids plus a Noul that the top hit actually answers the query (so a forced winner cannot masquerade as a match). Accepts up to 5,000 supplied candidates; each Jev call uses at most 250 options and larger lists are chunked then re-ranked. Pass candidates in; this server does not index the repo.

Inputs: query (required), candidates (required), model, top_k. Returns: top, model, usage, action, +8 more

jev_reviewJev patch reviewA
Read-onlyIdempotent

Score a proposed diff against the request: correctness, spec-match, test-gap, blast-radius, plus noul safe_to_apply. Composite weights live in code. Call before declaring a fix done. Does not apply the patch.

Inputs: diff (required), request (required), model, tests, +2 more. Returns: model, usage, action, scores, +6 more

jev_screenJev content screenA
Read-onlyIdempotent

Judge fetched or pasted text before the agent reads it: prompt-injection probability, substance, and optional relevance to purpose. Recommendation: pass|review|block|skip. Use on untrusted web pages, issues, and pastes. Not for first-party repo files.

Inputs: text (required), model, purpose, block_at, +1 more. Returns: model, usage, action, coverage, +4 more

jev_stepJev fused step routerA
Read-onlyIdempotent

One call instead of jev_coding_loop then jev_tool_route: route the coding step and select among up to 32 host-prepared calls in a single Jev request. Returns the exact call with handoff execute_tool, or handoff use_tools|gather_context|partner_model|ask_user|stop|review with call null. Same dispatch floors. Never generates arguments, executes calls, or invokes a model.

Inputs: task (required), observation (required), model, extras, +4 more. Returns: call, next, risk, focus, +16 more

jev_tool_routeJev prepared tool-call routerA
Read-onlyIdempotent

Choose among up to 32 exact host-prepared tool calls without generating arguments or invoking a partner model. Host supplies trusted authorization, schema validation, prerequisites, effect and retry counts. Only confident, suitable, complete, low-risk selections expose a call; otherwise call is null. Empty/ineligible lists return locally without Jev. This server never executes the selected call. Use jev_coding_loop if new generation may be necessary.

Inputs: task (required), candidates (required), observation (required), model, +2 more. Returns: call, model, usage, action, +8 more

jev_verifyJev claim verifierA
Read-onlyIdempotent

Check each claim against provided evidence (PR description, agent brief, docs, diffs). Returns per claim: verified|contradicted|unsupported, probabilities, confidence, and auto vs review. Prefer this over asking a chat model to 'double-check'.

Inputs: claims (required), evidence (required), model, auto_accept. Returns: model, usage, action, results, +4 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 9 tools

    Disambiguation3/5

    The tools are largely distinct, but a few are deliberately composite or overlapping: jev_step is effectively jev_coding_loop plus jev_tool_route, and jev_gate bundles jev_review and jev_verify. An agent must read the long descriptions carefully to select the right orchestration recipe, so misselection is possible despite the clear use-case notes.

    Naming Consistency4/5

    All tools share the consistent jev_ prefix and lowercase snake_case style, which makes the set feel predictable. However, the suffix pattern is mixed: verb-style names like jev_review, jev_verify, and jev_rank sit alongside noun-style names like jev_gate, jev_step, and jev_coding_loop, plus the compound noun jev_tool_route.

    Tool Count5/5

    Nine tools is a well-scoped count for this kind of workflow server, and each tool maps to a recognizable phase: screening, ranking, evaluation, routing, stepping, review, verification, and final gating. None of the tools feel like filler, and the set is large enough to cover meaningful decisions without becoming unwieldy.

    Completeness5/5

    The toolset covers the full intended lifecycle for a decision/review server: untrusted text screening, candidate ranking, arbitrary typed evaluation, tool/step routing, next-action loop decisions, diff review, claim verification, and a combined final gate. The deliberate exclusion of file edits/execution is consistent with the stated purpose, and jev_evaluate acts as an escape hatch to prevent dead ends.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables AI agents to obtain typed judgments from TypeSafe's Jev System One models, including yes/no probabilities, multiple-choice selections with distributions, and rubric-based scores, directly usable in code.
      5
      2
      AGPL 3.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-capable agents to run TypeSafe's Jev judgment model as typed yes/no, choice, and score tools, with calibrated probabilities, confidence thresholds, escalation for uncertain or non-judgment tasks, and an optional action gate that fails open.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes local MCP tools for typed, calibrated LLM decisions — gating risky actions, yes/no judging, classification, ordinal rating, and multi-question decisions in one pass. Runs on the model Devin's CLI already provides via ACP (or a fully offline local backend), so agents get calibrated confidence with no extra API key, no Ollama, and no waitlist.
      42 PyPI
      6
      MIT