{"id":26737574,"url":"https://github.com/situ2001/unplugin-mcp","last_synced_at":"2026-04-10T10:02:26.705Z","repository":{"id":283504632,"uuid":"946525581","full_name":"situ2001/unplugin-mcp","owner":"situ2001","description":"A unified plugin for developers integrating MCP servers into modern JavaScript build tools, including Webpack, Rollup, Vite, and more.","archived":false,"fork":false,"pushed_at":"2026-03-06T02:02:34.000Z","size":375,"stargazers_count":31,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-06T05:35:18.419Z","etag":null,"topics":["mcp","mcp-server","modelcontextprotocol","rollup","rollup-plugin","unplugin","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/situ2001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-11T09:25:43.000Z","updated_at":"2026-03-06T02:01:49.000Z","dependencies_parsed_at":"2025-03-21T10:43:03.027Z","dependency_job_id":"da93deb7-a995-404f-b5fd-3d505d11b5bc","html_url":"https://github.com/situ2001/unplugin-mcp","commit_stats":null,"previous_names":["situ2001/rollup-plugin-mcp","situ2001/unplugin-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/situ2001/unplugin-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/situ2001%2Funplugin-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/situ2001%2Funplugin-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/situ2001%2Funplugin-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/situ2001%2Funplugin-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/situ2001","download_url":"https://codeload.github.com/situ2001/unplugin-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/situ2001%2Funplugin-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31637748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mcp","mcp-server","modelcontextprotocol","rollup","rollup-plugin","unplugin","webpack-plugin"],"created_at":"2025-03-28T02:51:32.741Z","updated_at":"2026-04-10T10:02:26.688Z","avatar_url":"https://github.com/situ2001.png","language":"TypeScript","readme":"# unplugin-mcp\n\n[![GitHub Repo](https://img.shields.io/badge/GitHub-repo-080f12?style=flat\u0026logo=github\u0026logoColor=white)](https://github.com/situ2001/unplugin-mcp)\n[![npm version](https://img.shields.io/npm/v/unplugin-mcp?style=flat\u0026colorA=080f12\u0026colorB=1fa669)](https://www.npmjs.com/package/unplugin-mcp)\n[![npm download](https://img.shields.io/npm/dt/unplugin-mcp?style=flat\u0026colorA=080f12\u0026colorB=1fa669)](https://www.npmjs.com/package/unplugin-mcp)\n![npm license](https://img.shields.io/npm/l/unplugin-mcp?style=flat\u0026colorA=080f12\u0026colorB=1fa669)\n\n\u003e [!IMPORTANT]\n\u003e 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.\n\nA 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.\n\nHere is the vision of this plugin, to provide a unified MCP Server and MCP tools to MCP Client.\n\n```mermaid\nflowchart LR\n    subgraph \"Build tools\"\n        Rollup[\"Rollup\"]\n        Vite[\"Vite\"]\n        ESBuild[\"ESBuild\"]\n        Webpack[\"Webpack\"]\n        Rspack[\"Rspack\"]\n        Rolldown[\"Rolldown\"]\n    end\n\n    subgraph \"unplugin-mcp (This plugin)\"\n        unplugin[\"unplugin\"]\n        McpTool[\"UnpluginMcpTool\"]\n        McpServer[\"MCP Server\"]\n        HTTPServer[\"HTTP Server\"]\n    end\n\n    subgraph \"MCP Clients\"\n        Cursor[\"Cursor\"]\n        VSCode[\"VSCode\"]\n        More[\"More\"]\n    end\n\n    Rollup \u0026 Webpack \u0026 Vite \u0026 ESBuild \u0026 Rspack \u0026 Rolldown --\u003e unplugin\n    unplugin --\u003e McpTool\n    McpTool --\u003e McpServer\n    McpServer --\u003e HTTPServer\n    HTTPServer --\u003e Cursor \u0026 VSCode \u0026 More\n```\n\n## Features\n\n- 🚀 **Cross-Platform MCP Integration**: Creates and manages an MCP server seamlessly across multiple build tools.\n- 🧩 **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.\n- 🧰 **Rich built-in tools**: Collection of built-in tools for analyzing module dependencies, inspecting build configuration, debugging error messages, and so on.\n- 🛠️ **Extensible Tool Framework**: Create custom MCP tools with the simple `UnpluginMcpTool` interface to expose project-specific information or functionality.\n- 🔍 **Build Process Integration**: Seamlessly integrates at any point in the plugin chain and hooks of your build tools like Rollup.\n- 🔄 **Persistent Server**: Keeps running even after build completion in watch mode, enabling continuous AI interaction.\n- 🌐 **Standard Transport Layer**: Uses HTTP and Server-Sent Events (SSE) for broad compatibility with AI assistants implementing the MCP protocol.\n\n## Installation\n\n```bash\n# Install the plugin\npnpm add -D unplugin-mcp\n\n# or install bundler-specific one, it shares the same codebase but only exports the plugin for the specific bundler\npnpm add -D rollup-plugin-mcp\n```\n\n## Usage\n\n### Build Tool Integration\n\nHere 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`).\n\n```js\n// rollup.config.js\nimport { defineConfig } from 'rollup';\nimport { rollupPlugin as mcp } from 'unplugin-mcp';\n\n// import some built-in tools\nimport { ModuleTool, BuildConfigTool, BuildErrorTool } from 'unplugin-mcp/tools';\n\nexport default defineConfig({\n  plugins: [\n    // other plugins...\n    mcp({\n      provideUnpluginMcpTools: () =\u003e [\n        new ModuleTool(),\n        new BuildConfigTool(),\n        new BuildErrorTool()\n      ]\n    }),\n    // other plugins...\n  ]\n});\n```\n\n🚧 Usage on other bundlers is on the way.\n\n### Usage in Cursor\n\nJust add a MCP Server to Cursor Settings. For example, in `~/.config/cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"rollup\": {\n      \"url\": \"http://localhost:14514/mcp/sse\"\n    }\n  }\n}\n```\n\n### Options\n\nCheck `McpPluginOptions` in [types file](./lib/src/types.ts) for all available options.\n\n## Built-in Tools Compatibility\n\n\u003e Notes: Currently, implementation of built-in tools is relatively simple and may not cover all edge cases.\n\n| Tool              | Description                             | Rollup | Webpack |\n| ----------------- | --------------------------------------- | :----: | :-----: |\n| `ModuleTool`      | Analyze module dependencies and imports |   ✅    |    ❌    |\n| `BuildConfigTool` | Inspect build configuration             |   ✅    |    ✅    |\n| `BuildErrorTool`  | Debug build errors                      |   ✅    |    ✅    |\n| `BundleSizeTool`  | Inspect size of bundle and its modules  |   ✅    |    ❌    |\n\n- ✅ = Supported\n- ❌ = Not yet implemented\n\n## Custom Tools\n\nYou can extend the plugin with custom tools implementing the `UnpluginMcpTool` interface:\n\n```typescript\nimport { InputOptions } from \"rollup\";\nimport { UnpluginMcpTool, UnpluginMcpToolSetupOptions } from \"unplugin-mcp\";\nimport DeferredCtor, { Deferred } from 'promise-deferred';\nimport { UnpluginOptions } from \"unplugin\";\n\nexport class BuildConfigTool implements UnpluginMcpTool {\n  private buildConfig: Deferred\u003cInputOptions\u003e;\n\n  affectsBuildProcess: boolean = false;\n\n  constructor() {\n    this.buildConfig = new DeferredCtor\u003cInputOptions\u003e();\n  }\n\n  setupMcpServer(mcpServer: any, options?: any) {\n    mcpServer.tool(\n      `get-build-config`,\n      \"Get build configuration\",\n      {},\n      async () =\u003e {\n        const cfg = await this.buildConfig.promise;\n\n        return {\n          content: [\n            {\n              type: 'text',\n              text: `Build configuration: ${JSON.stringify(cfg)}`\n            }\n          ]\n        };\n      }\n    );\n\n    return mcpServer;\n  }\n\n  registerPlugins(options?: UnpluginMcpToolSetupOptions): UnpluginOptions {\n    let self = this;\n\n    return {\n      name: 'build-config-tool',\n\n      rollup: {\n        options(config) {\n          self.buildConfig.resolve(config);\n        }\n      }\n    }\n  }\n}\n```\n\nAnd then register it in the plugin options, for example, in the Rollup config:\n\n```js\n// rollup.config.js\n// ... \nplugins: [\n  mcp({\n    provideUnpluginMcpTools: () =\u003e [\n      new BuildConfigTool()\n    ]\n  })\n]\n// ...\n```\n\n## Examples\n\nCheck out the examples directory for working examples, including:\n\n- [simple-hello](./examples/simple-hello/): A basic example demonstrating MCP integration with Rollup\n\n## How it works\n\nIt initializes and setup these components:\n\n1. Creates and setup a singleton MCP server instance.\n2. Registers some `UnpluginMcpTool` instances to the MCP server.\n3. Creates an HTTP server and sets up HTTP routes for the MCP server.\n4. Starts the HTTP server, listening on the specified port and host.\n5. Registers the hooks created by `UnpluginMcpTool` instances to build tools.\n\nAfter these steps, the plugin can:\n\n1. Handle incoming requests from MCP client and responding to them.\n2. React to hooks triggered by the build tool during the build process.\n3. Provide build contextual information to the MCP client.\n\n## License\n\nMIT License. Copyright (c) 2025 situ2001.\n","funding_links":[],"categories":["🌐 Web Development"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitu2001%2Funplugin-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitu2001%2Funplugin-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitu2001%2Funplugin-mcp/lists"}