Skip to main content
Glama
boranesn
by boranesn

devflow-mcp

AIアシスタントに高度なGitHub開発者ツール(PR分析、コードレビュー、チェンジログ生成、依存関係監査、コミット要約、リファクタリング提案)を提供する、プロダクションレディなModel Context Protocolサーバーです。

特徴

  • 6つのMCPツール:開発ワークフロー全体をカバー

  • ヒューリスティック分析:外部LLM呼び出しなし、高速かつ決定論的

  • OSV.dev統合:実際の脆弱性データ(npmおよびPyPI)を利用

  • LRUキャッシュ:TTL付きでGitHub API呼び出しを最小化

  • トークンバケットレートリミッター:GitHubの制限内に収めるための制御

  • Zero any:TypeScriptで厳密に型定義

  • ≥80%のテストカバレッジ:MSWでモックされたHTTPテスト

Related MCP server: GitHub MCP Agent Server

要件

  • Node.js 18以上

  • repoスコープを持つGitHubパーソナルアクセストークン

インストール

npm install -g devflow-mcp

またはnpxで直接実行:

npx devflow-mcp

またはクローンしてビルド:

git clone https://github.com/yourorg/devflow-mcp
cd devflow-mcp
npm install
npm run build

Claude Desktopの設定

claude_desktop_config.jsonに追加してください:

{
  "mcpServers": {
    "devflow": {
      "command": "npx",
      "args": ["devflow-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

設定ファイルの場所:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

ツール

analyze_pr

GitHubのプルリクエストを分析し、リスク、セキュリティ上の懸念、マージの準備状況を評価します。

パラメータ:

名前

型

必須

説明

owner

string

はい

リポジトリの所有者

repo

string

はい

リポジトリ名

pr_number

number

はい

プルリクエスト番号

focus

string[]

いいえ

分析対象を制限: security, performance, logic, style

戻り値: risk_score (0-100), risk_level, findings[], change_summary, merge_recommendation


review_code

コードスニペットをレビューし、品質、セキュリティ上の問題、改善の機会を評価します。

パラメータ:

名前

型

必須

説明

code

string

はい

レビュー対象のソースコード

language

string

はい

プログラミング言語

context

string

いいえ

コードの動作に関するオプションのコンテキスト

戻り値: overall_score (1-10), issues[] (重大度と修正案を含む), positive_observations[], refactor_priority


generate_changelog

コミット履歴から2つのGit参照間のチェンジログを生成します。

パラメータ:

名前

型

必須

説明

owner

string

はい

リポジトリの所有者

repo

string

はい

リポジトリ名

from_ref

string

はい

ベース参照 (タグ, SHA, ブランチ)

to_ref

string

はい

ターゲット参照

format

string

いいえ

markdown (デフォルト), json, plain

group_by

string

いいえ

type (デフォルト), author, date

include_authors

boolean

いいえ

作成者名を含める (デフォルト: true)

戻り値: changelog 文字列, commit_count, カテゴリごとの stats, breaking_changes[]


audit_dependencies

OSV脆弱性データベースに対してプロジェクトの依存関係を監査します。

パラメータ:

名前

型

必須

説明

owner

string

はい

リポジトリの所有者

repo

string

はい

リポジトリ名

ecosystem

string

はい

npm, pypi, または auto

severity_threshold

string

いいえ

報告する最小重大度: low (デフォルト), moderate, high, critical

戻り値: vulnerabilities[] (CVE ID、修正バージョン、修正コマンドを含む), audit_passed, 重大度ごとの stats, osv_query_timestamp


summarize_commits

ブランチの最近のコミットを要約し、人間が読める形式のダイジェストを作成します。

パラメータ:

名前

型

必須

説明

owner

string

はい

リポジトリの所有者

repo

string

はい

リポジトリ名

branch

string

いいえ

ブランチ名 (デフォルト: リポジトリのデフォルト)

since

string

いいえ

ISO日付または相対時間 (7d, 24h, 2w, 1m)

limit

number

いいえ

最大コミット数 (デフォルト: 50)

output_style

string

いいえ

digest (デフォルト), standup, detailed

戻り値: summary 文字列, categories (機能/修正/ドキュメント/リファクタリング/雑務/その他), authors[], commit_count


suggest_refactor

インパクトと労力の比率に基づいて、リファクタリングの機会を分析します。

パラメータ:

名前

型

必須

説明

code

string

はい

分析対象のソースコード

language

string

はい

プログラミング言語

goals

string[]

いいえ

重点項目: readability, performance, testability, maintainability

戻り値: suggestions[] (根拠と労力見積もりを含む), priority_order[], original_complexity_score


開発

# Install dependencies
npm install

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Type-check and build
npm run build

# Lint
npm run lint

# Format
npm run format

# Start the server (after build)
npm start

プロジェクト構造

src/
  index.ts              # Entry point
  server.ts             # MCP server registration
  tools/                # Tool handlers (one per tool)
  github/               # GitHub API clients
  lib/                  # Shared utilities
    cache.ts            # LRU cache with TTL
    rate-limiter.ts     # Token-bucket rate limiter
    commit-parser.ts    # Conventional commit parser
    diff-parser.ts      # Git diff parser
    risk-scorer.ts      # PR risk scoring heuristics
    errors.ts           # Typed MCP errors
  providers/
    osv.ts              # OSV.dev vulnerability API
tests/
  integration/          # Full MCP server tests via InMemoryTransport
  tools/                # Unit tests per tool handler
  lib/                  # Unit tests for utilities

テスト戦略

  • ユニットテスト: 各ツールハンドラーとライブラリをvi.mockでモック化

  • 統合テスト: InMemoryTransportを介したMCPクライアントとサーバー間のフルラウンドトリップ、MSWでHTTPをインターセプト

  • HTTPモック: MSW v2 (msw/node) — テスト中に実際のネットワーク呼び出しは行わない

  • カバレッジ: ≥80%のブランチカバレッジを必須 (npm run test:coverage)

貢献

  1. リポジトリをフォーク

  2. フィーチャーブランチを作成

  3. 新しい動作に対するテストを追加

  4. npm run build && npm run test:coverage && npm run lint がすべてパスすることを確認

  5. プルリクエストを作成

ライセンス

MIT

Related MCP Connectors

Related MCP Servers