karate-graph-mcp
Enables analysis of Karate framework feature files, extracting dependencies and generating interactive dependency graphs.
Ask AI about karate-graph-mcp
Powered by Claude Β· Grounded in docs
I know everything about karate-graph-mcp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π Karate Feature Graph Analyzer (MCP-Powered)
A powerful Model Context Protocol (MCP) tool designed for AI agents (Claude, Antigravity, Cursor) to analyze Karate Framework feature files, manage multi-project dependencies, and generate interactive graphs.
β¨ Why use this with AI?
Instead of running scripts manually, you can just chat with your codebase:
- π Impact Analysis: Ask AI "What happens if I change this API?" and see the exact lines affected.
- π Ecosystem View: Merge multiple projects into one global graph via chat.
- π Source Snippets: View relevant code snippets around dependencies directly in AI search results.
- π« Ticket tracking: Automatically link Jira tags to code components.
- π©Ί Health Check: Get AI-generated reports on cycles and redundant components.
π Quick Start
1. Installation
Option A: Standard (Requires Internet)
git clone <repository-url>
cd karate-feature-graph-analyzer
pip install -e .
Option B: Offline / Vendor Mode (No Internet Required)
If your environment blocks external downloads, use the pre-packaged libraries in python_libs:
git clone <repository-url>
cd karate-feature-graph-analyzer
# Install all dependencies from local vendor folder
pip install --no-index --find-links=python_libs -r requirements.txt
# Install the project in editable mode
pip install -e . --no-deps
2. Configure MCP Client
Add the following to your AI client configuration (e.g., claude_desktop_config.json):
{
"mcpServers": {
"karate-analyzer": {
"command": "python",
"args": ["C:/path/to/repo/src/karate_graph_analyzer/mcp_server.py"],
"env": {
"PYTHONPATH": "C:/path/to/repo/src",
"PYTHONIOENCODING": "utf-8"
}
}
}
}
[!IMPORTANT] Replace
C:/path/to/repowith the actual absolute path of this repository.
3. Start Analyzing via Chat
Once connected, just ask your AI:
- "Register the project at
E:/my-karate-fwand analyze it." - "Show me all test cases affected by a change in the
OrderManagementpage." - "Scan all my registered projects and give me a health summary."
π€ Available AI Tools
| Tool | AI Command Example |
|---|---|
register_project | "Register my project at [path] as 'Core-Service'" |
bulk_analyze | "Scan all my projects and find any issues" |
merge_projects | "Merge project A and B to see cross-project dependencies" |
impact_analysis | "Which tests break if I modify the @AddPayment scenario?" |
search_api | "Find all POST endpoints in the checkout domain" |
get_project_health | "Give me a health report for project X" |
export_graph | "Export the graph of project Y to JSON" |
π Visualizing Results
The analyzer generates interactive HTML graphs in the output/ directory using a standardized Visual Identity System:
-
Shapes & Meanings:
- β Test Case (Star): Main entry points / End-to-End scenarios.
- π¦ Workflow/Common (Square): Reusable logic blocks and service files.
- β¬’ API Group (Hexagon): Domain or path-based API groupings.
- β¬₯ API Endpoint (Diamond): Individual API calls.
- β¬ Page (Ellipse): UI Page Objects.
- π Action (Triangle): Specific UI interactions/locators.
- π’οΈ Database (Cylinder): Database feature files.
- βͺ Query (Dot): Specific DB query scenarios.
- π¦ Data (Box): External JSON/CSV data files.
-
Interactive Features:
- Focus Mode: Double-click any node to isolate its dependency chain.
- AI Insights: Click a node to see "Expert Analysis" and "Fix Suggestions" generated by AI.
- Status Coloring: Nodes turn π΄ Red (Failed), π’ Green (Passed), or π Orange (Modified in Diff) based on context.
π οΈ Advanced Usage (CLI)
If you still prefer the terminal, you can use the built-in scanners:
Scan a single project
python scan_project.py <path_to_project> <output_name>
Scan multiple projects at once
python scan_all_projects.py <path1> <path2> <parent_folder>
π Project Structure
karate-feature-graph-analyzer/
βββ src/karate_graph_analyzer/
β βββ mcp_server.py # MCP Server Entry Point
β βββ mcp_interface/ # MCP Tool Logic
β βββ parser/ # Karate/Gherkin Parser
β βββ graph/ # Graph Construction
β βββ visualization/ # HTML/Vis.js Generator
βββ python_libs/ # [NEW] Offline python dependencies (.whl)
βββ requirements.txt # Dependency list for installation
βββ output/ # Generated HTML/JSON files
βββ tests/ # 300+ Unit & Integration tests
π License
This project is licensed under the MIT License.
Built with β€οΈ for the Karate Community.
