文档生成器 RTFM
STDIO智能文档生成与管理的MCP服务器
智能文档生成与管理的MCP服务器
"RTFM!" they say, but what if there's no FM to R? 🤔 Enter MCP-RTFM: an MCP server that helps you create the F*ing Manual everyone keeps telling people to read! Using advanced content analysis, metadata generation, and intelligent search capabilities, it transforms your non-existent or unreadable docs into an interconnected knowledge base that actually answers those "basic questions" before they're asked.
Plot twist: Instead of just telling people to RTFM, now you can actually give them an FM worth R-ing! Because the best response to "read the f*ing manual" is having a manual that's actually worth reading. 📚✨
# 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 and enhance existing documentation with content analysis and metadataanalyze_project_with_metadata
- Initialize documentation structure with enhanced content analysis and metadata generationanalyze_project
- Basic initialization of documentation structureread_doc
- Read a documentation file (required before updating)update_doc
- Update documentation using diff-based changesget_doc_content
- Get current content of a documentation fileget_project_info
- Get project structure and documentation statussearch_docs
- Search across documentation files with highlighted resultsupdate_metadata
- Update documentation metadataget_related_docs
- Find related documentation based on metadata and content linkscustomize_template
- Create or update documentation templatesThe server automatically creates and manages these core documentation files:
techStack.md
- Detailed inventory of tools, libraries, and configurationscodebaseDetails.md
- Low-level explanations of code structure and logicworkflowDetails.md
- Step-by-step workflows for key processesintegrationGuides.md
- Instructions for external system connectionserrorHandling.md
- Troubleshooting strategies and practiceshandoff_notes.md
- Summary of key themes and next stepsBuilt-in templates for different documentation types:
Custom templates can be created using the customize_template
tool.
// 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 available
// 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 suggestions
// 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 } });
// 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" } });
// 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 matches
// 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"] } } });
Add to settings file at: Add to settings file at:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
~/.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": [] } } }
Add to config file at:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
{ "mcpServers": { "mcp-rtfm": { "command": "node", "args": ["<path-to-mcp-rtfm>/build/index.js"], "disabled": false, "alwaysAllow": [] } } }
Use [[document-name]]
syntax to create links between documents. The server automatically tracks these relationships and includes them when finding related documentation.
Documents are organized using:
The server uses advanced libraries for better documentation management:
unified/remark for Markdown processing:
minisearch for powerful search capabilities:
# Install dependencies npm install # Build the server npm run build # Development with auto-rebuild npm run watch
Since MCP servers communicate over stdio, debugging can be challenging. Use the MCP Inspector:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
MIT © Model Context Protocol