
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
GitHub repository analyzer with Model Context Protocol (MCP) server for AI agents
ghrepo-mcp is a powerful tool that enables AI agents like Claude Code to efficiently analyze and reference public GitHub repositories. It clones repositories, generates structured summaries and dependency maps, and provides high-speed full-text search capabilities through DuckDB.
No installation required! Run directly with NPX:
npx ghrepo-mcp init github.com/owner/repo
npm install -g ghrepo-mcp
# Initialize latest version
npx ghrepo-mcp init github.com/expressjs/express
# Initialize specific version
npx ghrepo-mcp init github.com/expressjs/express@v4.18.0
# Simple search
npx ghrepo-mcp search "middleware" --repository github.com/expressjs/express
# Search with filters
npx ghrepo-mcp search "router" --file-type js --path "lib/**"
# Update to latest
npx ghrepo-mcp update github.com/expressjs/express
# Update to specific version
npx ghrepo-mcp update github.com/expressjs/express@v4.19.0
# Initialize repository
ghrepo-mcp init <github-url> [options]
# Update repository
ghrepo-mcp update <github-url> [options]
# Search code
ghrepo-mcp search <query> [options]
--repository <url> Filter by repository
--file-type <ext> Filter by file extension
--path <pattern> Filter by file path pattern
--case-sensitive Case-sensitive search
--output <format> Output format (json|text|pretty)
# View repository summary
ghrepo-mcp summary <github-url> [path]
# Get dependency information
ghrepo-mcp dependencies <github-url>
# Configuration management
ghrepo-mcp config <get|set|reset> [key] [value]
# Start MCP server
ghrepo-mcp serve [options]
--transport <type> Transport type (stdio|sse)
--port <number> Port for SSE transport (default: 3000)
# Clean up repositories
ghrepo-mcp clean [repository] [options]
--all Remove all repositories
--yes Skip confirmation
# Display version
ghrepo-mcp --version
# Show help
ghrepo-mcp --help
ghrepo-mcp can run as an MCP server, allowing AI agents to analyze repositories directly.
Create or edit your Claude Code MCP configuration file:
~/.config/claude-code/mcp.json%APPDATA%\claude-code\mcp.jsonAdd ghrepo-mcp server:
{
"mcpServers": {
"ghrepo-mcp": {
"command": "npx",
"args": [
"-y",
"ghrepo-mcp",
"serve",
"--transport",
"stdio"
],
"env": {
"GHREPO_STORAGE_PATH": "${HOME}/.ghrepo-mcp",
"GHREPO_LOG_LEVEL": "info"
}
}
}
}
Restart Claude Code
The ghrepo-mcp server will now be available to Claude!
init_repository: Initialize and analyze a GitHub repositoryupdate_repository: Update repository to latest or specific versionsearch_code: Search code across analyzed repositoriesget_summary: Get implementation summary for files or directoriesget_dependencies: Get dependency mapping for a repositorysummary://github.com/owner/repo/path/to/file: File summariesmapping://github.com/owner/repo: Dependency mapsmetadata://github.com/owner/repo: Repository metadataFor detailed integration instructions, see Integration Guide.
ghrepo-mcp can be configured via environment variables:
| Variable | Description | Default |
|---|---|---|
GHREPO_STORAGE_PATH | Storage directory for repositories and database | ~/.ghrepo-mcp |
GHREPO_DB_PATH | DuckDB database path | ${STORAGE_PATH}/ghrepo.db |
GHREPO_LOG_LEVEL | Logging level (debug, info, warn, error) | info |
GHREPO_DUCKDB_MEMORY_LIMIT | DuckDB memory limit | 1GB |
┌─────────────────────────────────────────────────────────┐
│ CLI / MCP Server │
├─────────────────────────────────────────────────────────┤
│ Repository Manager │ Code Analyzer │ Search Engine │
├─────────────────────────────────────────────────────────┤
│ Git Client │ Tree-sitter Parser │
├─────────────────────────────────────────────────────────┤
│ DuckDB (FTS + Storage) │
└─────────────────────────────────────────────────────────┘
# Clone repository
git clone https://github.com/timakin/ghrepo-mcp.git
cd ghrepo-mcp
# Install dependencies
npm install
# Build project
npm run build
# Run tests
npm test
# Watch tests
npm run test:watch
# Type checking
npm run typecheck
# Linting
npm run lint
# Formatting
npm run format
ghrepo-mcp/
├── src/
│ ├── cli/ # CLI commands
│ ├── mcp/ # MCP server implementation
│ ├── git/ # Git operations
│ ├── analysis/ # Code analysis with tree-sitter
│ ├── search/ # Search engine
│ ├── database/ # DuckDB integration
│ ├── monitoring/ # Health checks and metrics
│ └── __tests__/ # Test files
├── docs/ # Documentation
├── mcp-config.example.json # Example MCP configuration
└── package.json
To publish this package to NPM (for maintainers):
# 1. Ensure all tests pass
npm test
# 2. Build the project
npm run build
# 3. Update version (choose one)
npm version patch # Bug fixes (1.0.0 -> 1.0.1)
npm version minor # New features (1.0.0 -> 1.1.0)
npm version major # Breaking changes (1.0.0 -> 2.0.0)
# 4. Publish to NPM
npm publish
# 5. Push changes and tags to GitHub
git push && git push --tags
Important Notes:
dist/ directory is included in the NPM package (see .npmignore)npm loginnpm pack --dry-runContributions are welcome! Please follow these steps:
git checkout -b feature/amazing-feature)git commit -m 'feat: add amazing feature')git push origin feature/amazing-feature)Common issues and solutions are documented in the Troubleshooting Guide.
MIT © Seiji Takahashi
ghrepo-mcpは、AIエージェント(Claude Codeなど)が公開GitHubリポジトリを効率的に分析・参照できるようにするツールです。リポジトリをクローンし、構造化されたサマリーや依存関係マップを生成し、DuckDBによる高速全文検索機能を提供します。
インストール不要!NPXで直接実行:
npx ghrepo-mcp init github.com/owner/repo
npm install -g ghrepo-mcp
# 最新版を初期化
npx ghrepo-mcp init github.com/expressjs/express
# 特定バージョンを初期化
npx ghrepo-mcp init github.com/expressjs/express@v4.18.0
# シンプルな検索
npx ghrepo-mcp search "middleware" --repository github.com/expressjs/express
# フィルター付き検索
npx ghrepo-mcp search "router" --file-type js --path "lib/**"
# 最新版に更新
npx ghrepo-mcp update github.com/expressjs/express
# 特定バージョンに更新
npx ghrepo-mcp update github.com/expressjs/express@v4.19.0
# リポジトリの初期化
ghrepo-mcp init <github-url> [オプション]
# リポジトリの更新
ghrepo-mcp update <github-url> [オプション]
# コード検索
ghrepo-mcp search <クエリ> [オプション]
--repository <url> リポジトリでフィルター
--file-type <拡張子> ファイル拡張子でフィルター
--path <パターン> ファイルパスパターンでフィルター
--case-sensitive 大文字小文字を区別
--output <形式> 出力形式 (json|text|pretty)
# リポジトリサマリーを表示
ghrepo-mcp summary <github-url> [パス]
# 依存関係情報を取得
ghrepo-mcp dependencies <github-url>
# 設定管理
ghrepo-mcp config <get|set|reset> [キー] [値]
# MCPサーバーを起動
ghrepo-mcp serve [オプション]
--transport <タイプ> トランスポートタイプ (stdio|sse)
--port <番号> SSEトランスポートのポート (デフォルト: 3000)
# リポジトリのクリーンアップ
ghrepo-mcp clean [リポジトリ] [オプション]
--all 全リポジトリを削除
--yes 確認をスキップ
# バージョン表示
ghrepo-mcp --version
# ヘルプ表示
ghrepo-mcp --help
ghrepo-mcpはMCPサーバーとして実行でき、AIエージェントが直接リポジトリを分析できます。
Claude CodeのMCP設定ファイルを作成または編集:
~/.config/claude-code/mcp.json%APPDATA%\claude-code\mcp.jsonghrepo-mcpサーバーを追加:
{
"mcpServers": {
"ghrepo-mcp": {
"command": "npx",
"args": [
"-y",
"ghrepo-mcp",
"serve",
"--transport",
"stdio"
],
"env": {
"GHREPO_STORAGE_PATH": "${HOME}/.ghrepo-mcp",
"GHREPO_LOG_LEVEL": "info"
}
}
}
}
Claude Codeを再起動
ghrepo-mcpサーバーがClaudeで利用可能になります!
init_repository: GitHubリポジトリを初期化・分析update_repository: リポジトリを最新版または特定バージョンに更新search_code: 分析済みリポジトリ全体でコード検索get_summary: ファイルやディレクトリの実装サマリーを取得get_dependencies: リポジトリの依存関係マッピングを取得summary://github.com/owner/repo/path/to/file: ファイルサマリーmapping://github.com/owner/repo: 依存関係マップmetadata://github.com/owner/repo: リポジトリメタデータ詳細な統合手順は統合ガイドを参照してください。
環境変数で設定可能:
| 変数 | 説明 | デフォルト |
|---|---|---|
GHREPO_STORAGE_PATH | リポジトリとデータベースの保存ディレクトリ | ~/.ghrepo-mcp |
GHREPO_DB_PATH | DuckDBデータベースパス | ${STORAGE_PATH}/ghrepo.db |
GHREPO_LOG_LEVEL | ログレベル (debug, info, warn, error) | info |
GHREPO_DUCKDB_MEMORY_LIMIT | DuckDBメモリ制限 | 1GB |
# リポジトリをクローン
git clone https://github.com/timakin/ghrepo-mcp.git
cd ghrepo-mcp
# 依存関係をインストール
npm install
# プロジェクトをビルド
npm run build
# テストを実行
npm test
# テストを監視
npm run test:watch
# 型チェック
npm run typecheck
# リント
npm run lint
# フォーマット
npm run format
NPMにパッケージを公開する手順(メンテナー向け):
# 1. 全テストが通ることを確認
npm test
# 2. プロジェクトをビルド
npm run build
# 3. バージョンを更新(いずれかを選択)
npm version patch # バグ修正 (1.0.0 -> 1.0.1)
npm version minor # 新機能 (1.0.0 -> 1.1.0)
npm version major # 破壊的変更 (1.0.0 -> 2.0.0)
# 4. NPMに公開
npm publish
# 5. 変更とタグをGitHubにプッシュ
git push && git push --tags
重要な注意事項:
dist/ ディレクトリはNPMパッケージに含まれます(.npmignore参照)npm loginnpm pack --dry-runコントリビューションを歓迎します!以下の手順に従ってください:
git checkout -b feature/amazing-feature)git commit -m 'feat: add amazing feature')git push origin feature/amazing-feature)よくある問題と解決策はトラブルシューティングガイドに記載されています。
MIT © Seiji Takahashi
FAQs
GitHub repository analyzer with MCP server for AI agents
We found that ghrepo-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.