AutoSpectra 是一个全面的 MCP(模型上下文协议)服务器,提供任何 AI 代理的完整自动化和测试能力。从浏览器自动化和 API 测试到调试工具和模拟服务,AutoSpectra 提供了一整套无缝集成到任何 MCP 兼容系统中的工具,包括但不限于 Claude、ChatGPT、Gemini 和 Perplexity。
# 克隆仓库
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
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"
}
});
// 发送 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/ # 端到端测试
AutoSpectra 无缝集成到支持 MCP 协议的任何 AI 代理中:
更多信息请参阅 AI 集成指南。
AutoSpectra 与各种 AI 平台和开发环境兼容:
更多信息请参阅 平台集成指南。
# 构建 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 文件。