Dev Inspector MCP 标志

Dev Inspector MCP

组织
mcpc-tech

AI-powered visual debugging for your React, Vue, Svelte, SolidJS, Preact & Next.js app via MCP and ACP

发布者mcpc-tech
代码仓库dev-inspector-mcp
语言TypeScript
复刻数
3
星标数
47
可用工具
0
传输类型stdio
许可协议MIT
链接
  • 将工具接入 AI 工作流

    Dev Inspector MCP 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 47 个 Star 和 3 个 Fork。

dev-inspector-mcp

npm version npm downloads

The missing runtime context for AI coding agents.

AI can read your code, but can't see what's happening at runtime. DevInspector provides the missing context: source code location, DOM state, styles, network, console, terminal output, and screenshots.

Two modes: Use with your IDE's AI (Cursor, VSCode) via MCP, or run AI agents directly in the browser via ACP (Claude Code, Codex CLI, Gemini CLI, OpenCode, more).

Using Claude Code or another AI agent? Install the DevInspector skill so your agent knows how to set up and troubleshoot the inspector:

bash
npx skills add mcpc-tech/dev-inspector-mcp

Table of Contents

Demo Video

Watch the demo: https://www.youtube.com/shorts/TCt2oOtPS_k

Social Media

Twittter/X Post: https://x.com/yaoandyan/status/1995082020431753600

Demo: MCP-powered visual debugging in action

Key Features

Visual Context & Region Selection

Click any element to inspect it, or drag to select a region. AI gets the full context: source code location, computed styles, component hierarchy, IDs, classes, text content, and automatically captures screenshots for pixel-perfect visual understanding.

Page Overview & Accessibility Tree

get_page_info provides AI with a semantic understanding of the page: URL, viewport, and an accessibility tree showing landmarks, headings, forms, and links. AI can navigate the page structure without screenshots.

Universal DevTools Access

AI can access Network and Console logs from any browser (via client-side interception) or full Chrome DevTools (via chrome devtools mcp). It sees what you see, regardless of your environment.

Multi-Agent Workflow

Switch between agents (Claude Code, Codex, Gemini, Opencode...) and track their debugging progress visually with a floating status bar.

Quick Start

Installation

bash
# npm - basic installation
npm i -D @mcpc-tech/unplugin-dev-inspector-mcp

# pnpm - basic installation
pnpm add -D @mcpc-tech/unplugin-dev-inspector-mcp

# yarn - basic installation
yarn add -D @mcpc-tech/unplugin-dev-inspector-mcp

Note: If you don't need the ACP agents (Inspector Bar mode), add --no-optional to skip installing agent packages:

bash
npm i -D @mcpc-tech/unplugin-dev-inspector-mcp --no-optional
pnpm add -D @mcpc-tech/unplugin-dev-inspector-mcp --no-optional
yarn add -D @mcpc-tech/unplugin-dev-inspector-mcp --no-optional

Automated Setup (Recommended)

Run the setup command to automatically configure your vite.config.ts, webpack.config.js, or next.config.ts:

bash
npx @mcpc-tech/unplugin-dev-inspector-mcp setup

Options:

  • --dry-run - Preview changes without applying them
  • --config <path> - Specify config file path (auto-detect by default)
  • --bundler <type> - Specify bundler type: vite, webpack, nextjs
  • --no-backup - Skip creating backup files
  • --help - Show help message

Examples:

bash
# Preview changes before applying
npx @mcpc-tech/unplugin-dev-inspector-mcp setup --dry-run

# Setup specific config file
npx @mcpc-tech/unplugin-dev-inspector-mcp setup --config vite.config.ts

# Setup for specific bundler
npx @mcpc-tech/unplugin-dev-inspector-mcp setup --bundler vite

This will:

  • Detect your bundler configuration
  • Add the necessary import
  • Add the plugin to your configuration
  • Create a backup of your config file

Framework Setup

Pick your framework below. Each section is self-contained -- just copy the config.

ts
// vite.config.ts
import DevInspector from '@mcpc-tech/unplugin-dev-inspector-mcp';
import react from '@vitejs/plugin-react'; // or vue(), svelte(), solid(), preact()

export default {
  plugins: [
    DevInspector.vite({ enabled: true }),
    react(),
  ],
};

Plugin order matters: Place DevInspector.vite() before framework plugins. Otherwise source locations may show unknown:0:0.

Step 1 -- next.config.ts:

ts
import DevInspector, { turbopackDevInspector } from '@mcpc-tech/unplugin-dev-inspector-mcp';

