返回市场
开发工具-mcp

开发工具-mcp

作者:stefanli24 星标更新:2025-06-03

项目介绍

devtools-mcp

一个提供对LLMs访问Chrome DevTools Protocol的MCP服务器。

  • 通过cdp_command工具执行任何CDP命令
  • 自动处理二进制数据 - 大型响应(如截图、PDF)将保存到文件中

配置

  1. 启动带有远程调试的Chrome:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 \
  --remote-debugging-address=127.0.0.1 \
  --user-data-dir=/tmp/chrome-debug \
  --no-first-run \
  --disable-default-apps
  1. 安装依赖项:
npm install
  1. 将其添加为本地MCP服务器。例如,使用Claude Code:
claude mcp add devtools-server -- npx tsx ~/projects/devtools-mcp/src/index.ts

使用方法

该服务器公开了一个单一的cdp_command工具,接受以下参数:

  • method: 任何CDP命令(例如,“Page.navigate”,“Runtime.evaluate”)
  • params: 命令参数的JSON字符串(可选)

二进制数据(如截图等)将自动保存到./cdp-output/目录中,并返回文件路径引用而不是原始数据。