MCP Testing Assistant

MCP Testing Assistant

Enables automated testing and coverage reporting for MCP services with test execution, file generation, and mock service creation. Provides comprehensive testing infrastructure including Jest integration, coverage reports, and health checks for the MCP ecosystem.

Category
访问服务器

README

MCP Testing Assistant

Automated testing and coverage reporting for MCP services in the ecosystem.

Overview

The MCP Testing Assistant provides comprehensive testing capabilities for all MCP services, including:

  • Automated test execution with Jest
  • Coverage reporting with c8
  • Test file generation using shared utilities
  • Mock service creation for testing
  • Testing infrastructure health checks

Installation

npm install

Usage

MCP Mode (Claude Desktop)

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "testing-assistant": {
      "command": "node",
      "args": ["/path/to/mcp-testing-assistant/start.js"],
      "env": {}
    }
  }
}

HTTP Mode

# Start HTTP bridge on port 9116
npm run http

# Or with custom port
SERVICE_PORT=9200 npm run http

Available Tools

run_tests

Run tests for a specific service or all services.

{
  service: "mcp-secrets-assistant",  // Optional, all services if not specified
  type: "unit",                      // unit, integration, e2e, or all
  coverage: true                     // Generate coverage report
}

generate_tests

Generate test files for a service using shared test utilities.

{
  service: "mcp-logs-assistant",
  tools: ["search_logs", "tail_logs"]  // List of tools to test
}

coverage_report

Generate coverage report for services.

{
  service: "mcp-gateway",  // Optional, all services if not specified
  format: "html"          // text, html, or json
}

test_health

Check testing infrastructure health.

{}  // No parameters required

create_mock

Create a mock service for testing.

{
  service: "mcp-secrets-assistant",
  port: 9300,
  responses: {
    "/health": { status: "healthy", mock: true },
    "/api/tools": { tools: [] }
  }
}

REST API Endpoints

When running in HTTP mode:

  • GET /health - Service health check
  • GET /api/tools - List available tools
  • POST /api/execute - Execute a tool
  • GET /test-results/:service - Get test results for a service
  • GET /coverage-summary - Get coverage summary for all services

CLI Commands

# Run coverage report
node index.js coverage [service]

# Generate tests
node index.js generate <service>

# Start in MCP mode
npm start

# Start in HTTP mode
npm run http

Development

# Run in development mode with auto-reload
npm run dev

# Run tests
npm test

Configuration

Environment Variables

  • SERVICE_PORT - HTTP bridge port (default: 9116)
  • LOG_LEVEL - Logging level (default: info)
  • ALLOWED_ORIGINS - CORS allowed origins

Data Storage

Test results and coverage reports are stored in:

~/Documents/mcp-assistant/data/testing/
├── results/      # Test execution results
├── coverage/     # Coverage reports
└── mocks/        # Mock service definitions

Integration with Ecosystem

The Testing Assistant integrates with:

  • Gateway: Accessible via /api/proxy/testing/*
  • Launch Assistant: Can be managed as a service
  • Logs Assistant: Test execution logs are centralized

Best Practices

  1. Regular Testing: Run tests before deploying changes
  2. Coverage Goals: Aim for >80% code coverage
  3. Test Categories: Organize tests by type (unit, integration, e2e)
  4. Mock Services: Use mocks for external dependencies
  5. Continuous Integration: Integrate with CI/CD pipelines

Troubleshooting

Tests Not Found

  • Ensure test files follow naming convention: *.test.js
  • Check that services have a tests/ directory

Coverage Not Generated

  • Verify c8 is installed: npm list c8
  • Check for .c8rc.json configuration

Mock Service Issues

  • Ensure port is not in use
  • Check mock responses are valid JSON

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选