const nextConfig = {
  webpack: (config) => {
    config.plugins.push(DevInspector.webpack({ enabled: true }));
    return config;
  },
  turbopack: {
    rules: turbopackDevInspector({ enabled: true }),
  },
};

export default nextConfig;

Step 2 -- app/layout.tsx (required):

tsx
import { DevInspector } from "@mcpc-tech/unplugin-dev-inspector-mcp/next";

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <DevInspector />
        {children}
      </body>
    </html>
  );
}

Run with next dev (webpack) or next dev --turbopack (turbopack).

ts
// vite.config.ts
import { reactRouter } from "@react-router/dev/vite";
import DevInspector from '@mcpc-tech/unplugin-dev-inspector-mcp';

export default defineConfig({
  plugins: [
    DevInspector.vite({ enabled: true, entry: "app/root.tsx" }),
    reactRouter(),
  ],
});
js
// webpack.config.js
const DevInspector = require('@mcpc-tech/unplugin-dev-inspector-mcp');

module.exports = {
  plugins: [
    DevInspector.webpack({ enabled: true }),
  ],
};

Non-HTML Projects (Miniapps, Library Bundles)

ts
DevInspector.vite({
  enabled: true,
  autoInject: false,
  entry: 'src/main.ts',
})

TypeScript Types

If you import virtual:dev-inspector-mcp, add to your tsconfig:

jsonc
{
  "compilerOptions": {
    "types": ["vite/client", "@mcpc-tech/unplugin-dev-inspector-mcp/client"]
  }
}

Custom Virtual Module Name

ts
DevInspector.vite({
  enabled: true,
  autoInject: false,
  virtualModuleName: 'virtual:my-custom-inspector',
})

Disable Chrome DevTools

Set disableChrome: true in plugin options or DEV_INSPECTOR_DISABLE_CHROME=1 env var.

Zero Production Impact: In production builds, virtual:dev-inspector-mcp becomes a no-op module.

Supported Frameworks

React, Vue, Svelte, SolidJS, Preact, Next.js (Webpack + Turbopack), React Router v7+. Angular support in progress.

Agent Skills

DevInspector ships a built-in Agent Skill for Claude Code (and compatible AI agents) that teaches the agent how to integrate and troubleshoot the inspector.

Install it with one command:

bash
npx skills add mcpc-tech/dev-inspector-mcp

The skill covers setup for all supported bundlers, common gotchas, and troubleshooting -- so the agent can guide you through the entire integration without back-and-forth.

What are Agent Skills? Skills are Markdown-based instruction sets that AI agents load at session start to gain domain-specific knowledge. See the Claude Code docs for more.

Configuration

Auto-Update MCP Config

The plugin automatically updates MCP configuration files for detected editors when the dev server starts. This saves you from manually configuring MCP endpoints.

Supported editors: Cursor, VSCode, Windsurf, Claude Code, Antigravity

typescript
// vite.config.ts
DevInspector.vite({
  // Auto-detect and update (default: true)
  updateConfig: true,

  // Or specify editors manually
  updateConfig: ['cursor', 'vscode'],

  // Or disable
  updateConfig: false,

  // Server name in MCP config (default: 'dev-inspector')
  updateConfigServerName: 'my-app-inspector',
})

Custom editors: For non-standard editors, use customEditors:

typescript
DevInspector.vite({
  customEditors: [
    {
      id: 'my-editor',
      name: 'My Editor',
      configPath: '~/.my-editor',        // absolute, ~/relative, or project-relative
      configFileName: 'mcp.json',
      serverUrlKey: 'url',               // default: 'url'
      configFormat: 'mcpServers',        // 'mcpServers' or 'servers' (vscode-style)
    },
  ],
})

Agent Installation

DevInspector supports multiple AI agents via ACP.

For npm-based agents (Claude Code, Codex CLI, Cursor Agent, Droid), you can pre-install them as dev dependencies for faster loading.

For system-level agents, install globally:

Gemini CLI

bash
npm install -g @google/gemini-cli

Documentation →

Kimi CLI

bash
uv tool install --python 3.13 kimi-cli

Documentation →

Goose

bash
pipx install goose-ai

Documentation →

Opencode

bash
curl -fsSL https://opencode.ai/install | bash

Documentation →

CodeBuddy Code

bash
npm install -g @tencent-ai/codebuddy-code

Documentation →

Note: If you don't pre-install npm-based agents, they will be launched via npx on first use (slower startup).

Pre-installing npm-based Agents (Recommended)

The recommended way is to install agents during initial setup (see Installation above).

Alternatively, install them later as dev dependencies:

bash
# npm
npm i -D @zed-industries/claude-code-acp

# pnpm
pnpm add -D @zed-industries/claude-code-acp

