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形式、1ノードあたり約500バイト
🤝 貢献
貢献を歓迎します!以下のガイドラインに従ってください:
リポジトリをフォークする
フィーチャーブランチを作成する (
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でIssueをオープンする
🎉 クイックリンク
Spec-Driven Developmentを使用して❤️を込めて構築されました
ステータス: ✅ 本番環境対応 バージョン: 1.0.0 最終更新日: 2026年4月30日
🚀 Happy Analyzing!
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