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

mcpalette

v0.1.0

Published

Least-context tool palettes for AI agents and MCP tool catalogs.

Readme

mcpalette

mcpalette builds a small, task-shaped palette from a larger MCP or agent tool catalog.

Agent runtimes are getting more tools, more autonomy, and more risk surface. Exposing every available tool to every task increases context cost and makes tool metadata a supply-chain input. mcpalette keeps that boundary boring: deterministic ranking, context budgeting, and metadata audit in one zero-runtime-dependency TypeScript package.

What it does

  • Ranks tools against a user task using local lexical matching.
  • Selects the smallest useful set under maxTools and an estimated token budget.
  • Rejects high-risk tool metadata by default.
  • Flags hidden Unicode, prompt-override wording, secret exfiltration hints, risky shell snippets, oversized metadata, and URLs outside an allowlist.
  • Emits either structured JSON or a compact agent-facing brief.

Install

npm install mcpalette

Requires Node.js 20 or newer.

Library usage

import { createPalette, formatToolBrief } from "mcpalette";

const tools = [
  {
    name: "github.searchIssues",
    description: "Search GitHub issues by repository, label, assignee, and update time.",
    inputSchema: {
      type: "object",
      properties: {
        query: { type: "string" }
      }
    }
  },
  {
    name: "calendar.createEvent",
    description: "Create a calendar event with guests and a start time."
  }
];

const palette = createPalette("find recent GitHub issues", tools, {
  maxTools: 4,
  tokenBudget: 1200,
  allowedDomains: ["github.com"]
});

console.log(palette.selected.map((entry) => entry.tool.name));
console.log(formatToolBrief(palette));

CLI usage

mcpalette tools.json --task "find recent GitHub issues" --max-tools 4 --budget 1200

Use stdin when you do not want a file path:

cat tools.json | mcpalette --task "summarize release notes" --brief

Machine-readable output:

mcpalette tools.json --task "triage a repository" --json

Input shape

mcpalette accepts an array of tools:

[
  {
    "name": "docs.search",
    "description": "Search internal docs.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "query": { "type": "string" }
      }
    }
  }
]

It also accepts common MCP listTools wrappers:

{
  "result": {
    "tools": [
      {
        "name": "docs.search",
        "description": "Search internal docs."
      }
    ]
  }
}

API

createPalette(task, tools, options)

Returns selected and rejected tools with scores, findings, reasons, and budget usage.

Key options:

  • maxTools: maximum selected tools. Default: 8.
  • tokenBudget: estimated context budget. Default: 2400.
  • minScore: minimum relevance score. Default: 0.25 for non-empty tasks.
  • includeRisky: include high-risk metadata instead of rejecting it. Default: false.
  • allowedDomains: URL host allowlist for tool metadata.
  • aliases: task-token expansions, useful for local vocabulary.

auditTool(tool, options)

Runs metadata checks without selecting tools.

formatToolBrief(result, options)

Builds a compact text block for agent context. Suspicious Unicode is stripped from the brief.

Design notes

mcpalette is intentionally small. It is not a full policy engine, an MCP proxy, or an LLM-based security classifier. Put it before those layers when you need a fast local pre-filter: choose fewer tools, spend fewer tokens, and review suspicious metadata before it becomes agent context.

Development

npm install
npm test

License

MIT