# Or add directly to package.json
json
{
  "devDependencies": {
    "@zed-industries/claude-code-acp": "^0.12.4",
    "@zed-industries/codex-acp": "^0.7.1",
    "@blowmage/cursor-agent-acp": "^0.1.0",
    "@yaonyan/droid-acp": "^0.0.8"
  }
}

About optionalDependencies: Agent packages are installed by default. If you don't need them, use --no-optional when installing.

Why install as devDependencies?

  • Ensures faster startup (uses local package via require.resolve instead of npx)
  • Won't affect production bundle (tree-shaken out unless imported)
  • Standard practice for development tools

Custom Agents

This plugin uses the Agent Client Protocol (ACP) to connect with AI agents.

⏱️ Note: Initial connection may be slow as agents are launched via npx (downloads packages on first run).

Default agents: View configuration →

You can customize available AI agents, filter visible agents, and set a default agent:

typescript
// vite.config.ts
export default {
  plugins: [
    DevInspector.vite({
      enabled: true,

      // Option 1: Only show specific agents (filters merged agents)
      visibleAgents: ['Claude Code', 'Gemini CLI', 'Goose'],

      // Option 2: Add custom agents (merges with defaults)
      agents: [
        {
          name: "Claude Code", // Matches default - auto-fills icon and env
          command: "npx",
          args: ["-y", "@zed-industries/claude-code-acp"],
        },
        {
          name: "My Custom Agent",
          command: "my-agent-cli",
          args: ["--mode", "acp"],
          env: [{ key: "MY_API_KEY", required: true }],
          meta: { icon: "https://example.com/icon.svg" }
        }
      ],

      // Option 3: Combine both - add custom agents and filter visibility
      agents: [
        {
          name: "My Custom Agent",
          command: "my-agent-cli",
          args: ["--mode", "acp"],
          env: [{ key: "MY_API_KEY", required: true }],
          meta: { icon: "https://example.com/icon.svg" }
        }
      ],
      visibleAgents: ['Claude Code', 'My Custom Agent'], // Only show these

      // Set default agent to show on startup
      defaultAgent: "Claude Code"
    }),
  ],
};

Key Features:

  • agents: Merges your custom agents with defaults. Agents with the same name as default agents automatically inherit missing properties (icons, env)
  • visibleAgents: Filters which agents appear in the UI (applies after merging). Great for limiting options to only what your team uses
  • defaultAgent: Sets which agent is selected on startup
  • If no custom agents provided, defaults are: Claude Code, Codex CLI, Gemini CLI, Kimi CLI, Goose, Opencode, Cursor Agent, Droid, CodeBuddy Code

MCP Servers Configuration

You can configure external MCP servers for agents to access additional tools.

typescript
DevInspector.vite({
  mcpServers: [
    // HTTP/SSE Server
    {
      name: 'remote-server',
      type: 'sse', // or 'http'
      url: 'https://api.example.com/sse',
      headers: [{ name: 'Authorization', value: process.env.MCP_TOKEN ?? '' }]
    },
    // Local Stdio Server
    {
      name: 'local-server',
      command: 'npx',
      args: ['-y', '@modelcontextprotocol/server-memory'],
      env: { MY_VAR: 'value' }
    }
  ]
})

What It Does

Click element → Describe issue → AI analyzes → Get fix

  1. Click any UI element to capture context (source, styles, DOM)
  2. Describe what's wrong or ask a question about the element
  3. AI diagnoses using Chrome DevTools integration
  4. Get intelligent solutions through natural conversation

Examples:

  • "Why is this button not clickable?" → AI checks pointer-events, z-index, overlays
  • "This API call is failing" → AI analyzes network requests, timing, responses
  • "Where is this component?" → Jump to source file and line number

Two Workflow Modes

DevInspector offers two ways to interact with your AI, depending on your preference:

1. Editor Mode

Best for: Code-heavy tasks, refactoring, and maintaining flow.

  • How it works: You use your IDE's AI assistant (Cursor, Windsurf, Copilot).
  • The Flow: Click an element in the browser -> The context (source, props, styles) is sent to your Editor via MCP -> You ask your Editor to fix it.
  • Why: Keeps you in your coding environment.

2. Inspector Bar Mode (Recommended)

Best for: Quick fixes, visual tweaks, or if you don't use an AI editor.

  • How it works: You use the floating "Inspector Bar" directly in the browser.
  • The Flow: Click "Ask AI" in the browser -> Select an agent (e.g., Claude Code, Custom Script) -> The agent runs in your terminal but interacts with the browser overlay.
  • Why: No context switching. Great for "what is this?" questions or network debugging.

