DevTools MCP Server

DevTools MCP Server

A specialized MCP server focused on process management, development server control, and browser console log collection.

Category
访问服务器

README

DevTools MCP Server

A specialized Model Context Protocol (MCP) server focused on process management, development server control, and browser console log collection. Solves common development challenges including npm run dev blocking and browser debugging visibility.

Features

Process Management

  • kill_process - Kill process by name or PID with signal control
  • detailed_process_list - Get detailed process info with CPU/memory usage and sorting
  • find_process_url - Find URLs/ports for a process by name (development servers)

Development Server Management

  • start_dev_server - Start development server in background (solves npm run dev blocking)
  • stop_dev_server - Stop running development server
  • check_dev_server - Check server status and port availability
  • list_running_servers - List all running servers
  • get_server_logs - Get server logs for debugging
  • restart_dev_server - Restart a development server

Browser Log Collection

  • get_browser_logs - Retrieve browser console logs with filtering
  • get_browser_log_stats - Get statistics about collected logs
  • clear_browser_logs - Clear stored browser logs

Installation

npm install

Development

npm run dev

Build

npm run build

MCP Server Configuration

Claude Code (claude.ai/code) Configuration

Add the following configuration to your ~/.claude/mcp_servers.json:

{
  "devtools": {
    "command": "node",
    "args": ["/path/to/devtools-mcp/dist/index.js"],
    "cwd": "/path/to/devtools-mcp"
  }
}

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "devtools": {
      "command": "node",
      "args": ["/path/to/devtools-mcp/dist/index.js"],
      "cwd": "/path/to/devtools-mcp"
    }
  }
}

General MCP Client Configuration

For other MCP-compatible clients, configure the server with:

  • Command: node
  • Args: ["/path/to/devtools-mcp/dist/index.js"]
  • Working Directory: /path/to/devtools-mcp
  • Transport: stdio

Make sure to build the project first:

npm run build

Usage

The server runs on stdio and can be integrated with MCP-compatible clients.

Development Server Management Examples

// Start a development server in background
{
  "tool": "start_dev_server",
  "arguments": {
    "command": "npm run dev",
    "name": "my-app",
    "port": 3000,
    "cwd": "/path/to/project"
  }
}

// Check server status
{
  "tool": "check_dev_server",
  "arguments": {
    "name": "my-app",
    "port": 3000
  }
}

// Get server logs for debugging
{
  "tool": "get_server_logs",
  "arguments": {
    "name": "my-app",
    "lines": 50
  }
}

// Stop server when done
{
  "tool": "stop_dev_server",
  "arguments": {
    "name": "my-app"
  }
}

This solves the common issue where npm run dev blocks Claude Code execution. The server starts in the background and returns immediately, allowing Claude Code to continue with other tasks while monitoring the development server status.

Process Management Examples

// Kill process by name
{
  "tool": "kill_process",
  "arguments": {
    "name": "node",
    "signal": "TERM",
    "force": false
  }
}

// Get detailed process list sorted by CPU usage
{
  "tool": "detailed_process_list",
  "arguments": {
    "filter": "node",
    "sortBy": "cpu",
    "limit": 10
  }
}

// Find development server URL by process name
{
  "tool": "find_process_url",
  "arguments": {
    "processName": "node"
  }
}
// Returns: "Development server likely running at: http://localhost:3000"

Browser Log Collection

The browser log collection feature requires installing a Chrome extension to capture console logs from localhost development servers.

Chrome Extension Installation

The browser log collection requires a Chrome extension to capture console logs from localhost development servers.

Prerequisites:

  • Google Chrome or Chromium-based browser
  • DevTools MCP Server running (the extension sends logs to http://localhost:3456)

Installation Steps:

  1. Open Chrome Extensions Management

    • Navigate to chrome://extensions/
    • Or click Chrome menu → More Tools → Extensions
  2. Enable Developer Mode

    • Toggle "Developer mode" switch in the top right corner
  3. Load the Extension

    • Click "Load unpacked" button
    • Navigate to and select the extension directory from this project
    • The extension should appear in your extensions list
  4. Verify Installation

    • You should see "DevTools Browser Log Collector" in your extensions
    • The extension icon may appear in your browser toolbar
    • Start your MCP server (npm run dev) to begin collecting logs

Automatic Log Collection:

  • The extension automatically detects localhost URLs (ports 3000-9999)
  • Captures all console.log, console.warn, console.error messages
  • Sends logs to the MCP server running on port 3456
  • No additional configuration required

Troubleshooting:

  • If logs aren't appearing, check that your MCP server is running
  • Verify your development server is running on a supported port (3000-9999)
  • Check Chrome extension permissions in chrome://extensions/
  • Refresh localhost tabs after installing the extension

Using Browser Log Tools

// Get recent browser logs
{
  "tool": "get_browser_logs",
  "arguments": {
    "filter": {
      "port": "3000",
      "level": ["error", "warn"],
      "limit": 50
    }
  }
}

// Get browser log statistics
{
  "tool": "get_browser_log_stats",
  "arguments": {}
}
// Returns: { totalLogs: 234, portStats: { "3000": 150, "8080": 84 }, activePorts: ["3000", "8080"] }

// Clear logs for specific port
{
  "tool": "clear_browser_logs",
  "arguments": {
    "port": "3000"
  }
}

The MCP server automatically starts an HTTP server on port 3456 to receive logs from the Chrome extension. Logs are stored in memory and can be filtered by:

  • Port number (e.g., "3000", "8080")
  • Log level (log, warn, error, info, debug)
  • Time range
  • Project ID (auto-detected from page)

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选