npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@humayunkabir/jev-router-mcp

v0.1.4

Published

MCP server that routes a question to the best tool using a Jev decision engine (/v1/systemone). Works with any Jev-compatible server — Laya is one.

Readme

jev-router-mcp

An MCP server that lets an agent decide which tool should answer a question using a Jev System-1 decision engine instead of guessing. It speaks the Jev /v1/systemone wire protocol, so it works with any Jev-compatible server — Laya is the reference implementation.

Give it a question, it returns the best tool pick with a confidence score, and the agent calls that tool.

What it does

  • route_code(question) — preset that picks between codegraph (exact symbols, signatures, call paths, blast radius, source), graft (repo overview, module wiring, related files), both, or neither (not a code-structure question).
  • route_query(question, options) — generic: you pass the tool ids and when-to-use descriptions, the decision engine picks the winner.

Both return { choice, confidence, probabilities, advice } so the agent knows what to call — and when the server is unreachable it says so and tells the agent to fall back to its own judgment.

$ jev-router-mcp
→ { "choice": "graft", "confidence": 0.39,
    "probabilities": { codegraph: 0.29, graft: 0.39, both: 0.23, neither: 0.09 },
    "advice": "Call the \"graft\" tool." }

Requirements

  • Node.js >= 20 (global fetch)
  • A running Jev-compatible server exposing POST /v1/systemone (e.g. Laya — see its self-host docs)
  • The tools you route to (e.g. graft, codegraph) configured as MCP servers in your client, so the agent can act on the verdict

Install

# run directly
npx -y @humayunkabir/jev-router-mcp

# install globally
npm install -g @humayunkabir/jev-router-mcp

Quick setup (interactive)

npx -y @humayunkabir/jev-router-mcp init
# answers two prompts (server URL, API key), offers to write your config,
# then wires the code-routing instruction below into an existing AGENTS.md
# (or prints exactly what to add where none exists)

Answers two prompts (server URL, API key), then asks "Write to ~/.config/opencode/opencode.jsonc?" — answering y merges the server into your opencode config automatically (it respects an existing mcp.servers shape; refuses and prints a snippet if your config is JSONC-with-comments it can't safely parse). Use init --write to skip the confirmation. Either way it then wires the code-routing instruction below into an existing AGENTS.md, or prints exactly what to add and where. Restart opencode afterwards.

OpenCode (manual)

Add to your opencode.json / opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "jev-router": {
      "type": "local",
      "command": ["npx", "-y", "@humayunkabir/jev-router-mcp"],
      "environment": {
        "JEV_URL": "http://localhost:8000",
        "JEV_API_KEY": "your-bearer-token"
      },
      "enabled": true
    }
  }
}

Any MCP client works the same way (Claude Desktop, Cursor, ...): configure a stdio server with the npx command and the env vars below.

Local checkout

git clone https://github.com/humayunkabir/jev-router-mcp
cd jev-router-mcp
npm install
node src/index.js        # speaks MCP over stdio; for config use:
# "command": ["node", "/path/to/jev-router-mcp/src/index.js"]

Configuration

| env var | default | description | | --- | --- | --- | | JEV_URL | http://localhost:8000 | Base URL of the decision server (trailing /v1/systemone is normalized). | | JEV_API_KEY | (none) | Bearer token for POST /v1/systemone. Omit for servers without auth. | | JEV_ROUTER_INSTRUCTIONS | built-in | Instructions for the route_query choice question. |

LAYA_URL / LAYA_API_KEY are accepted as aliases for JEV_URL / JEV_API_KEY, so existing Laya deployments keep working unchanged.

Using it

Tell the agent to consult the router before answering code-intelligence questions, e.g. in your AGENTS.md (jev-router-mcp init adds this for you when an AGENTS.md exists):

## Code routing

When a question needs code structure or repo context, call `route_code`
first, then the MCP tool it picks (or both when the verdict says `both`).

Example session:

  1. “Why is MAX_BODY_BYTES enforced in two places in serve.py?” → route_code → codegraph (symbols & call paths) → agent calls codegraph_explore.
  2. “How do the onboarding modules fit together?” → route_code → graft → agent calls graft_trace_calls / graft_repo_map.
  3. “Explain how JWT refresh tokens work” → route_code → neither → agent answers from reasoning, no code tool needed.

Development

npm test

Unit tests cover URL normalization, body building, verdict parsing, advice, env aliasing, opencode config merge/write, init's interactive and AGENTS.md-wiring behavior. Set TEST_JEV_URL (and optionally TEST_JEV_API_KEY) to also run a live routing test against your server.

License

MIT