AI代理自动化测试平台

AutoSpectra是一个全面的MCP服务器,为AI代理提供浏览器自动化、API测试和调试工具等全套自动化测试功能,兼容Claude、ChatGPT等主流AI平台。

  • by Skopaq-AI
  • TypeScript
  • 本地部署
  • 3 星标
  • 更新于
在 GitHub 查看 samuelvinay91/autospectra-mcp-server

使用说明

AutoSpectra MCP服务器

All-In-One Automation Platform for AI Agents: Browser, API Testing, and More

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

特性

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

安装

# Clone the repository
git clone https://github.com/your-username/autospectra-mcp-server.git
cd autospectra-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

环境设置

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

# Server configuration
PORT=3000
DEBUG=true
HTTP_SERVER=true

# API Keys
ANTHROPIC_API_KEY=your-anthropic-api-key

# Playwright configuration
HEADLESS=false
SLOW_MO=50

# Output directory
OUTPUT_DIR=./output

用法

启动服务器

# Start the server
npm start

# Or start in development mode
npm run dev

使用MCP工具

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

浏览器自动化

// Navigate to a URL with visible browser
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "navigate",
  arguments: {
    url: "https://example.com",
    visible: true
  }
});

// Click on an element with selector
await use_mcp_tool({
  server_name: "autospectra",
  tool_name: "click",
  arguments: {
    selector: "#login-button"
  }
});

API测试

// Make an HTTP request
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"
    }
  }
});

// Validate an API response against a schema
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" }
      }
    }
  }
});

交互式调试

// Create a debug test session
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/                # Documentation
│   ├── guides/          # User and developer guides
│   ├── api/             # API documentation
│   └── examples/        # Example usage
├── scripts/             # Utility and helper scripts
├── src/                 # Source code
│   ├── automation/      # Browser automation
│   ├── computerUse/     # Claude computer use integration
│   ├── frameworks/      # Test framework integration
│   ├── nlp/             # NLP functionality
│   ├── server/          # Server-specific code
│   └── utils/           # Utilities
├── tests/               # Test files
│   ├── integration/     # Integration tests
│   ├── unit/            # Unit tests
│   └── e2e/             # End-to-end tests

与AI代理集成

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

  1. 通用兼容性:与Claude、ChatGPT、Gemini、困惑等合作
  2. 高性能:访问专门的功能,如克劳德的电脑使用
  3. 灵活的工作流程:结合本地和基于云的自动化

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

平台集成

AutoSpectra可与各种AI平台和开发环境配合使用:

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

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

Docker支持

# Build the Docker image
npm run docker:build

# Run with Docker
npm run docker:run

测试

# Run all tests
npm run test:all

# Run specific tests
npm run test:accessibility
npm run test:computer-use
npm run test:e2e

贡献

欢迎投稿!请看 贡献.md 了解更多信息。

许可证

此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。