webfansplz_vite_plugin_vue_mcp

webfansplz_vite_plugin_vue_mcp

by webfansplz
A Vite plugin that enables an MCP server to help models understand Vue app component trees, state, and routing.

Vite Plugin for Vue MCP Server

Overview

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.

Installation

To install the plugin, use the following command:

pnpm install vite-plugin-vue-mcp -D

Configuration

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.

Options

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
}

Features/Tools

Get Component Tree

Retrieve the Vue component tree.

Component Tree

Get Component State

Fetch the state of a specific component.

Component State

Edit Component State

Modify the state of a component.

Edit Component State

Highlight Component

Highlight a component in the UI.

Highlight Component

Get Routes

Retrieve Vue router information.

Route Tree

Get Pinia Tree

Fetch the Pinia store tree.

Pinia Tree

Get Pinia State

Retrieve the state of a specific Pinia store.

Pinia State

Architecture

The plugin's architecture is designed to seamlessly integrate with Vite and Vue, providing a robust MCP server for enhanced development insights.

Architecture

Notice

Ensure the application is running in your browser before using the features.

Credits

This project is inspired by vite-plugin-mcp. Special thanks to @antfu for their contributions.

License

MIT License © Arlo

Features & Capabilities

Categories
mcp_server model_context_protocol vite vue javascript typescript api_integration component_tree state_management pinia routing

Implementation Details

Stats

0 Views
299 GitHub Stars

Repository Info

webfansplz Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300