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

openclaw-mcp-router

v1.1.0

Published

Dynamic MCP tool router for OpenClaw — semantic search over large MCP catalogs to eliminate context bloat

Downloads

503

Readme

OpenClaw MCP Router 🚀

OpenClaw MCP Router is an OpenClaw plugin that keeps MCP tool catalogs out of the system prompt until needed.

Instead of injecting every MCP schema up front, it provides two lightweight meta-tools:

  • mcp_search → discover the right tool at runtime
  • mcp_call → execute as JSON fallback

This cuts context bloat and improves tool selection quality on large MCP catalogs.


Why this exists

Large MCP catalogs are expensive in prompt space.

  • Token waste: tens of thousands of tokens before first user turn
  • Reasoning quality loss: "lost in the middle" on oversized prompts
  • Higher cost: more prompt tokens every turn

MCP Router applies Anthropic's tool-search pattern so only relevant tools are surfaced when needed.

Refs:


Core model

1) Index time (reindex)

  • Connect to configured MCP servers
  • List tools
  • Embed tool text
  • Store vectors in LanceDB
  • Register tool→server ownership
  • (Optional) generate CLI artifacts via mcporter generate-cli

2) Runtime (mcp_search)

  • Semantic search over indexed tools
  • Default schema verbosity is adaptive:
    • if mcporter is available: compact cards by default
    • if mcporter is not available: include JSON params by default
  • Full JSON schema can always be forced with include_schema=true

3) Execute (mcp_call)

  • JSON-based execution path (classic MCP params flow)

CLI-first behavior (new)

Router is now optimized for a CLI-first workflow:

  • Prefer: mcporter call <server>.<tool> ...
  • Fallback: mcp_call(tool_name, params_json)

mcp_search adapts to environment: compact when mcporter is present, schema-forward when it is not (so agents can drive mcp_call reliably).


Quick start

Prerequisites

ollama pull embeddinggemma

Install

openclaw plugins install openclaw-mcp-router

Setup + index

openclaw openclaw-mcp-router setup
openclaw openclaw-mcp-router reindex

The setup wizard auto-detects whether mcporter is installed and suggests a sensible default for mcp_search schema verbosity.


Key configuration

In ~/.openclaw/openclaw.json under plugins.entries.openclaw-mcp-router.config:

{
  "search": {
    "topK": 5,
    "minScore": 0.3
    // includeParametersDefault optional:
    // true  -> always include params
    // false -> always compact
    // unset -> auto (based on mcporter availability)
  },
  "indexer": {
    "connectTimeout": 60000,
    "maxRetries": 3,
    "initialRetryDelay": 2000,
    "maxRetryDelay": 30000,
    "maxChunkChars": 500,
    "overlapChars": 100,
    "generateCliArtifacts": false
  }
}

Notes

  • search.includeParametersDefault is optional; if omitted, router auto-decides based on mcporter availability.
  • indexer.generateCliArtifacts=true enables best-effort per-server mcporter generate-cli during reindex.
  • mcp_call stays the classic JSON meta-tool (no backend mode flag).

Server management

openclaw openclaw-mcp-router control
openclaw openclaw-mcp-router list
openclaw openclaw-mcp-router add <name> <command-or-url> [...]
openclaw openclaw-mcp-router reindex

MCPorter inspiration

Huge thanks to @steipete and mcporter for the CLI-first MCP execution model inspiration.


Documentation

  • Architecture + flow details: docs/CLI_FIRST_WORKFLOW.md
  • Plugin config schema: openclaw.plugin.json
  • Skill usage examples: skills/mcp-router/

Contributing

PRs welcome — especially around:

  • better reranking
  • hybrid retrieval (vector + lexical)

PR hygiene:

  • keep README + docs in sync for every behavior/config/workflow change
  • keep skills/ guidance in sync when user-facing behavior changes
  • run test suite before opening PR

License

MIT