ReviewMCP
Enables automatic validation and correction of Re:VIEW manuscript files by checking for unauthorized tags, fixing duplicate/empty IDs, and running fast lint checks to prevent common errors during writing.
README
review-mcp-min(Re:VIEW用 最小MCPサーバー)
目的: 執筆の手を止めずに、Re:VIEW原稿のエラーを未然に防ぐ。
- 保存時に 許可外タグをブロック(“勝手なタグ定義”を禁止)
- ID(空/重複)を自動修正(人間可読な命名でユニーク化)
- 迅速な Lint(
review-compile --target=latex)で代表的な落とし穴を検出 - Re:VIEW 5.8 / 2.5(ReviewStarter) の両環境に将来的に対応可能(本雛形は5.8を前提に構成)
プロジェクトルート(cwd)の指定について
MCPサーバーの各ツール呼び出しでは cwd を指定します。
これは「Re:VIEWプロジェクトのルートディレクトリ」のことです。
典型的な構成例:
mybook/ ← ここが cwd
├── config.yml ← 必須
├── catalog.yml ← 必須
├── ch01.re
├── ch02.re
├── images/
└── ...
つまり、config.yml と catalog.yml があるディレクトリを cwd として渡してください。
MCPツール呼び出し例
補足: 普段からプロジェクト直下に移動して作業する場合
もし常に cd mybook/ のように プロジェクトルートで作業しているなら、
--cwd . を指定するだけで十分です。
例:
cd ~/books/mybook
node tools/review-mcp/scripts/ci-lint.mjs --cwd .
将来的には --cwd を省略しても process.cwd() を自動で使う仕様に拡張可能です。
{
"tool": "review.lint",
"args": { "cwd": "/Users/daisuke/books/mybook" }
}
CLIから直接呼ぶ場合
# 診断のみ
node tools/review-mcp/scripts/ci-lint.mjs --cwd /Users/daisuke/books/mybook
# ID自動修正も適用
node tools/review-mcp/scripts/ci-lint.mjs --cwd /Users/daisuke/books/mybook --apply-ids
ポイント:
cwdに渡すのは必ず「プロジェクトのトップディレクトリ」です。
その直下にconfig.ymlとcatalog.ymlが存在していなければいけません。
同梱ツール(MVP)
review.version— Re:VIEW CLI バージョン取得review.tags.list— 内蔵の保守的Allowlist(後で動的プローブに置換予定)review.enforceTags.check— 許可外タグの検出(保存ブロック用)review.fixIds.plan/review.fixIds.apply— IDの空欄/重複の自動修正review.lint— 高速Lint(各.reを latex 変換に通して stderr を解析)
展開方法(2つの配布形態)
A. リリースZIPとして展開(単体配布)
- 本リポジトリのリリースで配布する
review-mcp-min.zipを展開 npm inpm run startで MCP サーバー起動- ClaudeCode から MCP サーバーに接続し、ツール呼び出し時の引数
cwdに Re:VIEWプロジェクトのルートを指定します。
B. Git サブモジュール運用
- GitHub 上に本サーバー(独立リポジトリ)を作成(例:
your-org/review-mcp) - 各 Re:VIEW プロジェクトでサブモジュールとして追加:
git submodule add git@github.com:your-org/review-mcp.git tools/review-mcp git submodule update --init --recursive - 実行:
cd tools/review-mcp npm i npm run start - ClaudeCode 側からは
cwdを プロジェクトルートに指定してツールを呼び出してください。
保存時の推奨フロー
review.enforceTags.check— 許可外タグがあれば保存を中断review.fixIds.plan→review.fixIds.apply— ID を自動修正(.bakを残す)review.lint— 代表的な注意点(例://' seen but is not valid command、duplicate ID)を警告表示
CI / Rake 連携(ヘッドレス実行)
scripts/ci-lint.mjs
- MCP クライアント不要のヘッドレス検査スクリプトです。
- 機能:許可外タグ検出、ID自動修正の計画/適用、快速Lint。
使い方:
# 診断のみ(プロジェクトルートで)
node tools/review-mcp/scripts/ci-lint.mjs --cwd .
# ID自動修正も適用
node tools/review-mcp/scripts/ci-lint.mjs --cwd . --apply-ids
設定ファイル(任意) review-mcp.json
{
"profile": "dual",
"target": "latex",
"blockOnUnknownTags": true,
"autoFixIdsOnSave": true
}
よくある質問
Q. MCPサーバーはプロジェクト直下に置くべき?
- どちらでもOKです。別ディレクトリで独立運用しても、サブディレクトリに同梱しても動作します。
- 重要なのは、ツール引数
cwdを Re:VIEWプロジェクトのルートにすること。
Q. 2.5(ReviewStarter) との両対応は?
- 本雛形では 保守的Allowlist によるガードのみ提供しています。
- 将来的に
review.tags.listを 動的プローブ+キャッシュに差し替え、5.8/2.5 双方で“実際に通るタグ”集合を確定させます。 profile: "dual"(共通集合のみ許可)で“どちらにも通る原稿”を担保する運用を想定。
セットアップ(ClaudeCode / Claude Desktop 側)
MCPサーバーを利用するには、ClaudeCode や Claude Desktop 側で「サーバー登録」が必要です。
方法A: Claude Desktop の設定ファイルに追記
-
mac の場合、
~/Library/Application Support/Claude/claude_desktop_config.jsonを開きます。
(アプリのDeveloper Settings → Edit Configからも編集可能) -
"mcpServers"に以下のように追加してください(絶対パスに置き換え必須):
{
"mcpServers": {
"review-mcp": {
"command": "node",
"args": [
"/Users/あなたのユーザー名/books/mybook/tools/review-mcp/node_modules/.bin/tsx",
"/Users/あなたのユーザー名/books/mybook/tools/review-mcp/src/index.ts"
]
}
}
}
- Claude Desktop を再起動すると、ツール一覧に
review-mcpが表示されます。
ログは~/Library/Logs/Claude/mcp*.logで確認可能です。
方法B: ClaudeCode (VS Code拡張) でCLI追加
VS Code の「Claude Code」拡張を使用している場合、以下のコマンドで追加できます:
cd ~/books/mybook
claude mcp add review-mcp -s project -- node ./tools/review-mcp/node_modules/.bin/tsx ./tools/review-mcp/src/index.ts
-sはスコープを指定します(project/local/user)。
まずはlocalで試してから、安定したらprojectに切り替えるのが安全です。
開発メモ
src/index.tsのreview.tags.listを差し替えて、動的プローブ(review-compileにダミー原稿を通して合否判定)+cache/保持を実装してください。cache/は.gitignore推奨(配布時は空にしてOK)。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.