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

@node-llm/mcp

v0.1.4

Published

MCP (Model Context Protocol) integration for NodeLLM

Downloads

76

Readme

@node-llm/mcp

Model Context Protocol (MCP) support for NodeLLM.

This package turns NodeLLM into a full-featured MCP Host, allowing you to connect your AI agents to hundreds of external servers (GitHub, Postgres, Slack, Google Drive, etc.) using a unified JSON-RPC protocol.

🚀 Quick Start

npm install @node-llm/mcp

1. Simple Discovery

Connect to a server and automatically register all its tools.

import { createLLM } from "@node-llm/core";
import { MCP } from "@node-llm/mcp";

const llm = createLLM();

// Connect and setup logging in one chain
const mcp = (
  await MCP.connect({
    command: "npx",
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/docs"]
  })
).onLog((e) => console.log(e.message));

// Discover all tools
const tools = await mcp.discoverTools();

// Use them in a chat
const chat = llm.chat().withTools(tools);
await chat.ask("List the files and summarize the README.md");

// Always close the connection when done
await mcp.close();

🛠 Features

🛰️ Multi-Server Support

Initialize multiple servers concurrently from a central configuration.

const mcps = await MCP.connectAll({
  github: { command: "npx", args: ["-y", "@modelcontextprotocol/server-github"] },
  slack: { url: "https://slack.mcp.example.com/sse" }
});

const tools = [
  ...(await mcps.github.discoverTools({ prefix: "gh_" })),
  ...(await mcps.slack.discoverTools({ prefix: "slack_" }))
];

Event DSL

Register listeners using a clean, chainable API inspired by RubyLLM.

mcp
  .onLog(({ level, message }) => console.log(`[${level}] ${message}`))
  .onProgress((p) => console.log(`Step ${p.progress} of ${p.total}`))
  .onError((err) => console.error("Crash:", err));

🔍 Discovery Types

You can discover capabilities individually or all at once:

Full Manifest (Unified):

const { tools, resources, prompts } = await mcp.discover();

Granular Discovery:

const tools = await mcp.discoverTools();
const resources = await mcp.discoverResources();
const prompts = await mcp.discoverPrompts();

🏷 Namespacing

Avoid tool name collisions when connecting to multiple MCP servers by using prefixes.

const githubTools = await githubMcp.discoverTools({ prefix: "github_" });
const slackTools = await slackMcp.discoverTools({ prefix: "slack_" });

📝 Prompt Templates

Resolve server-side prompt templates with arguments:

const prompts = await mcp.discoverPrompts({ filter: ["analyze-code"] });
const resolved = await prompts[0].get({ path: "src/index.ts" });
console.log(resolved.messages[0].content.text);

📂 Resources

Read server-side resources directly:

const resources = await mcp.discoverResources();
const readme = resources.find((r) => r.name === "README.md");
const text = await readme.readText(); // Concatenated text content

🌉 Architecture

The @node-llm/mcp package acts as a bridge. It consumes the standardized MCP protocol and translates it into native NodeLLM Tool objects and context.

For more details on the internals and real-world patterns, see the Official Documentation.

📄 License

MIT