vite-plugin-vue-mcp

MCP.Pizza Chef: webfansplz

Added to a Vue project's build settings, it opens a small local link while your app is running in the browser, so an assistant can list the component tree, read the values a component currently holds, change them, highlight a component on the page, and inspect routes and Pinia stores. Cursor is wired up automatically. This is a tool for people building Vue apps rather than for everyday chat, and it has had no updates since April 2025.

Unmaintained ยท no commits since April 2025
Coding

Use This MCP server To

Show my assistant the component tree of my app Read the values a component is holding right now Change a component's state to test an edge case Highlight a component on screen to find it Ask which routes my app defines

README

vite-plugin-vue-mcp

npm version npm downloads bundle License

Vite plugin that enables a MCP server for your Vue app to provide information about the component tree, state, routes, and pinia tree and state.

Installation ๐Ÿ“ฆ

pnpm install vite-plugin-vue-mcp -D

Usage ๐Ÿ”จ

// vite.config.ts
import { VueMcp } from 'vite-plugin-vue-mcp'

export default defineConfig({
  plugins: [VueMcp()],
})

Then the MCP server will be available at http://localhost:[port]/__mcp/sse.

If you are using Cursor, create a .cursor/mcp.json file in your project root, this plugin will automatically update it for you. For more details about the MCP, check the official Cursor documentation.

Options

export interface VueMcpOptions {
  /**
   * The host to listen on, default is `localhost`
   */
  host?: string

  /**
   * Print the MCP server URL in the console
   *
   * @default true
   */
  printUrl?: boolean

  /**
   * The MCP server info. Ingored when `mcpServer` is provided
   */
  mcpServerInfo?: McpServerInfo

  /**
   * Custom MCP server, when this is provided, the built-in MCP tools will be ignored
   */
  mcpServer?: (viteServer: ViteDevServer) => Awaitable<McpServer>

  /**
   * Setup the MCP server, this is called when the MCP server is created
   * You may also return a new MCP server to replace the default one
   */
  mcpServerSetup?: (server: McpServer, viteServer: ViteDevServer) => Awaitable<void | McpServer>

  /**
   * The path to the MCP server, default is `/__mcp`
   */
  mcpPath?: string

  /**
   * Update the address of the MCP server in the cursor config file `.cursor/mcp.json`,
   * if `.cursor` folder exists.
   *
   * @default true
   */
  updateCursorMcpJson?: boolean | {
    enabled: boolean
    /**
     * The name of the MCP server, default is `vue-mcp`
     */
    serverName?: string
  }

  /**
   * append an import to the module id ending with `appendTo` instead of adding a script into body
   * useful for projects that do not use html file as an entry
   *
   * WARNING: only set this if you know exactly what it does.
   * @default ''
   */
  appendTo?: string | RegExp
}

Features/Tools โœจ

Get Component Tree

get-component-tree: Get the Vue component tree.

component-tree

Get Component State

get-component-state: Get the state of a component (input: componentName).

component-state

Edit Component State

edit-component-state: Edit the state of a component (input: componentName, path, value, valueType).

edit-component-state

Highlight Component

highlight-component: Highlight a component (input: componentName).

highlight-component

Get Routes

get-router-info: Get the Vue router info of the application.

route-tree

Get Pinia Tree

get-pinia-tree: Get the Pinia tree of the application.

pinia-tree

Get Pinia State

get-pinia-state: Get the Pinia state of the application (input: storeName).

pinia-state

Architecture โšก๏ธ

architecture

Notice ๐Ÿ’ก

Please ensure the application is running in your browser before using the features.

Credits ๐Ÿ’–

This project is inspired by vite-plugin-mcp. Thanks to @antfu for the great work.

License ๐Ÿ“–

MIT License ยฉ Arlo

vite-plugin-vue-mcp FAQ

Who is this for?
People building a Vue app. It is added to the project's build setup, not to a chat app.
Which assistants does it work with?
Cursor is configured for you automatically, and any client that accepts a local server address can connect.
Do I need a key or an account?
No. Everything runs on your own machine while the development server is up.
Does the app have to be open in a browser?
Yes. If the page is not running, the tools return nothing.
Can I use this to work out why a component shows the wrong value?
Yes โ€” the assistant reads that component's live values instead of guessing from the code.
Is it still maintained?
The last commit was April 2025, so it may lag behind newer Vue and Vite releases.