MCP-RTFM
「RTFM!」ってよく言われるけど、もしFMがRに繋がらなかったらどうなるの?🤔 MCP-RTFMの登場です。みんなが読むように言ってくるあの「クソマニュアル」の作成をサポートするMCPサーバーです!高度なコンテンツ分析、メタデータ生成、そしてインテリジェントな検索機能により、存在しない、あるいは読めないドキュメントを相互接続されたナレッジベースに変換し、質問される前に「基本的な質問」に答えます。
どんでん返し:ただ「RTFM」とだけ言うのではなく、実際に「R-」する価値のあるFMを提供できるようになりました!「クソマニュアルを読め」という要求に対する最良の対応は、実際に読む価値のあるマニュアルを提供することです。📚✨
📚 目次
Related MCP server: RAG Documentation MCP Server
🚀 クイックスタート
# Install dependencies
npm install
# Build the server
npm run build
# Add to your MCP settings and start using
await use_mcp_tool({
server: "mcp-rtfm",
tool: "analyze_project_with_metadata", // Enhanced initialization
args: { projectPath: "/path/to/project" }
});
// This will:
// 1. Create documentation structure
// 2. Analyze content with unified/remark
// 3. Generate intelligent metadata
// 4. Build search index with minisearch
// 5. Add structured front matter
// 6. Make your docs actually readable!✨ 特徴
ドキュメント管理ツール
analyze_existing_docs- コンテンツ分析とメタデータを使用して既存のドキュメントを分析および強化しますanalyze_project_with_metadata- 強化されたコンテンツ分析とメタデータ生成を使用してドキュメント構造を初期化しますanalyze_project- ドキュメント構造の基本的な初期化read_doc- ドキュメントファイルを読み取る(更新前に必要)update_doc- 差分ベースの変更を使用してドキュメントを更新するget_doc_content- ドキュメントファイルの現在のコンテンツを取得するget_project_info- プロジェクトの構造とドキュメントのステータスを取得するsearch_docs- ハイライト表示された結果でドキュメントファイル全体を検索するupdate_metadata- ドキュメントのメタデータを更新するget_related_docs- メタデータとコンテンツリンクに基づいて関連ドキュメントを検索するcustomize_template- ドキュメントテンプレートを作成または更新する
デフォルトのドキュメントファイル
サーバーは、次のコア ドキュメント ファイルを自動的に作成および管理します。
techStack.md- ツール、ライブラリ、構成の詳細なインベントリcodebaseDetails.md- コード構造とロジックの低レベルの説明workflowDetails.md- 主要プロセスのステップバイステップのワークフローintegrationGuides.md- 外部システム接続の手順errorHandling.md- トラブルシューティングの戦略と実践handoff_notes.md- 主要テーマと次のステップの要約
ドキュメントテンプレート
さまざまなドキュメント タイプ用の組み込みテンプレート:
標準ドキュメントテンプレート
APIドキュメントテンプレート
ワークフロードキュメントテンプレート
カスタム テンプレートは、 customize_templateツールを使用して作成できます。
📝 ワークフローの例
1. 既存のドキュメントの分析
// Enhance existing documentation with advanced analysis
await use_mcp_tool({
server: "mcp-rtfm",
tool: "analyze_existing_docs",
args: { projectPath: "/path/to/project" }
});
// This will:
// - Find all markdown files in .handoff_docs
// - Analyze content structure with unified/remark
// - Generate intelligent metadata
// - Build search index
// - Add front matter if not present
// - Establish document relationships
// - Preserve existing content
// The results include:
// - Enhanced metadata for all docs
// - Search index population
// - Content relationship mapping
// - Git context if available2. 強化されたプロジェクトドキュメント設定
// Initialize documentation with advanced content analysis
await use_mcp_tool({
server: "mcp-rtfm",
tool: "analyze_project_with_metadata",
args: { projectPath: "/path/to/project" }
});
// Results include:
// - Initialized documentation files
// - Generated metadata from content analysis
// - Established document relationships
// - Populated search index
// - Added structured front matter
// - Git repository context
// Get enhanced project information
const projectInfo = await use_mcp_tool({
server: "mcp-rtfm",
tool: "get_project_info",
args: { projectPath: "/path/to/project" }
});
// Search across documentation with intelligent results
const searchResults = await use_mcp_tool({
server: "mcp-rtfm",
tool: "search_docs",
args: {
projectPath: "/path/to/project",
query: "authentication"
}
});
// Results include:
// - Weighted matches (title matches prioritized)
// - Fuzzy search results
// - Full content context
// - Related document suggestions3. コンテンツリンクによるドキュメントの更新
// First read the document
await use_mcp_tool({
server: "mcp-rtfm",
tool: "read_doc",
args: {
projectPath: "/path/to/project",
docFile: "techStack.md"
}
});
// Update with content that links to other docs
await use_mcp_tool({
server: "mcp-rtfm",
tool: "update_doc",
args: {
projectPath: "/path/to/project",
docFile: "techStack.md",
searchContent: "[Why this domain is critical to the project]",
replaceContent: "The tech stack documentation provides essential context for development. See [[workflowDetails]] for implementation steps.",
continueToNext: true // Automatically move to next document
}
});4. ドキュメントメタデータの管理
// Update metadata for better organization
await use_mcp_tool({
server: "mcp-rtfm",
tool: "update_metadata",
args: {
projectPath: "/path/to/project",
docFile: "techStack.md",
metadata: {
title: "Technology Stack Overview",
category: "architecture",
tags: ["infrastructure", "dependencies", "configuration"]
}
}
});
// Find related documentation
const related = await use_mcp_tool({
server: "mcp-rtfm",
tool: "get_related_docs",
args: {
projectPath: "/path/to/project",
docFile: "techStack.md"
}
});5. コンテキストを考慮したドキュメントの検索
// Search with highlighted results
const results = await use_mcp_tool({
server: "mcp-rtfm",
tool: "search_docs",
args: {
projectPath: "/path/to/project",
query: "authentication"
}
});
// Results include:
// - File name
// - Line numbers
// - Highlighted matches
// - Context around matches6. カスタムテンプレートの作成
// Create a custom template for architecture decisions
await use_mcp_tool({
server: "mcp-rtfm",
tool: "customize_template",
args: {
templateName: "architecture-decision",
content: `# {title}
## Context
[Background and context for the decision]
## Decision
[The architecture decision made]
## Consequences
[Impact and trade-offs of the decision]
## Related Decisions
[Links to related architecture decisions]`,
metadata: {
category: "architecture",
tags: ["decision-record", "design"]
}
}
});🔧 インストール
VSCode(ルー・クライン)
設定ファイルに追加: 設定ファイルに追加:
Windows:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.jsonmacOS:
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.jsonLinux:
~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
{
"mcpServers": {
"mcp-rtfm": {
"command": "node",
"args": ["<path-to-mcp-rtfm>/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}クロードデスクトップ
次の設定ファイルに追加します:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonMacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-rtfm": {
"command": "node",
"args": ["<path-to-mcp-rtfm>/build/index.js"],
"disabled": false,
"alwaysAllow": []
}
}
}🎯 高度な機能
コンテンツリンク
ドキュメント間のリンクを作成するには、 [[document-name]]構文を使用します。サーバーはこれらの関係を自動的に追跡し、関連ドキュメントの検索時にリンクを含めます。
メタデータ駆動型組織
ドキュメントは以下を使用して整理されます:
カテゴリ(例:「アーキテクチャ」、「API」、「ワークフロー」)
柔軟なグループ化のためのタグ
共有メタデータに基づく自動関係検出
コンテンツリンク分析
強化されたコンテンツ分析
サーバーは、より優れたドキュメント管理のために高度なライブラリを使用します。
Markdown処理のためのunified/remark :
ASTベースのコンテンツ分析
正確な見出し構造検出
コードブロックとリンクの抽出
適切なMarkdownの解析と操作
強力な検索機能を備えたミニサーチ:
すべてのドキュメントにわたる高速あいまい検索
フィールド重み付け検索(タイトルに高い優先順位が付けられます)
完全なコンテンツとメタデータのインデックス作成
TTL管理による効率的なキャッシュ
リアルタイム検索インデックス更新
インテリジェントなメタデータ生成
分類のための自動コンテンツ分析
コンテンツパターンに基づいたスマートタグ生成
文書内の構造化された前付
ASTベースのタイトルとセクションの検出
コードスニペットの識別とタグ付け
コンテキストに応じた結果の提示
テンプレートシステム
一般的なドキュメントタイプ用の組み込みテンプレート
メタデータのデフォルトを使用したカスタム テンプレートのサポート
テンプレートの継承とオーバーライド機能
一貫したフォーマットのためのプレースホルダーシステム
🛠️ 開発
# Install dependencies
npm install
# Build the server
npm run build
# Development with auto-rebuild
npm run watch🐛 デバッグ
MCPサーバーはstdio経由で通信するため、デバッグが困難になる場合があります。MCPインスペクターを使用してください。
npm run inspectorインスペクターは、ブラウザでデバッグ ツールにアクセスするための URL を提供します。
📄 ライセンス
MIT ©モデルコンテキストプロトコル