akshay619-dev/hercules-mcp-server
If you are the rightful owner of hercules-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.
The Hercules MCP Server is a Model Context Protocol server and VS Code extension that integrates with the Hercules test automation framework, allowing developers to manage test cases directly from VS Code.
create_test_case
Create a new test case with Gherkin content.
run_test_case
Run a specified test case.
list_test_cases
List all registered test cases.
get_test_case
Retrieve details of a specific test case.
get_execution_results
Get execution results for a specific test case.
Hercules MCP Server
A Model Context Protocol (MCP) server and VS Code extension that provides seamless integration with Hercules test automation framework. This project enables developers to write, trigger, and view Hercules test cases directly from VS Code.
๐ Features
MCP Server
- Create Test Cases: Register new Hercules test cases with Gherkin content
- Run Tests: Trigger Hercules test execution with AI-powered automation
- View Results: Access structured results including logs, screenshots, and reports
- Resource Management: Browse and manage test cases as MCP resources
๐ Project Structure
โโโ hercules-mcp-server/ # MCP Server implementation โ โโโ src/ โ โ โโโ types.ts # TypeScript type definitions โ โ โโโ hercules-client.ts # Hercules integration client โ โ โโโ mcp-server.ts # MCP server implementation โ โ โโโ index.ts # Server entry point โ โโโ package.json # Server dependencies โ โโโ tsconfig.json # TypeScript configuration
๐ ๏ธ Installation & Setup
Prerequisites
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- Hercules Framework (installed in
../../testzeus-hercules
)
Setup MCP Server
-
Navigate to the MCP server directory:
git clone git@github.com:akshay619-dev/hercules-mcp-server.git cd hercules-mcp-server
-
Install dependencies:
npm install
-
Build the server:
npm run build
-
Start the server:
npm run start:http
๐งช Testing and ๐ฌ API Usage & Postman Collection
A Postman collection is provided to help you explore and test all available API endpoints of the Hercules MCP Server.
Import the Collection
- Open Postman.
- Click Import and select
hercules-mcp-server.postman_collection.json
from the project root. - Set the base URL to
http://localhost:3000
(or your configured port).
Available Endpoints
GET /health
โ Health checkGET /tools
โ List available toolsPOST /tools/create_test_case
โ Create a new test casePOST /tools/run_test_case
โ Run a test caseGET /tools/list_test_cases
โ List all test casesGET /tools/get_test_case/:testCaseId
โ Get details of a test caseGET /tools/get_execution_results/:testCaseId
โ Get execution resultsGET /resources
โ List resourcesGET /resources/read?uri=hercules://test-case/<testCaseId>
โ Read resource contentGET /results/:testCaseId/:filename
โ Download result files (e.g., reports)
Example: Create a Test Case
POST /tools/create_test_case
Content-Type: application/json
{
"name": "Sample Test Case",
"gherkinContent": "Feature: Example\n Scenario: Test\n Given something\n When something happens\n Then expect something",
"testDataPath": "optional/path/to/data.json",
"llmModel": "gpt-4o",
"llmApiKey": "your-api-key"
}
Example: Run a Test Case
POST /tools/run_test_case
Content-Type: application/json
{
"testCaseId": "<testCaseId>",
"llmModel": "gpt-4o",
"llmApiKey": "your-api-key"
}
Example: Get Test Case Details
GET /tools/get_test_case/<testCaseId>
For more, see the imported Postman collection in your workspace
๐ Troubleshooting
Common Issues
- MCP Server Connection Failed
- Ensure the Hercules framework is installed and accessible
- Check that the server path is correct
- Verify Python environment and dependencies
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Hercules Framework - The underlying test automation framework
- Model Context Protocol - The protocol specification
- VS Code Extension API - The extension development framework