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 🙏

© 2025 – Pkg Stats / Ryan Hefner

crossroads-mcp

v0.0.2

Published

> A lightweight, flexible router for MCP (Model Context Protocol) servers, inspired by Hono router and a chat with @threepointone.

Readme

Crossroads MCP

A lightweight, flexible router for MCP (Model Context Protocol) servers, inspired by Hono router and a chat with @threepointone.

If you have a lot of MCP servers, this is for you. crossroads-mcp provides an elegant way to manage multiple MCP servers while using the AI SDK. Ensuring that only the server being used is running at any given time.

Features

  • 🚀 Simple Router API - Manage multiple MCP servers with an intuitive API
  • 🔄 Dynamic Server Management - Start and stop servers on demand during AI conversations
  • 🧰 Tool Integration - Seamlessly integrate tools from multiple MCP servers
  • 🔌 Multiple Transport Options - Support for both stdio and remote MCP servers

Installation

# Using pnpm
pnpm add crossroads-mcp

# Using npm
npm install crossroads-mcp

# Using yarn
yarn add crossroads-mcp

Quick Start

import { createMCPRouter } from "crossroads-mcp";
import { OpenAI } from "ai";

// Create a new MCP router
const router = createMCPRouter();

// Add MCP servers to the router
router.addServer({
  name: "search-server",
  description: "A server that provides search functionality",
  command: "node",
  args: ["./search-server.js"],
});

router.addServer({
  name: "weather-server",
  description: "A server that provides weather information",
  command: "node",
  args: ["./weather-server.js"],
});

const result = await router.generateText({
  model: openai("gpt-4o"),
  prompt:
    router.systemPrompt() +
    "Search for recent news about AI and tell me about the weather in New York",
  maxSteps: 10,
});

console.log(result.text);

API Reference

Creating a Router

import { createMCPRouter } from "crossroads-mcp";

// Create a new MCP router
const router = createMCPRouter();

// Or initialize with predefined servers
const router = createMCPRouter({
  servers: {
    "my-server": {
      name: "my-server",
      description: "My MCP server",
      command: "node",
      args: ["./my-server.js"],
    },
  },
});

Adding Servers

// Add a stdio MCP server
router.addServer({
  name: "stdio-server",
  description: "A server that runs locally",
  command: "node",
  args: ["./mcp-server.js"],
});

// Add a remote MCP server
router.addServer({
  name: "remote-server",
  description: "A server that runs remotely",
  url: "https://example.com/mcp",
  headers: {
    Authorization: "Bearer token",
  },
});

Generating Text

const result = await router.generateText({
  model: "gpt-4o",
  prompt: "Help me with my task",
  systemPrompt: router.systemPrompt(),
  maxSteps: 5,
  onStepFinish: (step) => {
    console.log("Step finished", step);
  },
});

Server Management

// Manually start a server
await router.startServer("my-server");

// Get all active tools from running servers
const tools = await router.getActiveTools();

// Stop all active servers
await router.stopActiveClients();