karate-graph-mcp
Extracts and tracks Jira issue tags (e.g., @PROJ-123) from Karate feature files for traceability.
Click on "Install 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., "@karate-graph-mcpanalyze my Karate project and show the dependency graph"
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.
π Karate Feature Graph Analyzer
A powerful MCP (Model Context Protocol) tool for analyzing Karate Framework feature files and generating interactive dependency graphs.
π Table of Contents
β¨ Features
Core Capabilities
π Feature File Parsing - Parse Karate feature files with Gherkin syntax
π― Dependency Analysis - Extract and analyze dependencies (workflows, APIs, pages, DB)
π Interactive Visualization - Generate beautiful HTML graphs with legend
π« Jira Integration - Extract and track Jira tags (@PROJ-123)
π Impact Analysis - Identify affected test cases when components change
π Multi-Project Support - Manage and analyze multiple projects
πΎ Export/Import - Export graphs to JSON/GraphML formats
β‘ Performance Optimized - Fast analysis with caching and indices
Visualization Features
π¨ Color-coded nodes by type (Test, Workflow, API, Page, Database)
π Interactive tooltips with metadata (file path, line numbers, Jira tags)
π±οΈ Click to highlight connections and dependencies
π Legend in top-right corner explaining colors and shapes
π Physics simulation for automatic layout
π― Impact view highlighting changed components and affected tests
π Quick Start
1. Install Dependencies
pip install -e .
pip install pyvis # For visualization2. Run Demo
# Set UTF-8 encoding (Windows)
$env:PYTHONIOENCODING="utf-8"
# Run large project demo
python test_large_project.py3. View Results
cd output
start ecommerce-platform_full.htmlπ¦ Installation
Prerequisites
Python 3.8 or higher
pip package manager
Install from Source
# Clone repository
git clone <repository-url>
cd karate-feature-graph-analyzer
# Install dependencies
pip install -e .
# Install visualization library
pip install pyvis
# Verify installation
pytest tests/ -vDependencies
Core dependencies (auto-installed):
networkx- Graph operationshypothesis- Property-based testingpydantic- Data validation
Optional dependencies:
pyvis- Interactive visualizations
π» Usage
Basic Usage
from karate_graph_analyzer.mcp_interface.mcp_tool import KarateGraphAnalyzerTool
# Initialize tool
tool = KarateGraphAnalyzerTool()
# Register project
tool.register_project(
name="my-project",
root_path="/path/to/karate/project",
feature_file_patterns=["**/*.feature"]
)
# Analyze project
analysis = tool.analyze_project("my-project")
print(f"Found {analysis['statistics']['total_nodes']} nodes")
# Query dependencies
deps = tool.query_dependencies("tc_0001", transitive=True)
print(f"Found {deps['count']} dependencies")
# Impact analysis
impact = tool.impact_analysis("api_0001")
print(f"Affected: {impact['total_count']} test cases")
# Export graph
export = tool.export_graph("my-project", format="json")
with open("graph.json", "w") as f:
f.write(export['data'])Visualization
from karate_graph_analyzer.visualization.graph_visualizer import GraphVisualizer
# Get graph
graph = tool.graphs["my-project"]
# Create visualizer
visualizer = GraphVisualizer(graph)
# Render full graph
visualizer.render("output/graph.html", height="900px")
# Render impact view
visualizer.render_impact_view(
changed_component_id="api_0001",
affected_test_case_ids=["tc_0001", "tc_0002"],
output_path="output/impact.html"
)Command Line (via Script)
# Analyze large project
python test_large_project.py
# Output will be in output/ directory:
# - ecommerce-platform_full.html (full graph)
# - ecommerce-platform_impact.html (impact view)
# - ecommerce-platform_graph.json (graph data)
# - LARGE_PROJECT_ANALYSIS_REPORT.md (detailed report)π Project Structure
karate-feature-graph-analyzer/
βββ src/karate_graph_analyzer/
β βββ models.py # Data models
β βββ parser/ # Feature file parsing
β β βββ feature_parser.py
β βββ graph/ # Graph construction
β β βββ graph_builder.py
β βββ analyzer/ # Dependency analysis
β β βββ dependency_analyzer.py
β βββ mcp_interface/ # MCP protocol
β β βββ mcp_tool.py
β βββ storage/ # Project registry
β β βββ project_registry.py
β βββ cache/ # AST caching
β β βββ cache_manager.py
β βββ visualization/ # Graph visualization
β β βββ graph_visualizer.py
β βββ logging_config.py # Logging setup
β
βββ tests/
β βββ unit/ # 306 unit tests
β βββ integration/ # Integration tests
β βββ fixtures/ # Test data
β
βββ output/ # Generated files
β βββ ecommerce-platform_full.html
β βββ ecommerce-platform_impact.html
β βββ ecommerce-platform_graph.json
β βββ LARGE_PROJECT_ANALYSIS_REPORT.md
β βββ README.md
β
βββ test_project_demo/ # Small demo project
βββ test_project_large/ # Large demo project (e-commerce)
βββ examples/ # Usage examples
βββ docs/ # Documentation
β βββ API.md
β βββ jira_tag_extraction.md
β
βββ test_large_project.py # Demo script
βββ pyproject.toml # Project config
βββ pytest.ini # Test config
βββ README.md # This fileπ Documentation
Core Documentation
API Documentation - Complete API reference for all MCP functions
Jira Tag Extraction - How Jira tags are extracted
Analysis Report - Detailed analysis of demo project
Output Guide - How to use generated visualizations
Specifications
Requirements - Functional requirements
Design - Architecture and design
Tasks - Implementation tasks
π― Examples
Example 1: Analyze Demo Project
# Run demo
python test_large_project.py
# View results
cd output
start ecommerce-platform_full.htmlWhat you'll see:
84 nodes (73 test cases, 6 workflows, 3 pages, 1 API, 1 DB)
26 edges (dependencies)
Interactive graph with legend
Color-coded by type
Hover tooltips with metadata
Example 2: Impact Analysis
# Find what tests are affected by API change
impact = tool.impact_analysis("api_0001")
print(f"Changed: {impact['changed_component']}")
print(f"Affected: {impact['total_count']} test cases")
for tc in impact['affected_test_cases']:
print(f" - {tc['name']} (depth: {tc['depth']})")
if tc['jira_tags']:
print(f" Jira: {', '.join(tc['jira_tags'])}")Output:
Changed: api_0001
Affected: 14 test cases
- Successful login (depth: 1)
Jira: @AUTH-101
- Get user profile (depth: 1)
Jira: @USER-101
...Example 3: Find Common Components
# Find reusable components across projects
common = tool.find_common_components(["project1", "project2"])
for comp in common['components']:
print(f"{comp['component_type']}: {comp['identifier']}")
print(f" Used in {comp['usage_count']} projects")
print(f" Projects: {', '.join(comp['projects'])}")π§ͺ Testing
Run All Tests
# Run all tests
pytest tests/ -v
# Run specific test suite
pytest tests/unit/ -v
pytest tests/integration/ -v
# Run with coverage
pytest tests/ --cov=src/karate_graph_analyzer --cov-report=htmlTest Statistics
Total Tests: 306
Passing: 306 (100%)
Failed: 0
Skipped: 1
Coverage: Comprehensive
Test Categories
Unit Tests (tests/unit/) - Test individual components
Integration Tests (tests/integration/) - Test component interactions
Property Tests (optional) - Property-based testing with Hypothesis
π¨ Visualization Guide
Understanding the Legend
When you open a visualization HTML file, look at the top-right corner for the legend:
π Legend
ββββββββββββββββββββββββββββββββββ
π’ Test Case - Scenario hoαΊ·c test
π΅ Workflow - Reusable workflow
π API - API endpoint
π£ Page - Page object
π΄ Database - Database operation
ββββββββββββββββββββββββββββββββββ
π‘ Tip: Hover Δα» xem chi tiαΊΏt
π±οΈ Click Δα» highlight connections
π Scroll Δα» zoom in/outInteractive Features
Hover - Move mouse over node to see tooltip with:
Node name
Node type
File path
Line number
Jira tags
Click - Click node to highlight:
The selected node
All connected nodes
All connecting edges
Zoom - Scroll mouse wheel to zoom in/out
Pan - Drag background to move around
Reposition - Drag nodes to rearrange layout
π§ Configuration
Parser Configuration
from karate_graph_analyzer.models import ParserConfig
config = ParserConfig(
jira_tag_patterns=[
r'@[A-Z]+-\d+', # @PROJ-123
r'@[a-z]+-\d+', # @proj-123
r'@[A-Z]+_\d+', # @PROJ_123
],
workflow_directories=['workflows', 'common'],
page_object_directories=['pages', 'page-objects'],
variable_patterns=[r'\$\{(\w+)\}'],
api_extraction_rules={
'extract_from_variables': True,
'extract_from_strings': True,
}
)
# Use custom config
tool.register_project(
name="my-project",
root_path="/path/to/project",
parser_config=config
)π Key Metrics
Performance
Analysis Time: < 1 second for 4 files
Query Time: < 10ms for dependency queries
Impact Analysis: < 50ms for 6 affected tests
Export Time: < 100ms for 9 nodes
Visualization: < 1 second to render
Scalability
Tested with: 84 nodes, 26 edges
Supports: 1000+ nodes (estimated)
Memory: Efficient with caching
Storage: JSON format, ~500 bytes per node
π€ Contributing
Contributions are welcome! Please follow these guidelines:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Development Setup
# Clone your fork
git clone <your-fork-url>
cd karate-feature-graph-analyzer
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run linter
flake8 src/
# Format code
black src/π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Karate Framework - For the amazing BDD testing framework
NetworkX - For graph operations
Pyvis - For interactive visualizations
Hypothesis - For property-based testing
π Support
Documentation
Examples
Issues
If you encounter any issues:
Check the documentation
Review the examples
Open an issue on GitHub
π Quick Links
π API Docs - Complete API reference
π Analysis Report - Detailed analysis
π¨ Visualizations - Generated graphs
π§ͺ Tests - Test suite
π Specs - Requirements & design
Built with β€οΈ using Spec-Driven Development
Status: β
Production Ready
Version: 1.0.0
Last Updated: April 30, 2026
π Happy Analyzing!
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/duyngo91/karate-graph-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server