The Vite Plugin for Vue MCP Server is a powerful tool designed to enhance the development experience for Vue.js applications. It integrates a Model Context Protocol (MCP) server, providing detailed insights into your Vue app's component tree, state, routes, and Pinia store. This plugin is particularly useful for developers looking to streamline debugging and improve their understanding of application structure.
To install the plugin, use the following command:
pnpm install vite-plugin-vue-mcp -D
Add the plugin to your vite.config.ts
file:
import { VueMcp } from 'vite-plugin-vue-mcp'
export default defineConfig({
plugins: [VueMcp()],
})
Once configured, the MCP server will be available at http://localhost:[port]/__mcp/sse
.
The plugin supports several configuration options:
export interface VueMcpOptions {
host?: string
printUrl?: boolean
mcpServerInfo?: McpServerInfo
mcpServer?: (viteServer: ViteDevServer) => Awaitable<McpServer>
mcpServerSetup?: (server: McpServer, viteServer: ViteDevServer) => Awaitable<void | McpServer>
mcpPath?: string
updateCursorMcpJson?: boolean | {
enabled: boolean
serverName?: string
}
appendTo?: string | RegExp
}
Retrieve the Vue component tree.
Fetch the state of a specific component.
Modify the state of a component.
Highlight a component in the UI.
Retrieve Vue router information.
Fetch the Pinia store tree.
Retrieve the state of a specific Pinia store.
The plugin's architecture is designed to seamlessly integrate with Vite and Vue, providing a robust MCP server for enhanced development insights.
Ensure the application is running in your browser before using the features.
This project is inspired by vite-plugin-mcp. Special thanks to @antfu for their contributions.