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

@iqai/plugin-mcp

v0.2.2

Published

A **plugin** for interacting with **Model Context Protocol (MCP) servers** to mediate communication between the Brain Framework and external MCP servers.

Readme

🎛 Plugin MCP

A plugin for interacting with Model Context Protocol (MCP) servers to mediate communication between the Brain Framework and external MCP servers.


📌 Overview

The Plugin MCP acts as a mediator between Brain framework and an MCP server. It connects to an MCP server—either locally via stdio or remotely via SSE—retrieves available tools and converts them into actions that the Brain Framework can execute. The actions are generated dynamically based on the MCP server's capabilities.

There are two ways to configure the plugin:

  • Stdio Mode: For local MCP servers using process-based communication.
  • SSE Mode: For remote MCP servers using Server-Sent Events.

🛠 Installation

Install the plugin using pnpm:

pnpm add @iqai/plugin-mcp

⚙ Configuration

Configure the plugin with the following parameters:

| 🔧 Param Name | 📜 Description | Required | Default | |-------------------|--------------------------------------------------------------|----------|---------| | name | Name of the MCP plugin | Yes | - | | description | Description of the plugin | Yes | - | | transport | Transport configuration object (see below) | Yes | - | | handleResponse | Custom handler for processing tool call results | No | - | | disableToolChaining | Disable automatic tool chaining | No | false | | toolChainingTemplate | Custom template for tool chaining | No | - |

Transport Configuration

Stdio Mode

Use stdio mode when you want to run a local MCP server as a separate process.

| 🔧 Param Name | 📜 Description | |--------------------|-----------------------------------------------------------| | mode | Must be set to "stdio" | | command | Command to run the local MCP server process | | args | Arguments for the local MCP server process (string list) |

SSE Mode

Use sse mode to connect to a remote MCP server via Server-Sent Events. (Note: Authentication is not supported for SSE mode at this time.)

| 🔧 Param Name | 📜 Description | |--------------------|-----------------------------------------------------------| | mode | Must be set to "sse" | | serverUrl | The base URL of the remote MCP server | | headers | Headers to include (if any) in the request to the remote server |


🚀 Usage

Import and initialize the plugin using the createMcpPlugin method.

For a Local MCP Server (Stdio Mode)

import { createMcpPlugin } from "@iqai/plugin-mcp";

// Initialize the plugin with stdio configuration
const pluginFs = await createMcpPlugin({
  name: "file-system",
  description: "File system MCP server",
  transport: {
    mode: "stdio",
    command: "npx",
    args: [
      "-y",
      "@modelcontextprotocol/server-filesystem",
      "/home/user/",
      "/home/user/Desktop",
    ],
  }
});

For a Remote MCP Server (SSE Mode)

import { createMcpPlugin } from "@iqai/plugin-mcp";

// Initialize the plugin with sse configuration
const plugin = await createMcpPlugin({
  name: "remote-mcp-tools",
  description: "Remote MCP server tools",
  transport: {
    mode: "sse",
    serverUrl: "YOUR_SERVER_URL",
    headers: {}
  }
});

Once initialized, the plugin dynamically generates actions based on the MCP server's available tools, prompts, and resources.


🔄 Automatic Tool Chaining

The plugin features automatic tool chaining, which enables more powerful interactions between tools:

  • When a tool returns a file path, the system can automatically use filesystem tools if available to read the content
  • Structured data outputs from one tool can serve as inputs to another tool
  • Complex workflows can be automated without requiring explicit tool invocation for each step

For example, if a tool generates a code file and returns its path, the system will automatically detect this and can:

  1. Read the file content using filesystem tools if available by a plugin or via filesystem mcp server.
  2. Present the code with proper formatting
  3. Suggest further actions based on the file type

❌ Error Handling

The plugin manages various error scenarios, such as:

  • Connection failures to the MCP server.
  • Invalid tool, prompt, or resource requests.
  • Network errors or unexpected server responses.

Errors are logged and relayed as informative messages to the Brain UI.


🔒 Security Considerations

For SSE mode:

  • Ensure you are connecting to a trusted MCP server.
  • Use HTTPS endpoints for secure communication.
  • Validate all configuration parameters to avoid misconfigurations.

For tool chaining:

  • Be aware that tools will have access to the outputs of other tools
  • Consider potential security implications when chaining tools that access sensitive data

🔍 Learn More About MCP

For more details on the Model Context Protocol and available server implementations, check out these resources: