Token导航 LogoToken导航TokenDH.com
MCP Testing Servers logo
开发工具stdio官方级别未说明来源级核验

MCP Testing Servers

MCP Server

playwright

MCP测试服务器协议提供了一套工具,使AI助手能够在MCP原生IDE中自主创建、执行和维护测试。

工具数

8

提示词数

0

GitHub Stars

2

资源数

0
测试自动化开发工具JavaScriptCursor浏览器自动化Cursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ElaMCB

提供方

ElaMCB

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx playwright install chromium

详细介绍

MCP测试服务器

用于软件测试工具和质量保证的模型上下文协议(MCP)服务器集合

![MCP Protocol](https://modelcontextprotocol.io) ![License: MIT](https://opensource.org/licenses/MIT) ](https://nodejs.org/) ![CI](https://github.com/ElaMCB/mcp-testing-servers/actions) ![MCP Spec](https://modelcontextprotocol.io)

在MCP原生IDE中启用代理测试 比如Cursor和GitHub代码空间。将您的AI助手转化为智能测试代理,可以自主创建、执行和维护测试。

什么是MCP测试服务器?

模型上下文协议(MCP)服务器将AI代理与测试工具连接起来。您的AI助手可以:

  • 执行剧作家测试 实时的
  • 生成测试用例 基于应用程序状态
  • 调试失败 通过检查DOM和日志
  • 文件错误 在Jira/ADO中直接从测试结果
  • 自愈测试 当UI更改中断选择器时

阅读我们的 研究论文 在软件测试中使用MCP。

快速开始

先决条件

  • Node.js 18+(建议使用LTS)
  • MCP原生IDE(游标、GitHub代码空间或兼容)
  • 已安装测试框架(Playwright、Selenium等)
快速开始:立即试穿 -无需本地设置!

安装

# Clone the repository
git clone https://github.com/ElaMCB/mcp-testing-servers.git
cd mcp-testing-servers

# Install dependencies
npm install

# Install Playwright browsers
npx playwright install chromium

# Build the project
npm run build

在IDE中配置

对于光标:

  1. 打开设置→ MCP服务器
  2. 添加新的服务器配置
  3. Playwright服务器示例:
{
  "mcpServers": {
    "playwright": {
      "command": "node",
      "args": ["./dist/servers/playwright/server.js"],
      "env": {
        "PLAYWRIGHT_BROWSERS_PATH": "0"
      }
    }
  }
}

对于GitHub代码空间: 添加 .vscode/settings.json:

{
  "mcp.servers": {
    "playwright": {
      "command": "node",
      "args": ["./dist/servers/playwright/server.js"],
      "env": {
        "PLAYWRIGHT_BROWSERS_PATH": "0"
      }
    }
  }
}
需要帮助? 查看我们的 快速入门指南 有关详细的设置说明。

可用的MCP服务器

剧作家服务器

状态: 已实施并准备就绪

目的: 浏览器自动化和端到端测试

工具:

  • launch_browser(url, headless?, browser?) -启动浏览器并导航到URL
  • get_page_content(session_id) -获取当前页面DOM和状态
  • perform_action(session_id, action, selector, value?, key?) -单击、填充、选择元素
  • execute_test_script(session_id, code) -在实时上下文中运行Playwright代码
  • capture_screenshot(session_id, fullPage?) -截图调试
  • run_test_file(file_path) -执行Playwright测试文件
  • close_session(session_id) -关闭浏览器会话并清理
  • list_sessions() -列出所有活动的浏览器会话

浏览器支持: Chromium、Firefox、WebKit

示例用法:

// Your AI agent can now:
// 1. Launch browser: launch_browser("https://app.example.com")
// 2. Inspect page: get_page_content(session_id)
// 3. Perform actions: perform_action(session_id, "click", "#login-button")
// 4. Generate tests based on actual UI structure

Selenium服务器

状态: 计划的

目的: 跨浏览器Selenium自动化

工具:

  • create_driver(browser) -创建WebDriver实例
  • navigate_to(url) -导航到URL
  • find_elements(selector) -定位页面元素
  • execute_script(js_code) -在浏览器上下文中运行JavaScript

Jira服务器

状态: 计划的

目的: 自主的bug归档和问题管理

工具:

  • create_issue(title, description, type) -创建Jira问题
  • search_issues(jql_query) -使用JQL搜索
  • add_comment(issue_key, comment) -向问题添加评论
  • link_issues(issue_key_1, issue_key_2) -链接相关问题
  • update_issue(issue_key, fields) -更新问题字段

设置:

export JIRA_URL="https://your-org.atlassian.net"
export JIRA_EMAIL="your-email@example.com"
export JIRA_API_TOKEN="your-api-token"

Azure DevOps(ADO)服务器

状态: 计划的

目的: 工作项管理和构建集成

工具:

  • create_bug(title, description, project) -创建bug工作项
  • get_test_runs(project_id) -检索测试运行结果
  • get_latest_build(definition_id) -获取最新构建状态
  • link_work_items(work_item_id_1, work_item_id_2) -链接工作项
  • update_work_item(id, fields) -更新工作项字段

设置:

export AZURE_DEVOPS_ORG="your-org"
export AZURE_DEVOPS_PROJECT="your-project"
export AZURE_DEVOPS_PAT="your-personal-access-token"

测试结果服务器

状态: 计划的

目的: 汇总和分析测试执行结果

工具:

  • get_test_results(suite, time_range) -检索测试结果
  • analyze_test_coverage(coverage_file) -分析代码覆盖率
  • compare_test_runs(run_id_1, run_id_2) -比较两次试运行
  • get_failing_tests(suite) -列出当前失败的测试

Cypress服务器

状态: 计划的

目的: Cypress端到端测试集成

工具:

  • run_cypress_test(spec_file) -执行Cypress测试
  • open_cypress() -开放式赛普拉斯测试跑道
  • get_cypress_results() -获取最新的测试运行结果

API测试服务器

状态: 计划的

目的: REST API测试和验证

工具:

  • make_api_request(method, url, headers, body) -执行API调用
  • validate_api_response(response, schema) -根据JSON模式进行验证
  • run_api_test_suite(suite_file) -运行API测试集合

代理测试工作流程

模式1:情境测试生成

IDE中的AI代理现在可以:

  1. 检测代码更改 通过MCP文件系统资源
  2. 分析相关测试文件 理解模式
  3. 探索应用程序UI 使用Playwright MCP服务器
  4. 生成测试 直接进入你的项目
  5. 执行并验证 自动地

示例提示:

"Write a test for the new login feature I just added to login.js"

代理人将:

  • 阅读 login.js 了解该功能
  • 检查项目中现有的测试模式
  • 启动浏览器并浏览登录UI
  • 生成符合上下文的剧作家测试
  • 将其写入正确的测试文件

模式2:自主回归测试

"Run the regression suite and file bugs for any failures"

代理人将:

  1. 执行所有剧作家测试
  2. 失败时:捕获屏幕截图、检查DOM、检查日志
  3. 在Jira中搜索重复问题
  4. 通过详细的复制步骤创建新bug
  5. 如果选择器更改,则更新测试代码(自愈)

模式3:智能测试维护

"Audit my test suite and fix any broken tests"

代理人将:

  1. 分析测试文件中的不稳定测试和过时的选择器
  2. 根据当前应用程序状态验证选择器
  3. 自动重构或删除过时的测试
  4. 通过改进创建PR

建筑

┌─────────────────────────────────────────────────────────┐
│         MCP-Native IDE (Cursor, Codespaces, etc.)        │
│  ┌───────────────────────────────────────────────────┐  │
│  │         AI Agent (Native MCP Client)               │  │
│  │                                                    │  │
│  │  ┌──────────┐  ┌──────────┐  ┌──────────┐         │  │
│  │  │ Playwright│  │  Jira    │  │   ADO    │         │  │
│  │  │MCP Server│  │MCP Server│  │MCP Server│  ...    │  │
│  │  └──────────┘  └──────────┘  └──────────┘         │  │
│  │       │            │            │                   │  │
│  │       └────────────┴────────────┘                   │  │
│  │              (Native MCP Protocol)                  │  │
│  └───────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────┘

使用示例

编剧基本工作流程

// Your AI agent uses these tools automatically, but here's what happens:

// 1. Launch browser
const session = await mcp.callTool('playwright', 'launch_browser', {
  url: 'https://app.example.com'
});

// 2. Get page content
const content = await mcp.callTool('playwright', 'get_page_content', {
  session_id: session.id
});

// 3. Perform actions
await mcp.callTool('playwright', 'perform_action', {
  session_id: session.id,
  action: 'fill',
  selector: '#email',
  value: 'user@example.com'
});

// 4. Capture evidence
const screenshot = await mcp.callTool('playwright', 'capture_screenshot', {
  session_id: session.id
});

自主Bug归档

// After a test failure, agent automatically:

// 1. Capture failure evidence
const screenshot = await playwright.capture_screenshot();
const pageState = await playwright.get_page_content();

// 2. Check for duplicates
const duplicates = await jira.search_issues(
  `summary ~ "Login button not clickable" AND status != Closed`
);

// 3. Create bug if no duplicate
if (duplicates.length === 0) {
  await jira.create_issue({
    title: 'Login button not clickable on /login page',
    description: `Test failed at ${new Date()}\n\nScreenshot: ${screenshot}\n\nPage state: ${JSON.stringify(pageState)}`,
    type: 'Bug',
    priority: 'High'
  });
}

安全最佳实践

  1. 凭证管理:

- 永远不要提交API密钥或令牌 - 使用环境变量或IDE机密 - 定期轮换凭据

  1. 权限范围:

- 授予MCP服务器所需的最低权限 - 尽可能使用只读凭据 - 审核MCP工具使用日志

  1. 网络安全:

- 在开发中在本地主机上运行MCP服务器 - 对远程MCP服务器使用TLS - 限制CI/CD中的网络访问

  1. 测试数据隔离:

- 使用单独的测试环境 - 运行后清理测试数据 - 从不访问生产数据

测试服务器

# Run all server tests
npm test

# Test specific server
npm test -- playwright

# Run with coverage
npm run test:coverage

文档

入门指南

MCP协议

测试工具

研究与资源

贡献

我们欢迎捐款!这是代理测试的基础架构。

查看我们的 贡献指南 详细说明。

快速贡献步骤:

  1. 克隆该仓库
  2. 创建要素分支(git checkout -b feature/new-mcp-server)
  3. 按照现有模式实现MCP服务器
  4. 添加测试和文档
  5. 提交拉取请求

添加新的MCP服务器

  1. 创建目录: src/servers/your-server/
  2. 按照MCP协议实现服务器(以Playwright服务器为例)
  3. 导出服务器类
  4. 在中添加测试 src/servers/your-server/__tests__/
  5. README中的文档工具
  6. 如有需要,更新CI/CD

路线图

实现

  • \[x\] Playwright MCP服务器-使用8个工具全面实现
  • \[x\] TypeScript构建系统和配置
  • \[x\] 测试套件基础设施
  • \[x\] CI/CD管道(GitHub操作)
  • \[x\] GitHub代码空间配置
  • \[x\] 文件和示例

进行中

  • \[\]增强的错误处理和重试逻辑
  • \[\]会话持久性和恢复
  • \[\]性能优化

计划的

  • \[\]Jira MCP服务器-自主错误归档
  • \[\]Azure DevOps MCP服务器-工作项管理
  • \[\]Selenium MCP服务器-跨浏览器自动化
  • \[\]赛普拉斯MCP服务器-赛普拉斯集成
  • \[\]API测试服务器-REST API验证
  • \[\]测试结果聚合服务器-结果分析
  • \[\]性能测试服务器-负载测试
  • \[\]安全扫描服务器-安全测试
  • \[\]数据库测试服务器-数据库验证

未来特征(2025年趋势)

  • \[\]代理工作流-自主测试生成
  • \[\]视觉AI集成-AI驱动的屏幕截图比较
  • \[\]多代理编排-协调测试代理
  • \[\]OAuth 2.1支持-增强的安全性
  • \[\]异步任务-长时间运行的测试执行
  • \[\]无状态架构-提高了可扩展性

致谢

现在试试

选项1:GitHub代码空间(推荐)

](https://github.com/codespaces/new?template_repository=ElaMCB/mcp-testing-servers)

点击上面的徽章,立即启动预配置的环境!

选项2:本地设置

git clone https://github.com/ElaMCB/mcp-testing-servers.git
cd mcp-testing-servers
npm install
npx playwright install chromium
npm run build

选项3:用作模板

将此存储库用作您自己的MCP服务器的模板!

______________________________________________________________________

项目状态

当前版本: 1.0.0\ MCP规范合规性: 2025\ 最后更新时间: 2024年12月\ 积极发展:

将IDE转换为智能测试代理。

专为代理测试时代而设计。

______________________________________________________________________

社区

______________________________________________________________________

关于

╔══════════════════════════════════════════════════════════════╗
║                                                              ║
║         MCP Testing Servers - Agentic Testing Framework      ║
║                                                              ║
║    Transform your IDE into an intelligent testing agent      ║
║                                                              ║
╚══════════════════════════════════════════════════════════════╝

由Ela MCB创建 |AI第一质量工程师

┌─────────────────────────────────────────────────────────────┐
│  License: MIT                                                │
│  See LICENSE file for full details                           │
│                                                              │
│  Copyright (c) 2025 ElaMereanu                               │
│                                                              │
│  Permission is hereby granted, free of charge, to any      │
│  person obtaining a copy of this software and associated    │
│  documentation files (the "Software"), to deal in the      │
│  Software without restriction, including without limitation  │
│  the rights to use, copy, modify, merge, publish,           │
│  distribute, sublicense, and/or sell copies of the          │
│  Software, and to permit persons to whom the Software is  │
│  furnished to do so, subject to the conditions in the       │
│  LICENSE file.                                              │
└─────────────────────────────────────────────────────────────┘

目录标签

目录标签

测试自动化开发工具JavaScriptCursor浏览器自动化本地部署AI测试质量保证

支持客户端

Cursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

oauth

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

playwright

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiooauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP