JSPM

  • Created
  • Published
  • Downloads 189
  • Score
    100M100P100Q98363F
  • License ISC

MCP Server for Mtop DevTools - enables AI to interact with Chrome browser requests and logs

Package Exports

  • @mtop-devtools/mcp-server
  • @mtop-devtools/mcp-server/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mtop-devtools/mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Mtop DevTools MCP Server

让 AI 能够与浏览器实时交互的 MCP 服务器。

功能

  • 📊 browser_get_requests: 获取历史请求记录
  • 📊 browser_get_events: 获取 RUM/aplus 埋点事件
  • 📝 browser_get_logs: 获取控制台日志
  • 🎭 browser_set_mock: 动态设置 Mock 数据

安装

方式一:使用 npx(推荐,保持最新)

# 直接运行配置向导,会自动生成 npx 配置
npx @mtop-devtools/mcp-server --configure

方式二:全局安装(启动更快)

# 全局安装
npm install -g @mtop-devtools/mcp-server

# 运行配置向导
mtop-mcp-configure

配置向导会自动完成所有设置,支持 VS Code CopilotClaude CodeCursor。完成后重启 MCP 客户端即可使用。

使用

打开任意淘宝/飞猪页面,在 AI 客户端中发送:

获取最近 5 个请求
帮我分析购物车相关的接口
把购物车总价改成 150 元测试一下

本地开发

cd mcp-server
npm install
npm run build
npm link

运行配置向导,选择使用自定义 Extension ID:

mtop-mcp-configure
# 选择 "使用自定义 Chrome 插件 ID?" -> Yes
# 输入你的开发版 Extension ID

💡 在 chrome://extensions/ 查看你的 Extension ID

发布新版本:

npm version patch
npm run build
npm publish --access public

卸载

# 全局安装的版本
mtop-mcp-uninstall

# 或使用 npx
npx @mtop-devtools/mcp-server --uninstall

故障排查

配置失败:检查目录权限和路径是否存在

# macOS
mkdir -p ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts

**"Native host has exited"**:删除配置后重新运行

rm ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.alibaba.mtop_devtools.mcp.*

Extension ID 不匹配:使用 mtop-mcp-configure 重新配置

查看日志

  • MCP Server: AI 客户端的输出面板
  • Chrome Extension: chrome://extensions/ → Mtop DevTools → background page

License

ISC