codeviewer-mcp
codeviewer-mcp
codeviewer-mcpは、ステートフルでASTを認識するコードレビューワークフローのためのTypeScript製MCPサーバーです。
STDIO経由で動作し、ローカルMCPサーバーを起動できるMCPクライアントおよびLLMハーネス向けに設計されています。
このサーバーが提供するもの
反復的な計画登録とコードチャンクレビューのためのMCPツール
SQLiteベースのレビューセッションと履歴
JS/TSソースツリーのためのASTインデックス作成/コンテキストローカライゼーション
プリフライトチェック(TypeScript診断 + セキュリティパターン検出)
判定、カテゴリ化されたフィードバック、オプションのパッチヒントを含む構造化されたレビュー出力
Related MCP server: lsp-intelligence
MCPツール
register_planreview_code_chunkcleanup_expired_sessionscleanup_sessionlist_sessionslist_indexing_errorslist_prompt_profilesget_prompt_profilehealth_check
前提条件
このMCPをインストールして正しく実行するには、以下の前提条件が必要です。
要件 | 必要な理由 |
Node.js 20+ | サーバーおよびMCP SDKのランタイム |
pnpm 9+ | 依存関係のインストールおよびビルドワークフロー |
Git | 自動インストールフローのためのリポジトリのクローン/更新 |
ネイティブビルドツールチェーン |
|
OSごとのネイティブビルドツールチェーン:
Windows: Visual Studio Build Tools 2022 (C++によるデスクトップ開発) + Python 3
macOS: Xcode Command Line Tools (
xcode-select --install)Linux (Debian/Ubuntu):
build-essential python3 make g++
ネイティブビルド環境がない場合、better-sqlite3のコンパイル中にpnpm installが失敗することがあります。
クイックスタート
git clone https://github.com/Master0fFate/codeviewer-mcp.git
cd codeviewer-mcp
pnpm install
pnpm build
pnpm start開発モード:
pnpm dev環境変数
変数 | 説明 | デフォルト |
| ASTインデックス作成およびパス包含チェックのためのプロジェクトルート | 現在の作業ディレクトリ |
| SQLiteデータベースのパス |
|
|
|
|
|
| 存在する場合は |
| セッションのTTL(時間単位、正の整数のみ) |
|
| 共有環境用のオプションのベアラートークン。設定されている場合、すべてのツール呼び出しに | 未設定 |
| プロセス開始時に期限切れセッションをクリーンアップするかどうか ( |
|
| ログレベル ( |
|
例:
MCP_PROJECT_PATH=/absolute/path/to/repo \
MCP_SESSION_TTL_HOURS=24 \
LOG_LEVEL=info \
node dist/index.jsMCP_AUTH_TOKENが設定されている場合の認証例:
{
"session_id": "11111111-1111-1111-1111-111111111111",
"plan_step": 1,
"target_file": "src/example.ts",
"code_chunk": "export const ok = true;",
"modification_type": "MODIFY",
"auth_token": "your-shared-secret"
}プロンプトプロファイルワークフロー(コンパートメント化されたプロンプト)
このMCPは、promptsフォルダーからのセッションレベルのプロンプトのコンパートメント化をサポートしています。
プロンプトファイルを
promptsディレクトリに*.mdとして追加します。プロファイルIDは拡張子を除いたファイル名です。
例:
prompts/cybersec.md->prompt_profile: "cybersec"
register_planとオプションのprompt_profileでセッションを開始します。選択されたプロファイルはセッションに保持され、そのセッション内のすべての
review_code_chunk呼び出しで再利用されます。review_code_chunkの出力には以下が含まれます:active_prompt_profileactive_prompt_titleactive_prompt_headings
ヘルパーツールを使用してください:
list_prompt_profilesで利用可能なプロファイルを確認します。get_prompt_profileでプロファイルのプロンプト内容全体を読み取ります。
専門化プロファイルを使用したregister_planペイロードの例:
{
"project_path": "/absolute/path/to/repo",
"prompt_profile": "cybersec",
"steps": [
"Review auth and secrets handling",
"Check unsafe execution paths"
]
}LLM自動インストールガイド
このセクションは、自律型LLMインストーラーおよびMCPハーネス向けに書かれています。
標準的なサーバー起動
node /absolute/path/to/codeviewer-mcp/dist/index.jsべき等なインストール/更新 (bash)
set -euo pipefail
INSTALL_ROOT="${HOME}/mcp-servers"
SERVER_DIR="${INSTALL_ROOT}/codeviewer-mcp"
mkdir -p "${INSTALL_ROOT}"
if [ ! -d "${SERVER_DIR}/.git" ]; then
git clone https://github.com/Master0fFate/codeviewer-mcp.git "${SERVER_DIR}"
else
git -C "${SERVER_DIR}" pull --ff-only
fi
cd "${SERVER_DIR}"
pnpm install
pnpm buildべき等なインストール/更新 (PowerShell)
$InstallRoot = Join-Path $HOME "mcp-servers"
$ServerDir = Join-Path $InstallRoot "codeviewer-mcp"
New-Item -ItemType Directory -Path $InstallRoot -Force | Out-Null
if (-not (Test-Path (Join-Path $ServerDir ".git"))) {
git clone https://github.com/Master0fFate/codeviewer-mcp.git $ServerDir
} else {
git -C $ServerDir pull --ff-only
}
Set-Location $ServerDir
pnpm install
pnpm buildハーネスのインストール (Claude Code, VS Code Copilot, OpenCode, 汎用MCP)
すべてのハーネスで同じSTDIO起動値を使用してください。
標準的なサーバーブロック:
{
"name": "codeviewer-mcp",
"transport": "stdio",
"command": "node",
"args": ["/absolute/path/to/codeviewer-mcp/dist/index.js"],
"env": {
"MCP_PROJECT_PATH": "/absolute/path/to/target/repo",
"MCP_REVIEWER_DB_PATH": "/absolute/path/to/target/repo/.codeviewer-mcp.sqlite",
"LOG_LEVEL": "info"
}
}Claude Code / Claude Desktop
Claude MCP設定を開きます。
mcpServersの下に、標準的なコマンド/引数/環境変数の値を使用してcodeviewer-mcpを追加します。Claudeを再起動します。
ツールが検出可能であることを確認します。
例:
{
"mcpServers": {
"codeviewer-mcp": {
"command": "node",
"args": ["/absolute/path/to/codeviewer-mcp/dist/index.js"],
"env": {
"MCP_PROJECT_PATH": "/absolute/path/to/repo"
}
}
}
}VS Code Copilot (MCP)
VS Code MCPサーバー管理を開きます(バージョンに応じてUIまたはJSON設定)。
codeviewer-mcpという名前のローカルSTDIO MCPサーバーを登録します。コマンドに
nodeを設定し、引数にビルド済みのdist/index.jsを指定し、MCP_PROJECT_PATHを設定します。拡張機能のバージョンで必要な場合は、VS Codeウィンドウをリロードします。
Copilot ChatのMCPツールリストでツールの検出を確認します。
お使いのバージョンがJSON設定をサポートしている場合は、標準的なサーバーブロックをMCP設定スキーマにマッピングしてください。
OpenCode
OpenCode MCP設定を開きます。
codeviewer-mcpという名前のローカルSTDIOサーバーを追加します。node+ ビルド済みのdist/index.jsを使用します。MCP_PROJECT_PATHおよびオプションのDB/ログ環境変数を設定します。OpenCodeを再起動し、ツールが表示されることを確認します。
汎用MCPクライアント
ローカルSTDIO MCPサーバーをサポートするすべてのクライアントは、上記の標準的なブロックを使用できます。 フィールド名が異なる場合は、同じ値をクライアントのスキーマにマッピングしてください。
検証チェックリスト
[ ] サーバーがプロセスエラーなしで起動する
[ ] クライアントがMCP接続の確立を報告する
[ ] ツールが表示される:
register_plan,review_code_chunk,cleanup_expired_sessions,cleanup_session,list_sessions,list_indexing_errors,list_prompt_profiles,get_prompt_profile,health_check[ ]
register_planが有効なsession_idを返す[ ]
review_code_chunkが構造化された判定出力を返す[ ]
health_checkが健全なデータベース/セッション状態を報告する
開発と検証
pnpm test
pnpm buildセキュリティに関する注意点
パス包含チェックにより、シンボリックリンクベースのエスケープを含め、設定されたプロジェクトルートからの脱出を防ぎます。
認証はオプション (
MCP_AUTH_TOKEN) であり、共有環境では有効にする必要があります。セッションは
MCP_SESSION_TTL_HOURSに基づいて自動的に期限切れになります。SQLiteはWALモードで構成され、外部キーが有効になっています。
リポジトリ構成
/src/index.ts- プロセスエントリポイントおよびSTDIOトランスポート/src/server.ts- MCPサーバーおよびツール登録/src/schemas.ts- Zodツールコントラクトスキーマ/src/state.ts- SQLite状態ストアおよびセッションライフサイクル/src/ast.ts- ASTインデックス作成およびコンテキストローカライゼーション/src/preflight.ts- 静的プリフライトチェック/src/reviewer.ts- レビュー決定および出力整形/src/logger.ts- 構造化ロギング/tests- Vitestテストスイート
ライセンス
GNU v3
This server cannot be installed
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
- AlicenseBqualityDmaintenanceA code review tool server based on Model Context Protocol (MCP), providing multi-dimensional code review and scoring functions.42Apache 2.0
- Alicense-qualityDmaintenanceMCP server providing 29 tools across 5 layers for semantic TypeScript/JavaScript code intelligence, enabling AI agents to find references, trace impacts, guard APIs, and explain errors without text-search false positives.281MIT
- FlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for automated refactoring of Java and TypeScript/JavaScript codebases.163
- AlicenseAqualityFmaintenanceA code review tool server based on Model Context Protocol (MCP) providing multi-dimensional code review and scoring.413MIT
Related MCP Connectors
Hosted MCP server for structured code review passes on human- and AI-written code. Free tier.
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
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/Master0fFate/codeviewer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server