GitLab UI Test Plan Generator
Fetches merge requests (including their diffs and changed files) from GitLab.com or self-hosted GitLab instances via a personal access token, analyzes the code changes, and turns them into UI test plans. Supports URLs for both MR and MR-diff views and handles SSL verification settings for internal instances.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
GitLab UI Test Plan Generator
An AI-powered MCP server that generates comprehensive UI test plans from GitLab merge requests using local Ollama AI models. Your code never leaves your machine.
ποΈ Project Structure
gitlab-testplan-generator/
βββ mcp-server/
β βββ src/gitlab_mcp/ # Main package
β β βββ server.py # MCP server with ui_test_plan_from_mr tool
β β βββ analyzer.py # GitLab MR analysis with AI
β β βββ test_planner.py # AI-powered test plan generation
β β βββ ai_service.py # Local Ollama AI integration
β β βββ models.py # Pydantic data models
β βββ examples/ # Usage examples
β β βββ demo_analysis.py # Demo script
β β βββ example_usage.py # Example usage patterns
β β βββ test_ollama.py # AI agent verification test
β βββ docs/ # Documentation
β βββ main.py # Entry point
β βββ requirements.txt # Dependencies
β βββ .env # Environment configuration
βββ venv/ # Virtual environmentRelated MCP server: GitLab MCP Server
π§ Features
π€ AI-Powered Analysis
Uses local Ollama AI models for intelligent code analysis
Analyzes GitLab merge requests to identify affected UI areas
Generates context-aware test scenarios based on code changes
Privacy-first: All analysis happens locally on your machine
π Comprehensive Test Plans
Generates UI-focused test scenarios with specific steps
Risk assessment for each test scenario (high/medium/low)
Expected results and acceptance criteria
Handles both positive and edge-case testing scenarios
π Seamless Integration
Direct integration with Cursor IDE via MCP protocol
Simple
@ui_test_plan_from_mrcommand usageWorks with GitLab.com and self-hosted GitLab instances
No external API calls - everything runs locally
π Quick Start
1. Prerequisites
Python 3.8+
Ollama installed and running
GitLab personal access token
Cursor IDE
2. Installation
# Navigate to the project
cd gitlab-testplan-generator
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
cd mcp-server
pip install -r requirements.txt3. Configuration
Set up your GitLab credentials in mcp-server/.env:
GITLAB_URL=https://gitlab.cee.redhat.com # Your GitLab instance
GITLAB_TOKEN=your-personal-access-token # GitLab PAT with api, read_repository scopes
GITLAB_SSL_VERIFY=false # For internal GitLab instances4. Install in Cursor
Add to your ~/.cursor/mcp.json:
{
"mcpServers": {
"gitlab-ui-test-plan-generator": {
"command": "/path/to/gitlab-testplan-generator/venv/bin/python",
"args": ["/path/to/gitlab-testplan-generator/mcp-server/main.py"],
"env": {
"GITLAB_URL": "https://gitlab.cee.redhat.com"
}
}
}
}
### 5. Start Ollama
```bash
# Install and start Ollama
ollama serve
# Pull the AI model (in another terminal)
ollama pull qwen2.5-coder:1.5b6. Verify AI Agent (Optional but Recommended)
# Navigate to examples directory
cd mcp-server/examples
# Run AI agent verification test
python test_ollama.pyThis test verifies:
β Ollama server status and version
β Required AI model availability
β AI generation capabilities
Expected output:
=== Ollama AI Agent Status Check ===
β
Ollama server is running (version: 0.9.6)
β
Required model 'qwen2.5-coder:1.5b' is available
β
AI generation successful!
π All tests passed! Your AI agent is running correctly on Ollama.Demo & Examples
# Verify AI agent is working correctly
python examples/test_ollama.py
# Run demo analysis (works offline without GitLab credentials)
python examples/demo_analysis.py
# Run with real GitLab connection
# (requires configured .env file)
python examples/demo_analysis.pyπ Available MCP Tool
ui_test_plan_from_mr
The main tool for generating UI test plans from GitLab merge requests.
Usage in Cursor:
@ui_test_plan_from_mr https://gitlab.cee.redhat.com/project/-/merge_requests/123What it does:
π Analyzes the merge request and extracts code changes
π€ Uses local AI to understand the impact of changes
π― Identifies affected UI areas and components
π Generates comprehensive test scenarios with specific steps
β οΈ Provides risk assessment for each scenario
π‘ Usage Examples
In Cursor:
@ui_test_plan_from_mr https://gitlab.cee.redhat.com/<project_name>/merge_requests/12345
@ui_test_plan_from_mr https://gitlab.cee.redhat.com/project/-/merge_requests/123/diffsExample Output:
The tool generates:
MR Title: [JIRA-ID]: MR title description
Affected Pages: Affected pages and components
Test Scenarios: 2-5 AI-generated scenarios
Risk Levels: High/Medium/Low for each scenario
Detailed Steps: Specific actions and expected results
AI Insights: Summary of changes and user impact
π§ Architecture
Core Components
CodeAnalyzer: Analyzes GitLab merge requests and calculates complexity/risk scoresUITestPlanGenerator: Creates comprehensive test plans based on change analysisMCP Server: Exposes functionality through the Model Context ProtocolModels: Pydantic data models for type safety and validation
Component Analysis
The system automatically identifies components based on file patterns:
Authentication:
/auth/,/login/,/user/filesDatabase:
.sql, migration files,/models/,/db/filesAPI:
/api/,/endpoints/,/routes/filesFrontend:
.js,.ts,.vue,.html,.cssfilesBackend:
.py,.java,.cpp,.gofilesConfiguration:
/config/,.env,.yaml,.jsonfilesSecurity:
/security/,/ssl/files
Risk Assessment
The server automatically assesses risk levels:
High Risk: Security files, database migrations, configuration files, complex changes (>100 lines)
Medium Risk: API files, service files, moderate complexity (50-100 lines)
Low Risk: Documentation, simple changes (<50 lines)
π Documentation
Setup Guide: Detailed setup instructions
Examples: Working code examples and verification scripts
π€ Contributing
Fork the repository
Create a feature branch:
git checkout -b feature-nameMake your changes and test manually
Verify AI agent functionality:
python examples/test_ollama.pyTest with real GitLab merge requests
Submit a pull request
Development Setup
# Install dependencies
pip install -r requirements.txt
# Verify setup
python examples/demo_analysis.pyπ License
MIT License - see LICENSE file for details.
π Troubleshooting
Common Issues
Import Errors: Make sure you've installed the package with
pip install -e .GitLab Connection: Verify your token has correct permissions and hasn't expired
MCP Installation: Ensure Cursor has MCP support enabled
Debug Mode
# Run with debug logging
export PYTHONPATH=src
python -m gitlab_mcp.server --log-level debugReady to start? Check out the Setup Guide for detailed instructions!
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
AI QA that runs your app in a browser on every pull request: projects, test targets, test cases.
No-code, AI-assisted UI testing: record new tests, run existing ones, and monitor the results.
Write, run and check natural-language browser tests of your web app from your AI assistant.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to review GitLab merge requests by fetching changes, analyzing diffs, adding comments, and managing approvals through the GitLab API. Supports complete merge request analysis, file-specific reviews, and version comparisons.124MIT
- FlicenseAqualityCmaintenanceConnects AI assistants to GitLab to interact with merge requests, reviews, discussions, pipelines, and test results through natural language queries. Supports viewing MR details, responding to comments, checking test summaries, and analyzing job logs.122-
- FlicenseNot gradedqualityNot gradedmaintenanceConnects AI assistants to GitLab projects, enabling natural language queries for merge requests, code reviews, test results, pipelines, and discussions. Supports viewing MR details, responding to comments, and analyzing CI/CD job logs.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitLab merge requests, review code changes, search projects, and create draft comments for code review workflows.ISC