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

pi-mcp-bridge

v0.1.0

Published

A minimal pi extension that exposes MCP server tools to pi via stdio transport.

Downloads

38

Readme

pi-mcp-bridge

A minimal MCP client extension for pi.

Attach any MCP server to pi. The extension spawns the server as a persistent subprocess, discovers its tools via the standard MCP handshake, and registers them so the pi agent can call them directly — no per-call startup overhead, no stubs.

Install

# From pi.dev gallery
pi install https://github.com/tmonk/pi-mcp-bridge
# Or try without installing
MCP_SERVER_CMD="python -m my_mcp_server" pi -e https://github.com/tmonk/pi-mcp-bridge "Run my tool"

Usage

# Load with an MCP server
MCP_SERVER_CMD="python -m my_mcp_server" pi "Run a query with my MCP tool"

# With a working directory and extra args
MCP_SERVER_DIR=~/projects/my-server MCP_SERVER_CMD="node server.js" MCP_SERVER_ARGS='["--port", "8080"]' pi "..."

# With pi's isolation flags
MCP_SERVER_DIR=~/projects/my-server pi -p --no-extensions --no-skills "Use the registered tool"

How it works

  1. On load — spawns the MCP server as a persistent subprocess and completes the initialization handshake (initializenotifications/initialized).
  2. Discovery — issues tools/list, then calls pi.registerTool() for each discovered tool with dynamically converted TypeBox parameter schemas.
  3. Execution — when the agent calls a tool, sends tools/call over the persistent connection and returns the result. No subprocess spawned per call.
  4. Cleanup — on session_shutdown, gracefully shuts down the server (SIGTERM → SIGKILL after 2s).

Configuration

| Variable | Description | |---|---| | MCP_SERVER_CMD | Command to run the MCP server (required) | | MCP_SERVER_DIR | Working directory for the server (optional) | | MCP_SERVER_ARGS | JSON array of extra CLI arguments (optional) |

Features

  • Persistent connection — single subprocess for all tool calls (10x+ faster for warm calls vs. spawn-per-call)
  • Dynamic schemas — MCP inputSchema → TypeBox conversion gives the LLM proper parameter types for each tool
  • Concurrent requests — JSON-RPC ID-based promise matching handles overlapping tool calls
  • Graceful shutdown — protocol-level shutdown + SIGTERM + SIGKILL fallback
  • Timeout protection — per-request timeout (default 30s) prevents hanging on unresponsive servers
  • Stderr forwarding — server diagnostics are forwarded to pi's stderr

Development

git clone https://github.com/tmonk/pi-mcp-bridge
cd pi-mcp-bridge
npm install
npm test

The extension is a single index.ts file. Pi loads it via jiti — no build step.

Test

npm test            # 35 tests (unit + integration + e2e)
npm run test:watch  # watch mode
npm run test:coverage

License

MIT