返回市场
自动频谱-MCP服务器

自动频谱-MCP服务器

作者:samuelvinay912 星标更新:2025-04-13

项目介绍

AutoSpectra MCP Server

<div align="center"> <img src="assets/logo.png" alt="AutoSpectra Logo" width="200"> <p><strong>一站式自动化平台:浏览器、API测试等</strong></p>

smithery badge

</div>

AutoSpectra 是一个全面的 MCP(模型上下文协议)服务器,提供任何 AI 代理的完整自动化和测试能力。从浏览器自动化和 API 测试到调试工具和模拟服务,AutoSpectra 提供了一整套无缝集成到任何 MCP 兼容系统中的工具,包括但不限于 Claude、ChatGPT、Gemini 和 Perplexity。

功能

  • 🌐 浏览器自动化:导航、点击、输入、提取数据和截图
  • 🔌 API 测试工具:发送 HTTP/GraphQL 请求、验证模式、创建模拟 API
  • 🧪 测试框架:端到端测试、可访问性测试和视觉验证
  • 🐞 调试功能:交互式调试会话,逐步执行
  • 🤖 AI 代理兼容性:与支持 MCP 协议的任何 AI 代理兼容
  • 👁️ 可见浏览器模式:使用可见浏览器进行调试或运行无头浏览器以提高效率
  • 🔄 自愈选择器:适应变化的健壮元素选择
  • 💻 Claude 计算机使用:与 Anthropic 的 Claude 计算机功能集成

安装

# 克隆仓库
git clone https://github.com/your-username/autospectra-mcp-server.git
cd autospectra-mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

环境设置

在根目录下创建一个 .env 文件,并包含以下变量:

# 服务器配置
PORT=3000
DEBUG=true
HTTP_SERVER=true

# API 密钥
ANTHROPIC_API_KEY=your-anthropic-api-key

# Playwright 配置
HEADLESS=false
SLOW_MO=50

# 输出目录
OUTPUT_DIR=./output

使用

启动服务器

# 启动服务器
npm start

# 或者启动开发模式
npm run dev

使用 MCP 工具

AutoSpectra 提供了一系列广泛的自动化工具,可以通过 MCP 协议使用:

浏览器自动化

// 使用可见浏览器导航到 URL
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "navigate",
  arguments: {
    url: "https://example.com",
    visible: true
  }
});

// 根据选择器点击元素
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "click",
  arguments: {
    selector: "#login-button"
  }
});

API 测试

// 发送 HTTP 请求
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "api_request",
  arguments: {
    method: "GET",
    url: "https://api.example.com/users/1",
    headers: {
      "Accept": "application/json"
    }
  }
});

// 验证 API 响应是否符合模式
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "validate_schema",
  arguments: {
    response: responseData,
    schema: {
      type: "object",
      required: ["id", "name", "email"],
      properties: {
        id: { type: "number" },
        name: { type: "string" },
        email: { type: "string", format: "email" }
      }
    }
  }
});

交互式调试

// 创建调试测试会话
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "debug_test",
  arguments: {
    testName: "login-flow",
    testScript: `
      step('step1', 'navigate', { url: 'https://example.com/login' });
      step('step2', 'type', { selector: '#username', text: 'testuser' });
      step('step3', 'click', { selector: '#login-button' });
    `,
    breakAt: ['step3'],
    runImmediately: true
  }
});

有关所有可用工具及其参数的完整文档,请参阅:

文档

AutoSpectra 提供了其工具功能的全面文档:

项目结构

autospectra-mcp-server/
├── docs/                # 文档
│   ├── guides/          # 用户和开发者指南
│   ├── api/             # API 文档
│   └── examples/        # 示例用法
├── scripts/             # 实用脚本和辅助脚本
├── src/                 # 源代码
│   ├── automation/      # 浏览器自动化
│   ├── computerUse/     # Claude 计算机使用集成
│   ├── frameworks/      # 测试框架集成
│   ├── nlp/             # NLP 功能
│   ├── server/          # 服务器特定代码
│   └── utils/           # 实用工具
├── tests/               # 测试文件
│   ├── integration/     # 集成测试
│   ├── unit/            # 单元测试
│   └── e2e/             # 端到端测试

与 AI 代理的集成

AutoSpectra 无缝集成到支持 MCP 协议的任何 AI 代理中:

  1. 通用兼容性:适用于 Claude、ChatGPT、Gemini、Perplexity 等
  2. 高级功能:访问如 Claude 的计算机使用等专业功能
  3. 灵活的工作流程:结合本地和基于云的自动化

更多信息请参阅 AI 集成指南

平台集成

AutoSpectra 与各种 AI 平台和开发环境兼容:

  1. Claude 桌面/云:通过计算机使用功能增强自动化
  2. VS Code 扩展:与开发工作流无缝集成
  3. ChatGPT & OpenAI:完全支持基于 GPT 的助手
  4. Gemini & 其他模型:与所有主要 AI 平台兼容

更多信息请参阅 平台集成指南

Docker 支持

# 构建 Docker 镜像
npm run docker:build

# 使用 Docker 运行
npm run docker:run

测试

# 运行所有测试
npm run test:all

# 运行特定测试
npm run test:accessibility
npm run test:computer-use
npm run test:e2e

贡献

欢迎贡献!请参阅 CONTRIBUTING.md 获取更多信息。

许可证

此项目根据 MIT 许可证发布 - 详情请参阅 LICENSE 文件。