WV

webfansplz/vite-plugin-vue-mcp

Browser automation

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

578 stars 33 forks 品質 62 トレンド 21MIT

モデルがVueアプリをよりよく理解できるように、MCPサーバーを可能にするViteプラグインです。

概要

![NPMバージョン][npm-version-href]![npmダウンロード音][npm-downloads-href]![バンドル][bundle-href]![ライセンス][license-href] VueアプリのMCPサーバーでコンポーネントツリー、状態、ルート、Piniaツリーと状態に関する情報を提供するViteプラグインです。 その後、MCPサーバーは[[T0]で利用可能になります。 Cursorを使用している場合は、プロジェクトのrootに.cursor/mcp.jsonファイルを作成してください。このプラグインが自動的に更新してくれます。MCPの詳細については、公式のCursorドキュメントをご覧ください。 get-component-tree: Vueのコンポーネントツリーを取得します。 get-component-state: コンポーネントの状態(入力:componentName)を取得します。 edit-component-state:コンポーネントの状態を編集します(input: componentName, path, value, valueType)。 highlight-component: コンポーネントをハイライトします(入力:componentName)。

概要(AI 翻訳)

VueアプリのMCPサーバーでコンポーネントツリー、状態、ルート、Piniaツリーと状態に関する情報を提供するViteプラグインです。

設置 📦

使用法 🔨

その後、MCPサーバーはhttp://localhost:[port]/__mcp/sseで利用可能になります。

Cursorを使用している場合は、プロジェクトのルートに.cursor/mcp.jsonファイルを作成してください。このプラグインが自動的に更新してくれます。MCPの詳細については、公式のCursorドキュメントをご覧ください。

オプション

特徴/ツール ✨

コンポーネントツリーを入手

get-component-tree: Vueのコンポーネントツリーを取得してください。

コンポーネント状態を取得

get-component-state: 成分の状態を取得する(入力:componentName)。

コンポーネント状態を編集

edit-component-state: コンポーネントの状態を編集します(入力:componentName、path、value、valueType)。

ハイライトコンポーネント

highlight-component: コンポーネントをハイライトします(入力:componentName)。

ルートを取れ

get-router-info: アプリケーションのVueルーター情報を取得してください。

ピニアツリーを手に入れろ

get-pinia-tree: 申請のピニアツリーを取得してください。

ピニア州を取れ

get-pinia-state: アプリケーションのPinia状態を取得します(入力:storeName)。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

vite-plugin-vue-mcp

[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![License][license-src]][license-href]

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

  /**
   * 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

  /**
   * 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.

Get Component State

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

Edit Component State

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

Highlight Component

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

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →