unplugin-mcp logo

unplugin-mcp

Community
situ2001

A unified plugin for developers integrating MCP servers into modern JavaScript build tools, including Webpack, Rollup, Vite, and more.

Publishersitu2001
Repositoryunplugin-mcp
LanguageTypeScript
Forks
2
Stars
31
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    unplugin-mcp exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    31 stars and 2 forks from the linked repository.

unplugin-mcp

GitHub Repo npm version npm download npm license

[!IMPORTANT] This is a work in progress. Not ready for production use yet. If you are interested in and want to help, feel free to open an issue or PR.

A unified MCP (Model Context Protocol) plugin that creates and manages an MCP Server and provides MCP tools by which AI can know more about your codebase, build tools, and even control the build process. It works with multiple JavaScript build tools supported by unplugin, including Rollup, Vite, Webpack, and others.

Here is the vision of this plugin, to provide a unified MCP Server and MCP tools to MCP Client.

Features

  • 🚀 Cross-Platform MCP Integration: Creates and manages an MCP server seamlessly across multiple build tools.
  • 🧩 Bi-directional AI Integration: Not only provides context to AI assistants about your codebase, but also enables AI to actively modify and control your build process.
  • 🧰 Rich built-in tools: Collection of built-in tools for analyzing module dependencies, inspecting build configuration, debugging error messages, and so on.
  • 🛠️ Extensible Tool Framework: Create custom MCP tools with the simple UnpluginMcpTool interface to expose project-specific information or functionality.
  • 🔍 Build Process Integration: Seamlessly integrates at any point in the plugin chain and hooks of your build tools like Rollup.
  • 🔄 Persistent Server: Keeps running even after build completion in watch mode, enabling continuous AI interaction.
  • 🌐 Standard Transport Layer: Uses HTTP and Server-Sent Events (SSE) for broad compatibility with AI assistants implementing the MCP protocol.

Installation

bash
# Install the plugin
pnpm add -D unplugin-mcp

# or install bundler-specific one, it shares the same codebase but only exports the plugin for the specific bundler
pnpm add -D rollup-plugin-mcp

Usage

Build Tool Integration

Here is an example of how to use the plugin with Rollup. The server will be started automatically when you run rollup in watch mode (rollup -w).

js
// rollup.config.js
import { defineConfig } from 'rollup';
import { rollupPlugin as mcp } from 'unplugin-mcp';

// import some built-in tools
import { ModuleTool, BuildConfigTool, BuildErrorTool } from 'unplugin-mcp/tools';

export default defineConfig({
  plugins: [
    // other plugins...
    mcp({
      provideUnpluginMcpTools: () => [
        new ModuleTool(),
        new BuildConfigTool(),
        new BuildErrorTool()
      ]
    }),
    // other plugins...
  ]
});

🚧 Usage on other bundlers is on the way.

Usage in Cursor

Just add a MCP Server to Cursor Settings. For example, in ~/.config/cursor/mcp.json:

json
{
  "mcpServers": {
    "rollup": {
      "url": "http://localhost:14514/mcp/sse"
    }
  }
}

Options

Check McpPluginOptions in types file for all available options.

Built-in Tools Compatibility

Notes: Currently, implementation of built-in tools is relatively simple and may not cover all edge cases.

ToolDescriptionRollupWebpack
ModuleToolAnalyze module dependencies and imports✅❌
BuildConfigToolInspect build configuration✅✅
BuildErrorToolDebug build errors✅✅
BundleSizeToolInspect size of bundle and its modules✅❌
  • ✅ = Supported
  • ❌ = Not yet implemented

Custom Tools

You can extend the plugin with custom tools implementing the UnpluginMcpTool interface:

typescript
import { InputOptions } from "rollup";
import { UnpluginMcpTool, UnpluginMcpToolSetupOptions } from "unplugin-mcp";
import DeferredCtor, { Deferred } from 'promise-deferred';
import { UnpluginOptions } from "unplugin";

export class BuildConfigTool implements UnpluginMcpTool {
  private buildConfig: Deferred<InputOptions>;

  affectsBuildProcess: boolean = false;

  constructor() {
    this.buildConfig = new DeferredCtor<InputOptions>();
  }

  setupMcpServer(mcpServer: any, options?: any) {
    mcpServer.tool(
      `get-build-config`,
      "Get build configuration",
      {},
      async () => {
        const cfg = await this.buildConfig.promise;

        return {
          content: [
            {
              type: 'text',
              text: `Build configuration: ${JSON.stringify(cfg)}`
            }
          ]
        };
      }
    );

    return mcpServer;
  }

  registerPlugins(options?: UnpluginMcpToolSetupOptions): UnpluginOptions {
    let self = this;

    return {
      name: 'build-config-tool',

      rollup: {
        options(config) {
          self.buildConfig.resolve(config);
        }
      }
    }
  }
}

And then register it in the plugin options, for example, in the Rollup config:

js
// rollup.config.js
// ... 
plugins: [
  mcp({
    provideUnpluginMcpTools: () => [
      new BuildConfigTool()
    ]
  })
]
// ...

Examples

Check out the examples directory for working examples, including:

  • simple-hello: A basic example demonstrating MCP integration with Rollup

How it works

It initializes and setup these components:

  1. Creates and setup a singleton MCP server instance.
  2. Registers some UnpluginMcpTool instances to the MCP server.
  3. Creates an HTTP server and sets up HTTP routes for the MCP server.
  4. Starts the HTTP server, listening on the specified port and host.
  5. Registers the hooks created by UnpluginMcpTool instances to build tools.

After these steps, the plugin can:

  1. Handle incoming requests from MCP client and responding to them.
  2. React to hooks triggered by the build tool during the build process.
  3. Provide build contextual information to the MCP client.

License

MIT License. Copyright (c) 2025 situ2001.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "situ2001-unplugin-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "unplugin-mcp"
      ]
    }
  }
}

Use unplugin-mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once unplugin-mcp is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add unplugin-mcp as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the unplugin-mcp MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "situ2001-unplugin-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "unplugin-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the unplugin-mcp MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the unplugin-mcp MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use unplugin-mcp to help me with this task?
unplugin-mcp
Sure. I read it.
Here is what I found using unplugin-mcp.

Frequently asked questions

What is the unplugin-mcp MCP server used for?

unplugin-mcp is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use unplugin-mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use unplugin-mcp with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use unplugin-mcp MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With unplugin-mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect unplugin-mcp MCP to TypingMind?

unplugin-mcp runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does unplugin-mcp MCP provide in TypingMind?

unplugin-mcp exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use unplugin-mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If unplugin-mcp requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