Supports importing Cucumber JSON format test execution results into Xray Test Management.
Integrates with Xray Test Management (both Cloud and Server/Data Center) to create and execute test runs, import test results from multiple formats (JUnit, Cucumber, Robot Framework, TestNG), query test executions, retrieve test information, manage test plans, and update test execution statuses.
Supports importing Robot Framework XML format test execution results into Xray Test Management.
Xray MCP Server
A Model Context Protocol (MCP) server for integrating with Xray Test Management. This server enables AI assistants like Claude to interact with Xray, supporting test execution and importing test results from various formats.
Features
Dual Deployment Support: Works with both Xray Cloud and Xray Server/Data Center
Test Execution: Create and execute test runs directly from AI conversations
Multiple Import Formats: Import test results from JUnit, Cucumber, Xray JSON, Robot Framework, and TestNG
Query & Management: Query test executions, retrieve test information, and manage test plans
Type-Safe: Built with TypeScript for robust type checking and IDE support
Installation
Configuration
Environment Variables
Copy .env.example to .env and configure based on your Xray deployment:
For Xray Cloud
Get your API credentials from: https://xray.cloud.getxray.app/api-keys
For Xray Server/Data Center
Using Personal Access Token (Recommended)
Using Basic Authentication
MCP Client Configuration
Add this server to your MCP client configuration (e.g., Claude Desktop):
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Or if you want to use the .env file, ensure it's in the working directory:
Available Tools
1. import_test_results
Import automated test execution results from various formats.
Supported Formats:
junit- JUnit XML formatcucumber- Cucumber JSON formatxray-json- Xray native JSON formatrobot- Robot Framework XML formattestng- TestNG XML format
Example:
2. execute_tests
Create and execute a test run in Xray for specified test cases.
Example:
3. query_test_executions
Query and filter test executions in Xray.
Example:
4. get_test_info
Retrieve detailed information about a specific test case.
Example:
5. create_test_execution
Create a new test execution container in Xray.
Example:
6. update_test_execution
Update status and details of a test within an execution.
Example:
7. get_test_plans
List test plans in a project.
Example:
8. associate_tests_to_execution
Add test cases to an existing test execution.
Example:
Usage Examples
Importing JUnit Results
Then in your AI conversation:
Executing Tests
Querying Test Executions
API Coverage
Feature | Xray Cloud | Xray Server/DC |
Import JUnit | ✅ | ✅ |
Import Cucumber | ✅ | ✅ |
Import Xray JSON | ✅ | ✅ |
Import Robot | ✅ | ✅ |
Execute Tests | ✅ | ✅ |
Query Executions | ✅ (GraphQL) | ✅ (JQL) |
Get Test Info | ✅ | ✅ |
Create Execution | ✅ | ✅ |
Update Test Run | ✅ | ✅ |
Get Test Plans | ✅ | ✅ |
Associate Tests | ✅ | ✅ |
Architecture
The server uses a multi-client architecture:
XrayClient Interface: Common interface for both clients
CloudClient: Implements Xray Cloud API v2 with GraphQL
ServerClient: Implements Xray Server/DC REST API v1
Factory Pattern: Automatically creates the correct client based on configuration
Development
Running in Development Mode
Building
Project Structure
Troubleshooting
Authentication Errors
Error: Authentication failed. Please check your credentials.
Solution:
For Cloud: Verify your Client ID and Client Secret at https://xray.cloud.getxray.app/api-keys
For Server: Verify your token or username/password. Ensure the user has proper permissions.
Connection Errors
Error: Network error: Unable to reach Xray API
Solution:
Check your
XRAY_JIRA_BASE_URLis correct (for Server deployment)Verify network connectivity to Xray
Check if a proxy or firewall is blocking the connection
Invalid Test Key Format
Error: Invalid test key format
Solution: Test keys must follow the format PROJECT-123 where PROJECT is the project key and 123 is the issue number.
Import Failures
Error: Import fails with validation errors
Solution:
Verify the XML/JSON format is correct for the specified format type
Check that the project key exists in Jira
Ensure test keys referenced in results exist (or use
autoCreateTests: truefor Cloud)
Missing Dependencies
Error: TypeScript errors or missing modules
Solution: Run npm install to ensure all dependencies are installed.
Contributing
Contributions are welcome! Please ensure:
Code follows the existing style
TypeScript types are properly defined
Error handling is comprehensive
Documentation is updated for new features
License
MIT
Resources
Support
For issues and questions:
Check the troubleshooting section above
Review Xray API documentation
Open an issue in the repository