Model Context Protocol server for Allure TestOps API, written in Python.
This MCP server provides a Python implementation for interacting with Allure TestOps API through the Model Context Protocol. It supports full CRUD operations for test cases, launches, and test plans, along with 56+ controller endpoints for comprehensive Allure TestOps integration.
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone <repository-url>
cd allure_testops/mcp/python- Install dependencies:
pip install -r requirements.txt- Set up environment variables (see Configuration section below)
Set the following environment variables:
ALLURE_TESTOPS_URL: Base URL of your Allure TestOps instance (e.g.,https://your-allure-instance.com)ALLURE_TOKEN: API token for authentication (generate in Allure TestOps user settings)PROJECT_ID: Default project ID (numeric string, e.g.,"1")
export ALLURE_TESTOPS_URL='https://your-allure-instance.com'
export ALLURE_TOKEN='your-api-token'
export PROJECT_ID='1'Create a .env file in the project root:
ALLURE_TESTOPS_URL=https://your-allure-instance.com
ALLURE_TOKEN=your-api-token
PROJECT_ID=1
MCP_TRANSPORT=stdio
MCP_ADDRESS=0.0.0.0:8000Note: Never commit .env files to version control. Use .env.example as a template.
Run the server in stdio mode (default):
python index.py
# or explicitly:
python index.py --transport stdioThe server will run on stdio and communicate via the Model Context Protocol.
Run the server in HTTP Streamable mode using environment variables:
export MCP_TRANSPORT=streamable_http
export MCP_ADDRESS=0.0.0.0:8000
python index.pyThe server will be available at http://localhost:8000 (or the specified address).
MCP_TRANSPORT: Transport mode (stdioorstreamable_http). Default:stdioMCP_ADDRESS: Host and port in formathost:port. Default:0.0.0.0:8000
The repository includes utility scripts:
get_open_launches.py- Fetch all open launches from Allure TestOps
python get_open_launches.pyAdd to your mcp.json (typically located in ~/.cursor/mcp.json or similar):
{
"mcpServers": {
"allure-testops-python": {
"command": "python3",
"args": [
"/absolute/path/to/index.py"
],
"env": {
"ALLURE_TESTOPS_URL": "https://your-allure-instance.com",
"ALLURE_TOKEN": "your-api-token",
"PROJECT_ID": "1"
}
}
}
}The server provides 10 tools organized by resource type and operation category.
test_case_read- Read test case data- method="list" - List all test cases in a project with pagination
- method="get" - Get a specific test case by ID (includes scenario/steps)
test_case_write- Create, update, or delete test cases- method="create" - Create a new test case
- method="update" - Update an existing test case
- method="delete" - Delete a test case
test_case_step_create- Create a test case step- Supports text steps and attachment steps
- Can insert step before/after specific step ID
- Optional expected result section
launch_read- Read launch data- method="list" - List all launches in a project with pagination
- method="get" - Get a specific launch by ID
launch_write- Create, update, delete, or close launches- method="create" - Create a new launch
- method="update" - Update an existing launch
- method="delete" - Delete a launch
- method="close" - Close a launch
test_plan_read- Read test plan data- method="list" - List all test plans in a project with pagination
- method="get" - Get a specific test plan by ID
test_plan_write- Create, update, or delete test plans- method="create" - Create a new test plan
- method="update" - Update an existing test plan
- method="delete" - Delete a test plan
bulk_create_test_cases_from_csv- Bulk create test cases from CSV contenttest_case_custom_fields- Get or modify custom field values- method="get" - Get custom field values for a test case
- method="modify" - Add or remove a custom field value (with mode="add" or mode="delete")
get_custom_field_values- Get possible values for a custom field in a projecttest_case_comments- Get or create comments for a test case- method="get" - Get comments for a test case with pagination
- method="create" - Create a new comment
// List all test cases in a project
{
"tool": "test_case_read",
"arguments": {
"method": "list",
"project_id": "1",
"page": 0,
"size": 10
}
}
// Get a specific test case
{
"tool": "test_case_read",
"arguments": {
"method": "get",
"id": 12345
}
}// Create a new test case
{
"tool": "test_case_write",
"arguments": {
"method": "create",
"project_id": "1",
"name": "Test Login Functionality",
"description": "Verify user can log in",
"automated": true
}
}
// Update a launch
{
"tool": "launch_write",
"arguments": {
"method": "update",
"id": 67890,
"name": "Sprint 24 Regression",
"closed": false
}
}// Create a simple text step
{
"tool": "test_case_step_create",
"arguments": {
"test_case_id": 7476,
"text": "Open the login page"
}
}
// Create a step after a specific step ID
{
"tool": "test_case_step_create",
"arguments": {
"test_case_id": 7476,
"text": "Enter valid credentials",
"after_id": 20233
}
}
// Create a step with expected result
{
"tool": "test_case_step_create",
"arguments": {
"test_case_id": 7476,
"text": "Click login button",
"with_expected_result": true
}
}
// Create a step with custom body_json structure
{
"tool": "test_case_step_create",
"arguments": {
"test_case_id": 7476,
"body_json": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Custom formatted step"
}
]
}
]
}
}
}// Get custom fields for a test case
{
"tool": "test_case_custom_fields",
"arguments": {
"method": "get",
"test_case_id": 12345,
"project_id": "1"
}
}
// Add a custom field value
{
"tool": "test_case_custom_fields",
"arguments": {
"method": "modify",
"test_case_id": 12345,
"project_id": "1",
"custom_field_id": 100,
"custom_field_value_id": 200,
"mode": "add"
}
}// Get comments for a test case
{
"tool": "test_case_comments",
"arguments": {
"method": "get",
"test_case_id": 7476,
"page": 0,
"size": 25
}
}
// Create a new comment
{
"tool": "test_case_comments",
"arguments": {
"method": "create",
"test_case_id": 7476,
"body": "This is a test comment"
}
}- ✅ Full Allure TestOps API integration
- ✅ 56+ controller endpoints
- ✅ Async/await support for high performance
- ✅ Type-safe tool definitions
- ✅ Comprehensive error handling
- ✅ CSV import support for bulk operations
- ✅ Clean read/write operation separation
.
├── index.py # Main MCP server entry point
├── allure_client.py # HTTP client for Allure TestOps API
├── csv_parser.py # CSV parsing utilities
├── controllers/ # API controller modules
├── get_open_launches.py # Utility script for fetching open launches
├── requirements.txt # Python dependencies
└── README.md # This file
Run the test scripts:
python test_simple.py
python test_mcp.pySee TESTING.md and QUICK_TEST.md for more details.
- Never commit API tokens or credentials to version control
- Use environment variables or secure secret management
- The
.gitignorefile excludes sensitive files by default - Rotate API tokens regularly
Contributions are welcome! Please ensure:
- Code follows Python best practices
- All tests pass
- No sensitive data is included in commits
- README is updated for new features
See LICENSE file for details.
For issues and questions:
- Check the documentation in
TESTING.mdandQUICK_TEST.md - Review Allure TestOps API documentation
- Open an issue in the repository