Xray MCP Server
Enables integration with Xray Cloud APIs for comprehensive test management including creating and managing test cases, test executions, test plans, and test sets. Supports CI/CD automation and test result tracking through GraphQL APIs.
README
Xray MCP Server
Model Context Protocol (MCP) server per integrare le API di Xray Cloud con Claude Code e altri client MCP.
Funzionalità
Questo server MCP espone strumenti per gestire test cases e test executions in Xray Cloud usando l'API GraphQL ufficiale:
Test Cases (Test Management)
- create_test_case: Crea un nuovo test case (usa GraphQL mutation
createTest) - get_test_case: Recupera i dettagli di un test case specifico (usa GraphQL query
getTests) - delete_test_case: Elimina un test case (usa GraphQL mutation
deleteTest) - search_test_cases: Cerca test cases usando JQL (Jira Query Language)
- get_project_test_cases: Recupera tutti i test cases di un progetto
- update_test_case: ⚠️ Non supportato direttamente - usa Jira REST API per aggiornare campi standard
Test Executions (Test Automation & CI/CD)
- create_test_execution: Crea una nuova test execution per eseguire test
- get_test_execution: Recupera dettagli di una test execution con tutti i test runs
- search_test_executions: Cerca test executions usando JQL
- get_project_test_executions: Recupera tutte le test executions di un progetto
- update_test_run_status: Aggiorna lo stato di un test run (PASS, FAIL, ecc.)
Test Plans (Test Organization)
- create_test_plan: Crea un nuovo test plan per organizzare test
- get_test_plan: Recupera dettagli di un test plan specifico con tutti i test
- search_test_plans: Cerca test plans usando JQL
- get_project_test_plans: Recupera tutti i test plans di un progetto
- add_tests_to_test_plan: Aggiungi test a un test plan esistente
- remove_tests_from_test_plan: Rimuovi test da un test plan
Test Sets (Test Grouping)
- create_test_set: Crea un nuovo test set per raggruppare test
- get_test_set: Recupera dettagli di un test set specifico con tutti i test
- search_test_sets: Cerca test sets usando JQL
- get_project_test_sets: Recupera tutti i test sets di un progetto
- add_tests_to_test_set: Aggiungi test a un test set esistente
- remove_tests_from_test_set: Rimuovi test da un test set
Prerequisiti
- Node.js 18 o superiore
- Credenziali API di Xray Cloud (Client ID e Client Secret)
Testing
This project includes comprehensive test coverage:
- Unit Tests: Fast tests with mocked API responses (no credentials needed)
- Integration Tests: End-to-end tests with real Xray Cloud API
# Run unit tests
npm run test:unit
# Run integration tests (requires credentials)
npm run test:integration
# Run all tests
npm test
For detailed testing documentation, see TESTING.md
Installazione
- Clona o scarica questo repository
- Installa le dipendenze:
npm install
- Compila il progetto:
npm run build
Come ottenere le credenziali API
- Vai su https://xray.cloud.getxray.app/
- Naviga in Settings → API Keys
- Clicca su Create API Key
- Copia il Client ID e il Client Secret generati
Utilizzo
Configurazione in Claude Code
Per usare questo server MCP con Claude Code, aggiungi la seguente configurazione al tuo file di configurazione MCP (solitamente ~/Library/Application Support/Claude/claude_desktop_config.json su macOS):
{
"mcpServers": {
"xray": {
"command": "node",
"args": ["/path/to/xray-mcp/dist/index.js"],
"env": {
"XRAY_CLIENT_ID": "your_client_id",
"XRAY_CLIENT_SECRET": "your_client_secret"
}
}
}
}
Importante: Sostituisci:
/path/to/xray-mcpcon il percorso assoluto del progetto (es./Users/manuel/repositories/xray-mcp)your_client_ideyour_client_secretcon le tue credenziali Xray Cloud
Test locale
Per testare il server in modalità di sviluppo:
# Imposta le variabili d'ambiente
export XRAY_CLIENT_ID="your_client_id"
export XRAY_CLIENT_SECRET="your_client_secret"
# Esegui il server
npm run dev
Esempi di utilizzo
Test Cases
Creare un test case
{
"projectKey": "ABC",
"summary": "Verify login functionality",
"description": "Test that users can log in with valid credentials",
"testType": "Manual",
"labels": ["login", "authentication"],
"priority": "High"
}
Cercare test cases
{
"jql": "project = ABC AND labels = automation",
"maxResults": 20
}
Recuperare test cases di un progetto
{
"projectKey": "ABC",
"maxResults": 50
}
Test Executions
Creare una test execution
{
"projectKey": "ABC",
"summary": "Sprint 23 Regression Tests",
"description": "Regression testing for sprint 23",
"testIssueIds": ["10001", "10002", "10003"],
"testEnvironments": ["Chrome", "Firefox"]
}
Recuperare una test execution
{
"testExecutionKey": "ABC-456"
}
Aggiornare lo stato di un test run
{
"testRunId": "5acc7ab0a3fe1b6fcdc3c737",
"status": "PASS"
}
Cercare test executions recenti
{
"jql": "project = ABC AND created >= -7d",
"maxResults": 20
}
Struttura del progetto
xray-mcp/
├── src/
│ ├── index.ts # Server MCP principale
│ └── xray-client.ts # Client per le API di Xray Cloud
├── dist/ # File compilati (generati dopo build)
├── .env.example # Template per le variabili d'ambiente
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md
API Xray Cloud
Questo server utilizza le seguenti API di Xray Cloud:
- Authentication:
POST /api/v1/authenticate(token valido 24 ore) - GraphQL Endpoint:
POST /api/v2/graphql- Test Queries:
getTests- Recupera test usando JQL - Test Mutations:
createTest,deleteTest- Crea/elimina test - Test Execution Queries:
getTestExecutions- Recupera executions usando JQL - Test Execution Mutations:
createTestExecution,updateTestRunStatus- Gestisce executions e risultati - Test Plan Queries:
getTestPlans- Recupera test plans usando JQL - Test Plan Mutations:
createTestPlan,addTestsToTestPlan,removeTestsFromTestPlan- Gestisce test plans - Test Set Queries:
getTestSets- Recupera test sets usando JQL - Test Set Mutations:
createTestSet,addTestsToTestSet,removeTestsFromTestSet- Gestisce test sets
- Test Queries:
Per la documentazione completa delle API, visita:
- GraphQL API: https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API
- Schema GraphQL: https://us.xray.cloud.getxray.app/doc/graphql/
- REST API: https://docs.getxray.app/display/XRAYCLOUD/REST+API
Sviluppo futuro
Funzionalità pianificate per future versioni:
- [x] Gestione Test Executions ✅ (implementato)
- [x] Gestione Test Plans e Test Sets ✅ (implementato)
- [ ] Gestione Test Steps (add/update/remove)
- [ ] Gestione Pre-conditions
- [ ] Integrazione con Test Repositories (folder management)
- [ ] Gestione Requirements e coverage tracking
- [ ] Bulk import/export di test results
Use Cases
Integrazione CI/CD
Usa questo server MCP per:
- Creare test executions automaticamente nelle pipeline CI/CD
- Aggiornare stati dei test runs in base ai risultati dei test automatici
- Tracciare l'esecuzione dei test attraverso diversi ambienti
- Generare report di test execution per sprint reviews
Test Management
Usa questo server MCP per:
- Creare e organizzare test cases
- Cercare test usando query JQL complesse
- Gestire test executions manuali
- Tracciare lo stato dei test nel tempo
Licenza
ISC
Supporto
Per problemi o domande sulle API di Xray Cloud, consulta la documentazione ufficiale:
- https://docs.getxray.app/
- https://support.getxray.app/
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。