vite-plugin-vue-mcp

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 {
host?: string
printUrl?: boolean
mcpServerInfo?: McpServerInfo
mcpServer?: (viteServer: ViteDevServer) => Awaitable
mcpServerSetup?: (server: McpServer, viteServer: ViteDevServer) => Awaitable
mcpPath?: string
updateCursorMcpJson?: boolean | {
enabled: boolean
serverName?: string
}
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