karate-graph-mcp
🚀 Karate 기능 그래프 분석기
Karate 프레임워크 기능 파일을 분석하고 대화형 종속성 그래프를 생성하기 위한 강력한 MCP(Model Context Protocol) 도구입니다.
📋 목차
Related MCP server: GID MCP Server
✨ 기능
핵심 기능
🔍 기능 파일 파싱 - Gherkin 구문을 사용하여 Karate 기능 파일 파싱
🎯 종속성 분석 - 종속성(워크플로우, API, 페이지, DB) 추출 및 분석
📊 대화형 시각화 - 범례가 포함된 아름다운 HTML 그래프 생성
🎫 Jira 통합 - Jira 태그(@PROJ-123) 추출 및 추적
🔄 영향 분석 - 구성 요소 변경 시 영향을 받는 테스트 케이스 식별
📈 다중 프로젝트 지원 - 여러 프로젝트 관리 및 분석
💾 내보내기/가져오기 - 그래프를 JSON/GraphML 형식으로 내보내기
⚡ 성능 최적화 - 캐싱 및 인덱스를 통한 빠른 분석
시각화 기능
🎨 유형별 색상 구분 노드 (테스트, 워크플로우, API, 페이지, 데이터베이스)
🔍 메타데이터가 포함된 대화형 툴팁 (파일 경로, 줄 번호, Jira 태그)
🖱️ 클릭하여 강조 표시 - 연결 및 종속성 강조
📊 범례 - 우측 상단에 색상 및 모양 설명 표시
🔄 물리 시뮬레이션 - 자동 레이아웃
🎯 영향 보기 - 변경된 구성 요소 및 영향을 받는 테스트 강조
🚀 빠른 시작
1. 종속성 설치
pip install -e .
pip install pyvis # For visualization2. 데모 실행
# Set UTF-8 encoding (Windows)
$env:PYTHONIOENCODING="utf-8"
# Run large project demo
python test_large_project.py3. 결과 보기
cd output
start ecommerce-platform_full.html📦 설치
사전 요구 사항
Python 3.8 이상
pip 패키지 관리자
소스에서 설치
# 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/ -v종속성
핵심 종속성(자동 설치):
networkx- 그래프 작업hypothesis- 속성 기반 테스트pydantic- 데이터 유효성 검사
선택적 종속성:
pyvis- 대화형 시각화
💻 사용법
기본 사용법
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'])시각화
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"
)명령줄(스크립트 사용)
# 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)📁 프로젝트 구조
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📚 문서
핵심 문서
API 문서 - 모든 MCP 함수에 대한 전체 API 참조
Jira 태그 추출 - Jira 태그 추출 방법
분석 보고서 - 데모 프로젝트에 대한 상세 분석
출력 가이드 - 생성된 시각화 사용 방법
사양
🎯 예제
예제 1: 데모 프로젝트 분석
# Run demo
python test_large_project.py
# View results
cd output
start ecommerce-platform_full.html확인할 수 있는 내용:
84개 노드 (73개 테스트 케이스, 6개 워크플로우, 3개 페이지, 1개 API, 1개 DB)
26개 엣지 (종속성)
범례가 포함된 대화형 그래프
유형별 색상 구분
메타데이터가 포함된 호버 툴팁
예제 2: 영향 분석
# 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'])}")출력:
Changed: api_0001
Affected: 14 test cases
- Successful login (depth: 1)
Jira: @AUTH-101
- Get user profile (depth: 1)
Jira: @USER-101
...예제 3: 공통 구성 요소 찾기
# 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'])}")🧪 테스트
모든 테스트 실행
# 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=html테스트 통계
총 테스트: 306
통과: 306 (100%)
실패: 0
건너뜀: 1
커버리지: 포괄적
테스트 범주
단위 테스트 (tests/unit/) - 개별 구성 요소 테스트
통합 테스트 (tests/integration/) - 구성 요소 상호 작용 테스트
속성 테스트 (선택 사항) - Hypothesis를 사용한 속성 기반 테스트
🎨 시각화 가이드
범례 이해하기
시각화 HTML 파일을 열면 우측 상단에서 범례를 확인하세요:
📊 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/out대화형 기능
호버 - 노드 위에 마우스를 올리면 다음 정보가 포함된 툴팁이 표시됩니다:
노드 이름
노드 유형
파일 경로
줄 번호
Jira 태그
클릭 - 노드를 클릭하여 다음을 강조 표시합니다:
선택된 노드
연결된 모든 노드
연결된 모든 엣지
확대/축소 - 마우스 휠을 스크롤하여 확대/축소
팬 - 배경을 드래그하여 이동
위치 변경 - 노드를 드래그하여 레이아웃 재배치
🔧 구성
파서 구성
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
)📊 주요 지표
성능
분석 시간: 4개 파일 기준 1초 미만
쿼리 시간: 종속성 쿼리 기준 10ms 미만
영향 분석: 영향을 받는 6개 테스트 기준 50ms 미만
내보내기 시간: 9개 노드 기준 100ms 미만
시각화: 렌더링 1초 미만
확장성
테스트 환경: 84개 노드, 26개 엣지
지원: 1000개 이상의 노드 (예상)
메모리: 캐싱을 통한 효율적 관리
저장소: JSON 형식, 노드당 약 500바이트
🤝 기여
기여를 환영합니다! 다음 지침을 따라주세요:
포크(Fork) 저장소
기능 브랜치 생성 (
git checkout -b feature/amazing-feature)변경 사항 커밋 (
git commit -m 'Add amazing feature')브랜치 푸시 (
git push origin feature/amazing-feature)풀 리퀘스트 열기
개발 설정
# 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/📝 라이선스
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.
🙏 감사의 말
Karate Framework - 훌륭한 BDD 테스트 프레임워크 제공
NetworkX - 그래프 작업 제공
Pyvis - 대화형 시각화 제공
Hypothesis - 속성 기반 테스트 제공
📞 지원
문서
예제
문제 제기
문제가 발생하면:
문서를 확인하세요
예제를 검토하세요
GitHub에 이슈를 제기하세요
🎉 빠른 링크
사양 기반 개발(Spec-Driven Development)을 통해 ❤️로 제작됨
상태: ✅ 프로덕션 준비 완료 버전: 1.0.0 마지막 업데이트: 2026년 4월 30일
🚀 즐거운 분석 되세요!
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAnalyzes codebases to generate dependency graphs and architectural insights across multiple programming languages, helping developers understand code structure and validate against architectural rules.66119MIT
- AlicenseAqualityDmaintenanceEnables AI to analyze, query, and manage a graph-based representation of software architecture for impact analysis, dependency tracking, and design.20121AGPL 3.0
- FlicenseNot gradedqualityAmaintenanceEnables querying a Neo4j-based code graph for Python projects, providing tools for code structure, call graph, and test coverage analysis.1
- AlicenseNot gradedqualityDmaintenanceAnalyzes GitHub and local repositories to automatically generate visual architectural diagrams such as dependency graphs, class diagrams, and data flow diagrams.2MIT
Related MCP Connectors
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
IaC attack-path auditor: finds internet-to-crown-jewel chains in Terraform/CFN/K8s.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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