此MCP服务器提供了前端测试工具,包括:
git clone <repository-url> mcp-frontend-testingcd mcp-frontend-testingnpm install# 构建服务器
npm run build
# 使用HTTP传输启动服务器
npm run start:http
# 构建服务器
npm run build
# 使用标准IO传输启动服务器
npm run start:stdio
code (字符串,必需):要分析的源代码。language (枚举,可选):代码的语言 (javascript | typescript | jsx | tsx,默认值:javascript)。code (字符串,必需):要为其生成测试的源代码。framework (枚举,必需):测试框架 (jest | cypress)。type (枚举,必需):测试类型 (unit | component | e2e)。language (枚举,可选):代码的语言 (javascript | typescript | jsx | tsx,默认值:javascript)。description (字符串,可选):测试用例的描述。sourceCode (字符串,必需):正在测试的源代码。testCode (字符串,必需):要执行的测试代码。framework (枚举,必需):测试框架 (jest | cypress)。type (枚举,必需):测试类型 (unit | component | e2e)。config (记录,可选):测试执行的配置对象。componentCode (字符串,必需):React组件的源代码。testCode (字符串,可选):组件的测试代码(如果没有提供则自动生成)。framework (枚举,可选):测试框架 (jest | cypress,默认值:jest)。props (记录,可选):在测试期间传递给组件的属性。autoGenerateTest (布尔值,可选):如果未提供则自动生成测试代码(默认值:true)。templates://{framework}/{type}framework (字符串,必需):测试框架 (jest | cypress)。type (字符串,必需):模板类型 (unit | component)。docs://{topic}topic (字符串,必需):文档主题 (jest | cypress | react-testing-library)。使用Docker构建并运行服务器:
docker build -t mcp-frontend-testing .
docker run -p 3000:3000 mcp-frontend-testing
部署到AWS Lambda、Google Cloud Run或Azure Functions等云平台,实现无服务器或容器化部署。
注意:此服务器设计用于与MCP客户端配合使用,使LLMs能够执行前端测试任务。