Xray MCP
Integrates with Jira and Xray Test Management to manage tests, test executions, test plans, test sets, and import/export test results.
Allows import of Cucumber JSON test results and export of Cucumber feature files from Xray.
Allows import of Robot Framework XML test results into Xray.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Xray MCP List test executions in project PROJ"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Xray MCP
A Model Context Protocol (MCP) server that integrates Cursor IDE with Xray Test Management for Jira, allowing you to manage tests, test executions, and test plans directly from your development environment.
Features
Tests
List Tests: Fetch all tests from your Jira project with filtering options
Get Test Details: Retrieve detailed test information including test steps via GraphQL āØ
Get Test With Steps: NEW! Reliably fetch test details with steps using the GraphQL
getTestsquery šCreate Test: Create new manual or automated tests
Update Test: Modify existing tests
Test Executions
List Test Executions: View all test executions in a project
Get Test Execution Details: See detailed execution results including test runs
Create Test Execution: Create new test execution sessions
Update Test Run: Record test results (PASS, FAIL, TODO, EXECUTING, ABORTED)
Test Plans
List Test Plans: View all test plans in a project
Get Test Plan Details: See test plan information with associated tests
Create Test Plan: Create new test plans
Add Tests to Test Plan: Associate tests with existing plans
Test Sets
List Test Sets: View all test sets in a project
Get Test Set Details: See test set information with associated tests
Import Operations (CI/CD Integration) š NEW!
Import Xray JSON Results: Import test execution results in Xray JSON format
Import Cucumber Results: Import Cucumber JSON test results
Import JUnit Results: Import JUnit XML test results
Import TestNG Results: Import TestNG XML test results
Import NUnit Results: Import NUnit XML test results
Import Robot Framework Results: Import Robot Framework XML test results
Import Behave Results: Import Behave JSON test results
Import Feature Files: Import Cucumber .feature files (BDD scenarios)
Export Operations š¤ NEW!
Export Cucumber Features: Export Cucumber feature files from Xray
Related MCP server: mcp-zephyr-scale
Prerequisites
Node.js 18 or higher
npm or yarn
Jira Cloud account with Xray Test Management plugin installed
Jira API token for authentication
Installation
Option 1: Install from npm (Recommended)
The package is available on npm and can be used directly with npx:
npx @korfu/xray-mcpNo installation required! Continue to Generate Jira API Token section.
Option 2: Local Development Setup
If you want to contribute or modify the code:
1. Clone the Repository
git clone https://github.com/Korfu/mcp-xray.git
cd mcp-xray2. Install Dependencies
npm install3. Build the Project
npm run buildSetup
Generate Jira API Token
Click "Create API token"
Give it a descriptive name (e.g., "Xray MCP Integration")
Copy the generated token - you won't be able to see it again!
4. Configure Environment Variables
You'll need the following environment variables:
Required:
JIRA_BASE_URL: Your Jira instance URL (e.g.,https://your-domain.atlassian.net)JIRA_EMAIL: Your Jira account emailJIRA_API_TOKEN: The API token from step 3
Optional (for test steps):
XRAY_CLIENT_ID: Your Xray Cloud API client IDXRAY_CLIENT_SECRET: Your Xray Cloud API client secret
4.1. Get Xray Cloud API Credentials (Optional - for Test Steps)
To fetch test steps from Xray, you need Xray Cloud API credentials:
Log in to your Jira instance
Go to Settings (āļø) ā Apps ā Manage apps
In the left sidebar, find Xray section
Click on API Keys (or Cloud API)
Click Create API Key
Give it a name (e.g., "MCP Integration")
Copy the Client ID and Client Secret
Save these securely - you won't be able to see the secret again!
Note: Without Xray Cloud API credentials, the MCP will still work for listing and managing tests, but test steps won't be fetched.
5. Add to Cursor MCP Configuration
Add the following configuration to your Cursor MCP settings file (usually at ~/.cursor/mcp.json or similar):
For npm installation (recommended):
{
"mcpServers": {
"xray": {
"command": "npx",
"args": ["-y", "@korfu/xray-mcp"],
"env": {
"JIRA_BASE_URL": "https://your-domain.atlassian.net",
"JIRA_EMAIL": "your-email@example.com",
"JIRA_API_TOKEN": "your-api-token-here",
"XRAY_CLIENT_ID": "your-xray-client-id",
"XRAY_CLIENT_SECRET": "your-xray-client-secret"
}
}
}
}Important:
Replace the values with your actual credentials
XRAY_CLIENT_IDandXRAY_CLIENT_SECRETare optional - omit them if you don't need test step details
6. Restart Cursor
After adding the configuration, restart Cursor IDE to load the MCP server.
Usage
Once configured, you can use the following tools in Cursor:
Tests
list_tests- List all tests in a projectget_test- Get detailed test information (may not always return steps)get_test_with_steps- NEW! Get detailed test information with steps (uses reliable GraphQL query)create_test- Create a new testupdate_test- Update an existing test
Test Executions
list_test_executions- List test executionsget_test_execution- Get test execution detailscreate_test_execution- Create a new test executionupdate_test_run- Update test run status
Test Plans
list_test_plans- List all test plansget_test_plan- Get test plan detailscreate_test_plan- Create a new test planadd_tests_to_test_plan- Add tests to a plan
Test Sets
list_test_sets- List all test setsget_test_set- Get test set details
Import Operations š NEW!
import_execution_results- Import Xray JSON format resultsimport_cucumber_results- Import Cucumber JSON resultsimport_junit_results- Import JUnit XML resultsimport_testng_results- Import TestNG XML resultsimport_nunit_results- Import NUnit XML resultsimport_robot_results- Import Robot Framework XML resultsimport_behave_results- Import Behave JSON resultsimport_feature_file- Import Cucumber .feature files
Export Operations š¤ NEW!
export_cucumber_features- Export Cucumber features as .feature files
Examples
Basic Operations
Get Test with Steps (RECOMMENDED)
Get test EXM-123 with stepsThis uses the new get_test_with_steps tool which reliably fetches test steps.
Output includes test steps:
**Test: EXM-123**
**Summary:** Verify user login functionality
**Test Type:** Manual
**Test Steps:**
**Step 1:**
- **Action:** Navigate to the login page
- **Data:** URL: https://example.com/login
- **Expected Result:** Login page is displayed
**Step 2:**
- **Action:** Enter valid credentials and click Submit
- **Data:** Username: testuser, Password: ********
- **Expected Result:** User is successfully authenticated
**Step 3:**
- **Action:** Verify user dashboard is displayed
- **Data:** N/A
- **Expected Result:** Dashboard shows user profile and navigation menuCI/CD Integration Examples š
Import JUnit Results
Import JUnit test results from file test-results/junit.xmlImport Cucumber Results
Import Cucumber results from file cucumber-report.jsonExport Feature Files
Export Cucumber features for tests EXM-1,EXM-2,EXM-3Legacy Examples
List Tests in a Project
List all tests in project PROJ with label "regression"Create a Test
Create a new manual test in project PROJ with summary "Login validation test" and description "Verify user can login with valid credentials"Update Test Run Status
Update test run for test PROJ-123 in execution PROJ-456 with status PASS and comment "All assertions passed"Create Test Execution
Create a test execution in project PROJ with summary "Sprint 5 Regression" and add tests PROJ-123, PROJ-124, PROJ-125Development
Running in Development Mode
npm run devBuilding
npm run buildProject Structure
XRayMCP/
āāā src/
ā āāā index.ts # Main MCP server
ā āāā types.ts # TypeScript interfaces
ā āāā services/
ā ā āāā XrayCloudService.ts # Xray Cloud API service (GraphQL + REST)
ā āāā tools/
ā āāā tests/ # Test operations
ā ā āāā listTests.ts
ā ā āāā getTest.ts
ā ā āāā createTest.ts
ā ā āāā updateTest.ts
ā āāā test-executions/ # Test execution operations
ā ā āāā listTestExecutions.ts
ā ā āāā getTestExecution.ts
ā ā āāā createTestExecution.ts
ā ā āāā updateTestRun.ts
ā āāā test-plans/ # Test plan operations
ā ā āāā listTestPlans.ts
ā ā āāā getTestPlan.ts
ā ā āāā createTestPlan.ts
ā ā āāā addTestsToTestPlan.ts
ā āāā test-sets/ # Test set operations
ā ā āāā listTestSets.ts
ā ā āāā getTestSet.ts
ā āāā import/ # Import operations (NEW!)
ā ā āāā importExecutionResults.ts
ā ā āāā importCucumberResults.ts
ā ā āāā importJUnitResults.ts
ā ā āāā importTestNGResults.ts
ā ā āāā importNUnitResults.ts
ā ā āāā importRobotResults.ts
ā ā āāā importBehaveResults.ts
ā ā āāā importFeatureFile.ts
ā āāā export/ # Export operations (NEW!)
ā āāā exportCucumberFeatures.ts
āāā dist/ # Compiled JavaScript output
āāā XRAY_CLOUD_API_V2_ENDPOINTS.md # API documentation
āāā XRAY_CLOUD_V2_IMPLEMENTATION.md # Implementation details
āāā package.json
āāā tsconfig.json
āāā README.mdAPI Architecture
Xray Cloud API v2 - Dual Approach
This MCP server uses two complementary APIs provided by Xray Cloud:
1. GraphQL API (for Queries)
Endpoint:
https://xray.cloud.getxray.app/api/v2/graphqlUsed For: Fetching test details with steps
Why: Xray Cloud exposes test steps only via GraphQL, not REST
query {
getTest(issueId: "EXM-123") {
issueId
steps {
id
action
data
result
}
}
}2. REST API v2 (for Import/Export)
Base URL:
https://xray.cloud.getxray.app/api/v2Used For: Importing test results, exporting features
Endpoints:
POST /import/execution/*- Import results (multiple formats)POST /import/feature- Import BDD featuresGET /export/cucumber- Export BDD features
Authentication
All operations use JWT Bearer tokens obtained via:
POST /api/v2/authenticate
Body: { client_id, client_secret }
Response: "eyJhbGciOiJIUzI1NiI..."Tokens are:
Cached for 50 minutes
Automatically refreshed
Stored in memory only (not persisted)
Troubleshooting
Authentication Issues
Verify your Jira email and API token are correct
Ensure the API token has the correct permissions
Check that your Jira base URL is correct (should not end with a slash)
"Test issue type not found" Error
Ensure Xray is installed in your Jira instance
Verify the project has Xray enabled
Check that you have permission to create issues in the project
Connection Issues
Verify your internet connection
Check if your Jira instance is accessible
Ensure the MCP server is running (check Cursor's MCP logs)
Test Not Found
Verify the test key is correct (e.g., PROJ-123)
Ensure you have access to the test
Check that the test exists in Jira
MCP Server Not Loading
Verify the path to
dist/index.jsis correct in your Cursor configurationEnsure Node.js is installed and accessible from the command line
Check Cursor's MCP server logs for error messages
Make sure you've run
npm run buildto compile the TypeScript code
Test Steps Not Appearing
Ensure you've configured
XRAY_CLIENT_IDandXRAY_CLIENT_SECRETin your MCP configurationVerify your Xray Cloud API credentials are correct
Check that your Xray license includes API access
The test must be a Manual test type (Cucumber and Generic tests have different step formats)
Check Cursor's MCP logs for authentication errors
API Endpoints Used
This MCP uses the following Jira and Xray API endpoints:
Jira REST API v3:
/rest/api/3/search/jql,/rest/api/3/issue/*for general issue operationsXray Cloud API v2:
https://xray.cloud.getxray.app/api/v2/*for test steps and detailed test information (optional)
Security Notes
Keep your Jira API token secure and never commit it to version control
Keep your Xray Cloud API credentials (Client ID and Secret) secure
Use environment variables or secure configuration management for credentials
The API token should only have the minimum required permissions
Consider rotating your API tokens regularly
Xray API credentials are separate from Jira credentials and provide access to test data
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Related Resources
License
MIT License - see LICENSE file for details
Author
Korfu
Acknowledgments
Built following the Model Context Protocol specification
Inspired by the BitbucketMCP implementation pattern
Uses Xray Test Management for Jira by Xblend
Available Tools
24 toolsadd_tests_to_test_planB
Add tests to an existing test plan
Inputs: test_plan_key (required), test_keys (required).
create_testC
Create a new test in Jira with Xray
Inputs: project_key (required), summary (required), description, test_type, +2 more.
create_test_executionC
Create a new test execution in Jira with Xray
Inputs: project_key (required), summary (required), description, test_plan_key, +2 more.
create_test_planB
Create a new test plan in Jira with Xray
Inputs: project_key (required), summary (required), description, tests.
export_cucumber_featuresA
Export Cucumber feature files from Xray. Can export all features or specific test keys.
Inputs: test_keys.
get_testA
Get detailed information about a specific test by its key
Inputs: test_key (required).
get_test_executionB
Get detailed information about a test execution including test run results
Inputs: test_execution_key (required).
get_test_planA
Get detailed information about a test plan including associated tests
Inputs: test_plan_key (required).
get_test_setA
Get detailed information about a test set including associated tests
Inputs: test_set_key (required).
get_test_with_stepsA
Get detailed test information with test steps using the reliable GraphQL getTests query. This tool always fetches test steps if they exist.
Inputs: test_key (required).
import_behave_resultsA
Import Behave JSON test results to Xray. Automatically creates test execution and updates test statuses.
Inputs: behave_json (required).
import_cucumber_resultsA
Import Cucumber JSON test results to Xray. Automatically creates test execution and updates test statuses.
Inputs: cucumber_json (required).
import_execution_resultsA
Import test execution results in Xray JSON format. Creates test executions and test runs with results.
Inputs: results_json (required).
import_feature_fileA
Import Cucumber .feature file to Xray. Creates or updates BDD tests from Gherkin scenarios.
Inputs: feature_content (required).
import_junit_resultsA
Import JUnit XML test results to Xray. Automatically creates test execution and updates test statuses.
Inputs: junit_xml (required).
import_nunit_resultsA
Import NUnit XML test results to Xray. Automatically creates test execution and updates test statuses.
Inputs: nunit_xml (required).
import_robot_resultsA
Import Robot Framework XML test results to Xray. Automatically creates test execution and updates test statuses.
Inputs: robot_xml (required).
import_testng_resultsB
Import TestNG XML test results to Xray. Automatically creates test execution and updates test statuses.
Inputs: testng_xml (required).
list_test_executionsB
List test executions in a Jira project
Inputs: project_key (required), test_plan_key, test_key, max_results.
list_test_plansB
List all test plans in a Jira project
Inputs: project_key (required), max_results.
list_testsB
List all tests in a Jira project using JQL query
Inputs: project_key (required), labels, component, max_results.
list_test_setsB
List all test sets in a Jira project
Inputs: project_key (required), max_results.
update_testB
Update an existing test
Inputs: test_key (required), summary, description, labels, +1 more.
update_test_runC
Update the result of a test run within a test execution
Inputs: test_execution_key (required), test_key (required), status (required), comment, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 24 tools
Each tool targets a distinct Xray entity or action (test, test plan, test execution, test set, import format), with clear naming and descriptions preventing confusion. The only potential overlap (get_test vs get_test_with_steps) is resolved by explicit distinction in descriptions.
All tools follow a consistent verb_noun pattern in snake_case (e.g., create_test, get_test_plan, import_cucumber_results). The pattern is predictable and matches standard CRUD operations plus imports/exports.
24 tools is slightly high but justified for a comprehensive test management server covering multiple entity types and import/export formats. Each tool serves a distinct purpose, and the count aligns with the domain's complexity.
The tool set covers essential CRUD for tests, test plans, test executions, and test sets, plus imports/exports for various formats. However, delete operations for test plans, executions, and test sets are missing, leaving a notable gap in lifecycle coverage.
Maintenance
Related MCP Connectors
Run, debug, and triage tests from your IDE using natural language, no dashboard switching, no manual data transfers. The TestMu AI (formerly LambdaTest) MCP Server is a single remote server exposing four tool suites: HyperExecute ā analyze your project, generate YAML configs and test runner commands, then monitor jobs and sessions. Automation ā pull a TestID's details plus command, network, and console logs into one chat for instant root-cause analysis. Includes mobile app upload. SmartUI ā explain pixel, layout, DOM, and perceptual changes in a visual regression run, with context-aware React/HTML/CSS fixes. Accessibility ā audit any public URL or a local React app against WCAG and get ready-to-apply remediation steps. Connects over https://mcp.lambdatest.com/mcp using OAuth 2.1 ā no API keys in your config. One-click install in Cursor; works with Claude, GitHub Copilot, Cline, and any MCP client. Tests execute on the TestMu AI cloud: 3,000+ browsers and 10,000+ real devices.
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
MCP Server for JFrog, providing tools for development and artifact management.
Official MCP server for Qase ā manage test cases, runs, suites, defects via AI tools.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that integrates JIRA directly into Cursor IDE, allowing users to view assigned issues, get detailed information on specific tickets, and convert JIRA issues into local tasks without leaving their editor.1419 npm6TypeScriptMIT
- AlicenseNot gradedqualityFmaintenanceMCP server for Zephyr Scale test management tool, enabling test case, test plan, test cycle, and test execution management.46 npm2MIT
- AlicenseBqualityBmaintenanceAn MCP server for integrating with Atlassian products including Confluence, Jira, Bitbucket, and Xray for Jira, enabling AI-powered operations like searching, creating, and updating issues, pages, and test results.7327MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects AI assistants to Xray Cloud for Jira test management, enabling natural language interaction with tests, test plans, executions, and CI result imports.MIT