product-x-mcp
v1.0.0
Published
X-MCP is a Model Context Protocol (MCP) server that provides comprehensive test case management capabilities for the Product-X Test Management System. It allows you to manage test cases, modules, components, and subcomponents directly from Cursor, VS Code
Readme
X-MCP: Product-X Test Management MCP Server
X-MCP is a Model Context Protocol (MCP) server that provides comprehensive test case management capabilities for the Product-X Test Management System. It allows you to manage test cases, modules, components, and subcomponents directly from Cursor, VS Code, or any MCP-compatible client.
Features
- Module Management: Create, update, delete, and list modules, components, and subcomponents
- Test Case Management: Full CRUD operations for test cases
- Test Case Operations: Clone, move, and bulk create test cases
- Export/Import: Export test cases to Excel and import from Excel files
- Permission-Aware: Respects the same permissions as the web application
- Session-Based Auth: Works with your existing application session
Installation
Prerequisites
- Node.js 18.0.0 or higher
- Access to a Product-X Test Management System instance
- Valid user credentials for the system
Install from npm (when published)
npm install -g @product-x/x-mcpInstall from source
git clone <repository-url>
cd x-mcp
npm install
npm run buildConfiguration
X-MCP requires configuration via environment variables or a .env file.
Required Configuration
# API Base URL (required)
X_MCP_API_URL=http://localhost:3000/api
# Project ID (required for most operations)
X_MCP_PROJECT_ID=your-project-id-hereAuthentication Options
You can authenticate using one of the following methods:
Option 1: Username/Password Login (Recommended)
Login directly with your email and password. The MCP server will create its own session:
[email protected]
X_MCP_PASSWORD=your-passwordNote: The MCP server will automatically log in when it starts if these credentials are provided.
Option 2: Session Token
If you're already logged into the web application, you can extract your session token from the browser cookies:
X_MCP_SESSION_TOKEN=your-session-token-hereTo get your session token:
- Log into the web application
- Open browser DevTools (F12)
- Go to Application/Storage > Cookies
- Copy the
tokencookie value
Option 3: API Key (if supported)
X_MCP_API_KEY=your-api-key-hereComplete Example .env file
# API Configuration
X_MCP_API_URL=http://localhost:3000/api
X_MCP_PROJECT_ID=123e4567-e89b-12d3-a456-426614174000
# Authentication (choose one)
# Option 1: Username/Password (Recommended)
[email protected]
X_MCP_PASSWORD=your-password
# Option 2: Session Token
# X_MCP_SESSION_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
# Option 3: API Key
# X_MCP_API_KEY=your-api-key-hereUsage with Cursor
- Open Cursor settings
- Navigate to MCP settings
- Add the following configuration:
{
"mcpServers": {
"x-mcp": {
"command": "npx",
"args": ["-y", "@product-x/x-mcp"],
"env": {
"X_MCP_API_URL": "http://localhost:3000/api",
"X_MCP_PROJECT_ID": "your-project-id",
"X_MCP_SESSION_TOKEN": "your-session-token"
}
}
}
}Usage with VS Code
- Install the MCP extension for VS Code
- Configure the MCP server in your VS Code settings:
{
"mcp.servers": {
"x-mcp": {
"command": "npx",
"args": ["-y", "@product-x/x-mcp"],
"env": {
"X_MCP_API_URL": "http://localhost:3000/api",
"X_MCP_PROJECT_ID": "your-project-id",
"X_MCP_EMAIL": "[email protected]",
"X_MCP_PASSWORD": "your-password"
}
}
}
}Available Tools
Authentication Tools
login- Login to the system using email and password. Creates a session for all subsequent requests.check_auth_status- Check if the MCP server is currently authenticated.
Module Tools
list_modules- List all modules, components, and subcomponentscreate_module- Create a new module, component, or subcomponentupdate_module- Update an existing moduledelete_module- Delete a module and all its childrenget_module- Get detailed information about a module
Test Case Tools
list_test_cases- List test cases with optional filteringget_test_case- Get detailed information about a test casecreate_test_case- Create a new test caseupdate_test_case- Update an existing test casedelete_test_case- Delete a test caseclone_test_case- Clone one or more test casesmove_test_case- Move a test case to a different modulebulk_create_test_cases- Create multiple test cases at once
Export/Import Tools
export_test_cases- Export test cases to Excelimport_test_cases- Import test cases from Excelget_export_template- Get an empty Excel template
Examples
Create a Module
{
"name": "create_module",
"arguments": {
"name": "Authentication Module",
"context": "Module for authentication-related test cases"
}
}Create a Test Case
{
"name": "create_test_case",
"arguments": {
"title": "Verify user login with valid credentials",
"description": "Test that a user can log in with valid email and password",
"moduleId": "module-id-here",
"type": "Functional Test",
"status": "New",
"priority": "High",
"estimatedDuration": 15
}
}Clone Test Cases
{
"name": "clone_test_case",
"arguments": {
"testCaseIds": ["test-case-id-1", "test-case-id-2"],
"targetModuleId": "target-module-id"
}
}Export Test Cases
{
"name": "export_test_cases",
"arguments": {
"outputPath": "/path/to/export.xlsx",
"moduleId": "module-id-here"
}
}Permissions
X-MCP respects the same permission system as the web application. Users can only perform actions they have permission for. If you receive a 403 Forbidden error, check your user permissions in the web application.
Troubleshooting
Authentication Errors
- 401 Unauthorized: Check your
X_MCP_SESSION_TOKENorX_MCP_API_KEY - 403 Forbidden: You don't have permission for this action. Check your user role and permissions.
Connection Errors
- Network error: Verify that
X_MCP_API_URLis correct and the server is accessible - Timeout: The server might be slow. Try increasing the timeout in the API client.
Project ID Errors
- Make sure
X_MCP_PROJECT_IDis set correctly - You can also provide
projectIdas an argument to individual tool calls
Development
Building from Source
npm install
npm run buildRunning in Development Mode
npm run devTesting
npm testLicense
MIT
Support
For issues and questions, please contact the Product-X team or open an issue in the repository.