MCP Tools

capture_element_context

Capture single element context. Two modes:

  • Interactive (default): User clicks element to select
  • Automated: Use selector param for programmatic capture

Returns: source location, DOM hierarchy, computed styles, dimensions, user notes, screenshot.

capture_area_context

Capture multiple elements in an area. Two modes:

  • Interactive (default): User draws rectangle to select area
  • Automated: Use containerSelector or bounds param

Returns: array of element contexts (max 50).

get_page_info

Get page overview with accessibility tree. Returns URL, title, viewport, document size, and semantic structure (landmarks, headings, forms, links). Start here to understand the page.

list_inspections

List all captured inspections with ID, element details, source location, notes, and status (pending/in-progress/completed/failed).

update_inspection_status

Update inspection status. Parameters: inspectionId (optional, auto-detects), status ('in-progress'|'completed'|'failed'|'deleted'), message (required for completed/failed).

execute_page_script

Execute JavaScript in browser context. Access: window, document, DOM APIs, React/Vue instances, localStorage. Must return a value.

get_network_requests

Get network requests from browser. Returns list with reqid, method, URL, status. Use reqid param to get full request/response details (headers, body, timing).

get_console_messages

Get console messages from browser. Returns list with msgid, level (log/warn/error), message. Use msgid param to get full message details.

get_stdio_messages

Get dev server stdout/stderr. Returns list with stdioid, stream type, content. Use stdioid param to get full message.

chrome_devtools

Agentic tool for Chrome DevTools access. Provides network inspection, console logs, performance metrics, element interaction, and more.

Custom Inspector Tools

You can register your own custom tools to be used by the AI agent. These tools run directly in the browser context, giving the AI access to your application's state, logic, or any browser APIs.

registerInspectorTool

Use this function to register a tool. It handles the MCP schema definition and implementation in one place.

typescript
// main.ts or any entry file
import { registerInspectorTool } from 'virtual:dev-inspector-mcp';

registerInspectorTool({
  name: "get_user_state",
  description: "Get current user session and preferences",
  inputSchema: {
    type: "object",
    properties: {
      includeToken: {
        type: "boolean",
        description: "Whether to include the auth token"
      }
    }
  },
  implementation: (args) => {
    // This runs in the browser!
    const user = window.useUserStore?.getState();

    if (args.includeToken) {
      return { user, token: localStorage.getItem('token') };
    }
    return { user };
  }
});

These custom tools are automatically discovered and made available to the connected AI agent along with the built-in inspector tools.

MCP Prompts

capture_element_context

Capture single element context. Interactive (user clicks) or automated (selector param).

capture_area_context

Capture multiple elements in area. Interactive (user draws rectangle) or automated (containerSelector/bounds param).

list_inspections

View all element inspections in the queue with their status.

launch_chrome_devtools

Launch Chrome DevTools and navigate to a specified URL for debugging and inspection.

Parameter: url (required) - The URL to navigate to (e.g., http://localhost:3000)

get_network_requests

List network requests or get details of a specific one. Always refreshes the list first.

get_console_messages

List console messages or get details of a specific one. Always refreshes the list first.

get_stdio_messages

List stdio (stdout/stderr) messages from the server process. Always refreshes the list first.

Architecture

For a deep dive into how the MCP context, CMCP library, and Puppet binding mechanism work together, see the Architecture Documentation.

Key concepts:

  • Hub-and-spoke model: Vite dev server acts as central hub managing multiple client connections
  • CMCP bidirectional execution: Server defines tool schemas, browser client provides implementations
  • Puppet binding: Enables Chrome DevTools ↔ Inspector message passthrough
  • Dynamic rebinding: Automatic connection recovery after browser refresh

License

MIT

将 Dev Inspector MCP MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Dev Inspector MCP 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 Dev Inspector MCP 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Dev Inspector MCP MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "dev-inspector-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Dev Inspector MCP MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Dev Inspector MCP MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Dev Inspector MCP 帮我完成这项任务吗?
Dev Inspector MCP
当然。我已阅读。
以下是我使用 Dev Inspector MCP 得到的结果。

常见问题

Dev Inspector MCP MCP 服务器有什么用途?

Dev Inspector MCP 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Dev Inspector MCP MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 Dev Inspector MCP,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 Dev Inspector MCP MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 Dev Inspector MCP 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Dev Inspector MCP MCP 连接到 TypingMind?

Dev Inspector MCP 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Dev Inspector MCP MCP 在 TypingMind 中提供哪些工具?

Dev Inspector MCP 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Dev Inspector MCP MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 Dev Inspector MCP 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