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

@infra-tools/agentic-ui-mcp

v1.3.0

Published

Expose @infra-tools/agentic-ui ToolDefs as a Model Context Protocol (MCP) server — Claude Desktop / Cursor / Zed / Continue / Windsurf can call your tools directly.

Readme

@infra-tools/agentic-ui-mcp

npm License: Apache-2.0

Expose @infra-tools/agentic-ui ToolDefs as a Model Context Protocol (MCP) server. The same tools your <mvk-chat-shell> invokes become callable from Claude Desktop, Cursor, Zed, Continue, Windsurf, and any other MCP-compatible host — without rewriting the handlers.

See ADR-006 for the design rationale.

Install

npm install @infra-tools/agentic-ui-mcp

Peer dep: @infra-tools/agentic-ui (you'll already have it if you're publishing tools you wrote for the chat shell). zod is the validation library ToolDefs use.

Wrap your tools as an MCP server

// my-mcp-server.ts (run with `tsx`/`node`)
import { createMcpServer } from '@infra-tools/agentic-ui-mcp';
import { myTools } from './tools.js';   // your existing ToolDef[]

const server = createMcpServer({
  name: 'my-server',
  version: '0.1.0',
  tools: myTools,
});

await server.start();   // stdio transport by default
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/absolute/path/to/my-mcp-server.js"]
    }
  }
}

Restart Claude Desktop. Your tools are now in the tool picker.

What's exported

| Surface | Purpose | |---------|---------| | createMcpServer(opts) | Builds an MCP Server that exposes the given ToolDef[] as MCP tools. Returns a handle with start() / stop() | | BeforeCallHook / AfterCallHook | Per-tool middleware seams — log every invocation, redact PII, fail closed on policy violations | | formatToolResult(result) | Maps an agentic-ui tool result (text + render hints + components) into MCP ContentBlock[]. Emits a text/html resource with a ui:// URI (the MCP-UI convention) for inline-rendered HTML | | zodToMcpSchema(schema, name) | Translates a Zod input schema into the JSON-Schema fragment MCP requires | | syntheticToolContext({...}) | Builds a ToolContext shaped to satisfy your existing handler when invoked from MCP (no Component, no Backend — those are browser concerns) | | MCP_UI_HTML_MIME | The text/html MCP-UI MIME constant for tools that return HTML render hints (matches the inbound renderer in @infra-tools/agentic-ui) |

Common patterns

Per-user audit attribution

const server = createMcpServer({
  name: 'ediscovery',
  version: '0.1.0',
  tools,
  beforeCall: async (ctx) => {
    ctx.principal = await resolvePrincipal({
      userId: process.env.MCP_USER_ID,            // set per-user in env
      mcpClient: ctx.clientInfo?.name ?? 'unknown',
    });
  },
  afterCall: async (ctx, result) => {
    auditChain.append({
      tool: ctx.toolName,
      principal: ctx.principal,
      args: ctx.args,
      result,
      origin: 'mcp',
      ts: new Date().toISOString(),
    });
  },
});

Inline-rendering HTML in MCP hosts that support it

When a tool returns { ...result, renderHints: { html: '<...>' } }, formatToolResult emits a resource block with MIME text/html and a ui:// URI — the MCP-UI convention. MCP-UI–aware hosts render it inline in a sandboxed iframe; hosts without UI support fall back to the resource's plain-text representation.

Demos

Full docs

Compatibility

| Tool | Version | |------|---------| | Node.js | ≥ 20.19 | | TypeScript | 5.9+ | | MCP SDK | ^1.0.0 (transitive via @modelcontextprotocol/sdk) |

License

Apache 2.0