test-automation-mcp-server

rahul267/test-automation-mcp-server

3.2

If you are the rightful owner of test-automation-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This Test Automation MCP Server is designed to analyze GitHub repositories for test frameworks and generate automated test cases.

Tools
5
Resources
0
Prompts
0

Test Automation MCP Server - Client Setup

Overview

This Test Automation MCP Server analyzes GitHub repositories to detect test frameworks and generate automated test cases.

Features

  • šŸ” analyze-test-framework: Detect test frameworks (Jest, Mocha, Cypress, Playwright, Selenium)
  • šŸ“ get-test-files: Find all test files in a repository
  • šŸ”¬ analyze-test-file: Analyze specific test file structure and content
  • šŸ› ļø generate-test-case: Generate new test cases based on frameworks
  • šŸ“„ get-repo-file: Read any file from a GitHub repository

Setup Instructions

1. For Claude Desktop

Copy the contents of claude_desktop_config.json to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

2. For VS Code Extensions

Use vscode_mcp_config.json for VS Code extension configuration.

3. For Other MCP Clients

Use mcp_client_config.json as a universal configuration reference.

Environment Setup

  1. Build the server:

    npm run build
    
  2. Set GitHub Token:

    • Create a .env file with your GitHub token:
      GITHUB_TOKEN=your_github_token_here
      
    • Or set it as an environment variable:
      export GITHUB_TOKEN=your_github_token_here
      
  3. Get GitHub Token:

    • Go to GitHub.com → Settings → Developer settings → Personal access tokens
    • Generate a new token with repo or public_repo scope

Usage Examples

Analyze Test Framework

{
  "tool": "analyze-test-framework",
  "parameters": {
    "owner": "facebook",
    "repo": "react"
  }
}

Find Test Files

{
  "tool": "get-test-files", 
  "parameters": {
    "owner": "lodash",
    "repo": "lodash",
    "framework": "jest"
  }
}

Generate Test Case

{
  "tool": "generate-test-case",
  "parameters": {
    "framework": "jest",
    "testDescription": "calculate sum of two numbers",
    "functionName": "add",
    "testType": "unit"
  }
}

Analyze Specific Test File

{
  "tool": "analyze-test-file",
  "parameters": {
    "owner": "facebook", 
    "repo": "react",
    "filePath": "packages/react/src/__tests__/React-test.js"
  }
}

Read Repository File

{
  "tool": "get-repo-file",
  "parameters": {
    "owner": "facebook",
    "repo": "react", 
    "filePath": "package.json"
  }
}

Testing

Run the test client:

npm run test-client

Server Commands

  • npm run build - Build TypeScript to JavaScript
  • npm run serve - Build and start the server
  • npm run test-client - Test the server with sample requests

Troubleshooting

  1. Authentication Issues: Make sure your GitHub token is valid and has appropriate permissions
  2. Rate Limits: Without a token, you're limited to 60 requests/hour. With a token: 5000/hour
  3. Repository Access: Ensure the repository is public or your token has access to private repos
  4. Build Issues: Make sure TypeScript compiles successfully with npm run build

File Structure

calculator-server/
ā”œā”€ā”€ src/index.ts                 # Main server code
ā”œā”€ā”€ build/index.js              # Compiled server
ā”œā”€ā”€ claude_desktop_config.json  # Claude Desktop config
ā”œā”€ā”€ vscode_mcp_config.json      # VS Code extension config  
ā”œā”€ā”€ mcp_client_config.json      # Universal client config
ā”œā”€ā”€ client-test.js              # Test client
ā”œā”€ā”€ .env                        # Environment variables
└── package.json               # Dependencies and scripts