### Quick Start: Install and Initialize MCP-RTFM (Bash) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md This snippet demonstrates how to install dependencies, build the MCP-RTFM server using npm, and initialize project documentation with the analyze_project_with_metadata tool. It requires Node.js and npm for dependencies. Inputs include the project path; outputs are a generated documentation structure with metadata and search index. ```bash # 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! ``` -------------------------------- ### Build and Install MCP RTFM Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Commands to build and install the MCP RTFM project. Includes steps for initial installation, building the project, and enabling development with auto-rebuilding. ```bash # Build and install npm install npm run build # Development with auto-rebuild npm run watch # Debug with MCP Inspector npm run inspector ``` -------------------------------- ### get_project_info - Retrieve Project Context Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Gets comprehensive project information including git context, package details, directory structure, and documentation status. ```APIDOC ## GET /get_project_info ### Description Retrieves comprehensive project information, including Git context, package details, project structure, and documentation status. ### Method GET ### Endpoint `/get_project_info` ### Parameters #### Query Parameters - **projectPath** (string) - Required - The path to the project directory. ### Request Example ```json { "projectPath": "/home/user/my-project" } ``` ### Response #### Success Response (200) - **gitInfo** (object) - Git repository information. - **packageInfo** (object) - Package details. - **projectStructure** (object) - The directory structure of the project. - **docsStatus** (object) - Status of documentation files. #### Response Example ```json { "gitInfo": { "remoteUrl": "https://github.com/user/project.git", "branch": "main", "lastCommit": "abc123def456..." }, "packageInfo": { "name": "my-project", "version": "1.0.0", "dependencies": { ... } }, "projectStructure": { "src": { "index.ts": null, "utils": { ... } }, "tests": { ... } }, "docsStatus": { "completed": ["techStack.md", "codebaseDetails.md"], "current": "workflowDetails.md", "inProgress": true, "lastRead": "workflowDetails.md", "remaining": ["integrationGuides.md", "errorHandling.md", "handoff_notes.md"] } } ``` ``` -------------------------------- ### Analyze Existing Documentation (TypeScript) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md This TypeScript example shows how to use the analyze_existing_docs MCP tool to enhance existing documentation with content analysis, metadata generation, and search indexing. It depends on the MCP-RTFM server being set up. Inputs are the project path; outputs include enhanced docs with relationships and preserved content. Limitations include requiring markdown files in .handoff_docs. ```typescript // 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 ``` -------------------------------- ### Create Custom Documentation Templates (TypeScript) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md Shows how to create custom documentation templates using the 'customize_template' tool. This example defines a template for 'architecture-decision' records, including placeholders for title, context, decision, consequences, and related decisions, along with associated metadata for categorization and tagging. ```typescript // Create a custom template for architecture decisions await use_mcp_tool({ server: "mcp-rtfm", tool: "customize_template", args: { templateName: "architecture-decision", content: "# {title}\n\n## Context\n[Background and context for the decision]\n\n## Decision\n[The architecture decision made]\n\n## Consequences\n[Impact and trade-offs of the decision]\n\n## Related Decisions\n[Links to related architecture decisions]", metadata: { category: "architecture", tags: ["decision-record", "design"] } } }); ``` -------------------------------- ### POST /analyze_project_with_metadata Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Initializes a complete documentation structure with intelligent metadata generation, content analysis, and search indexing. This is the recommended initialization method for new projects. ```APIDOC ## POST /analyze_project_with_metadata ### Description Initializes a new project's documentation structure by creating default markdown files, performing content analysis, generating metadata, and setting up a search index. ### Method POST ### Endpoint /analyze_project_with_metadata ### Parameters #### Query Parameters - **projectPath** (string) - Required - The absolute path to the project directory. ### Request Body ```json { "projectPath": "/home/user/my-project" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of initialization. - **docsPath** (string) - The path to the generated documentation directory. - **files** (array) - An array of default documentation file names created. - **metadata** (object) - Metadata generated for each documentation file. - **gitInfo** (object) - Information about the project's git repository. #### Response Example ```json { "message": "Documentation structure initialized with metadata and context", "docsPath": "/home/user/my-project/.handoff_docs", "files": [ "techStack.md", "codebaseDetails.md", "workflowDetails.md", "integrationGuides.md", "errorHandling.md", "handoff_notes.md" ], "metadata": { "techStack.md": { "title": "Tech Stack", "category": "technology", "tags": ["technology", "code-examples"], "lastUpdated": "2025-11-10T06:35:00.000Z", "relatedDocs": ["codebaseDetails.md"] } }, "gitInfo": { "remoteUrl": "https://github.com/ryanjoachim/mcp-rtfm.git", "branch": "main", "lastCommit": "abc123..." } } ``` ``` -------------------------------- ### analyze_project - Basic Initialization Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Creates a basic documentation structure without metadata enhancement. Use `analyze_project_with_metadata` for full features. ```APIDOC ## POST /analyze_project ### Description Initializes a basic documentation structure within a project. This command creates default documentation files using minimal templates. For enhanced features including metadata, use `analyze_project_with_metadata`. ### Method POST ### Endpoint `/analyze_project` ### Parameters #### Query Parameters - **projectPath** (string) - Required - The path to the project directory where the documentation structure will be created. ### Request Example ```json { "projectPath": "/home/user/my-project" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful initialization. - **docsPath** (string) - The path where the documentation structure was created. - **files** (array) - A list of the default documentation files created. #### Response Example ```json { "message": "Documentation structure initialized", "docsPath": "/home/user/my-project/.handoff_docs", "files": [ "techStack.md", "codebaseDetails.md", "workflowDetails.md", "integrationGuides.md", "errorHandling.md", "handoff_notes.md" ] } ``` ``` -------------------------------- ### Initialize Enhanced Documentation with Metadata - TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Initializes a new project documentation structure, including intelligent metadata generation, content analysis using unified/remark, and search indexing with minisearch. It creates six default documentation files and returns information about the generated structure, files, metadata, and Git information. Requires projectPath as an argument. ```typescript await use_mcp_tool({ server: "mcp-rtfm", tool: "analyze_project_with_metadata", args: { projectPath: "/home/user/my-project" } }); ``` -------------------------------- ### Initialize and Analyze Project Documentation (TypeScript) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md Initializes documentation with advanced content analysis by calling the 'analyze_project_with_metadata' tool. It processes the project path and sets up documentation files, metadata, relationships, search index, front matter, and Git context. Subsequently, it demonstrates fetching project information and performing intelligent documentation searches. ```typescript // 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 ``` -------------------------------- ### Basic Project Analysis Initialization Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Initializes a basic documentation structure for a project without enhancing it with metadata. Use `analyze_project_with_metadata` for full features. This function creates default documentation files using basic templates. ```typescript // Basic initialization (minimal features) await use_mcp_tool({ server: "mcp-rtfm", tool: "analyze_project", args: { projectPath: "/home/user/my-project" } }); // Creates default documentation files with basic templates: // { // "message": "Documentation structure initialized", // "docsPath": "/home/user/my-project/.handoff_docs", // "files": [ // "techStack.md", // "codebaseDetails.md", // "workflowDetails.md", // "integrationGuides.md", // "errorHandling.md", // "handoff_notes.md" // ] // } ``` -------------------------------- ### Retrieve Project Information Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Fetches comprehensive project details including git context, package information, directory structure, and documentation status. Requires the project path as an argument. The response is a detailed JSON object containing various aspects of the project. ```typescript // Get complete project information const projectInfo = await use_mcp_tool({ server: "mcp-rtfm", tool: "get_project_info", args: { projectPath: "/home/user/my-project" } }); // Response includes: // { // "gitInfo": { // "remoteUrl": "https://github.com/user/project.git", // "branch": "main", // "lastCommit": "abc123def456..." // }, // "packageInfo": { // "name": "my-project", // "version": "1.0.0", // "dependencies": { ... } // }, // "projectStructure": { // "src": { // "index.ts": null, // "utils": { ... } // }, // "tests": { ... } // }, // "docsStatus": { // "completed": ["techStack.md", "codebaseDetails.md"], // "current": "workflowDetails.md", // "inProgress": true, // "lastRead": "workflowDetails.md", // "remaining": ["integrationGuides.md", "errorHandling.md", "handoff_notes.md"] // } // } ``` -------------------------------- ### Search Documentation with Context (TypeScript) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md Demonstrates searching documentation using the 'search_docs' tool, emphasizing the retrieval of results with context. The output includes file names, line numbers, highlighted matches, and surrounding text, providing a comprehensive view of search hits. ```typescript // 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 ``` -------------------------------- ### Search documentation with highlighting in TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Performs fuzzy search across documentation files with context and highlighting. Returns matched lines with positions and maintains a cache. ```typescript // Search for authentication-related content const results = await use_mcp_tool({ server: "mcp-rtfm", tool: "search_docs", args: { projectPath: "/home/user/my-project", query: "authentication" } }); ``` -------------------------------- ### Enhance Existing Documentation - TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Analyzes and enhances existing Markdown files within the `.handoff_docs` directory. It parses content using unified/remark, generates metadata (categories, tags), builds a minisearch index for fuzzy searching, adds YAML front matter if missing, and establishes document relationships. Requires projectPath as an argument. ```typescript await use_mcp_tool({ server: "mcp-rtfm", tool: "analyze_existing_docs", args: { projectPath: "/home/user/my-project" } }); ``` -------------------------------- ### Claude Desktop MCP Server Configuration Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Configuration for Claude Desktop to connect to the MCP RTFM server. Similar to VSCode, this requires specifying server details in `claude_desktop_config.json`, including the execution command and arguments. ```json // Claude Desktop - Add to claude_desktop_config.json { "mcpServers": { "mcp-rtfm": { "command": "node", "args": ["/path/to/mcp-rtfm/build/index.js"], "disabled": false, "alwaysAllow": [] } } } ``` -------------------------------- ### Create custom documentation templates in TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Creates or updates custom templates with structured content and default metadata. Supports placeholders for dynamic content insertion. ```typescript // Create a custom architecture decision record template await use_mcp_tool({ server: "mcp-rtfm", tool: "customize_template", args: { templateName: "architecture-decision", content: `# {title} ## Context and Problem Statement [Describe the context and problem that this decision addresses] ## Decision Drivers [Key factors that influenced this decision] ## Considered Options 1. [Option 1] 2. [Option 2] 3. [Option 3] ## Decision Outcome [Chosen option with justification] ## Consequences ### Positive - [Benefit 1] - [Benefit 2] ### Negative - [Trade-off 1] - [Trade-off 2]` } }); ``` -------------------------------- ### POST /analyze_existing_docs Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Analyzes and enhances existing markdown files in the .handoff_docs directory with metadata, search indexing, and content relationships. This tool is useful for integrating and improving documentation that already exists. ```APIDOC ## POST /analyze_existing_docs ### Description Analyzes and enhances existing markdown files within a project's documentation directory (.handoff_docs). It adds metadata, builds a search index, and establishes relationships between documents without altering existing content. ### Method POST ### Endpoint /analyze_existing_docs ### Parameters #### Query Parameters - **projectPath** (string) - Required - The absolute path to the project directory containing the .handoff_docs folder. ### Request Body ```json { "projectPath": "/home/user/my-project" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the documentation has been analyzed and enhanced. - **files** (array) - An array of documentation files that were processed. - **metadata** (object) - Updated metadata for the analyzed documentation files. - **contextCache** (object) - Information about the context cache, including its timestamp and time-to-live (TTL). #### Response Example ```json { "message": "Existing documentation analyzed and enhanced", "files": ["custom-doc.md", "api-reference.md"], "metadata": { ... }, "contextCache": { "timestamp": 1699632000000, "ttl": 300000 } } ``` ``` -------------------------------- ### VSCode MCP Server Configuration Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Configuration for the VSCode editor to connect to the MCP RTFM server. This involves specifying the server details in the `cline_mcp_settings.json` file, including the command to run and its arguments. ```json // VSCode (Roo Cline) - Add to cline_mcp_settings.json { "mcpServers": { "mcp-rtfm": { "command": "node", "args": ["/path/to/mcp-rtfm/build/index.js"], "disabled": false, "alwaysAllow": [] } } } ``` -------------------------------- ### VSCode MCP RTFM Server Configuration (JSON) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md Provides the JSON configuration required for VSCode to connect to the 'mcp-rtfm' server. This involves specifying the command to run the server and its arguments, enabling it for use within the IDE. ```json { "mcpServers": { "mcp-rtfm": { "command": "node", "args": ["/build/index.js"], "disabled": false, "alwaysAllow": [] } } } ``` -------------------------------- ### Update Documentation with Content Links (TypeScript) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md Demonstrates updating documentation by first reading a document and then using the 'update_doc' tool to modify its content. This process includes adding links to other documents using `[[document-name]]` syntax, which the server tracks for relationship discovery. It also shows the option to automatically proceed to the next document. ```typescript // 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 documentation with diff in TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Reads and updates documentation files with search-and-replace functionality. Supports automatic continuation to next file. Requires MCP tool server. ```typescript // First, read the document await use_mcp_tool({ server: "mcp-rtfm", tool: "read_doc", args: { projectPath: "/home/user/my-project", docFile: "techStack.md" } }); // Update with content linking to related docs await use_mcp_tool({ server: "mcp-rtfm", tool: "update_doc", args: { projectPath: "/home/user/my-project", docFile: "techStack.md", searchContent: "[Why this domain is critical to the project]", replaceContent: "This document provides a comprehensive overview of all technologies, libraries, and tools used in the project. For implementation workflows, see [[workflowDetails]]. For integration patterns, refer to [[integrationGuides]].", continueToNext: true // Automatically prepare next unfinished doc } }); ``` -------------------------------- ### Customize Architecture Decision Record Template Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Customizes an architecture decision record template using a specified server and tool. It takes the project path and the template name as arguments. The response confirms the customization and lists available templates. ```typescript // Customize architecture decision record template await use_mcp_tool({ server: "mcp-rtfm", tool: "custom_template", args: { projectPath: "/home/user/my-project", templateName: "architecture-decision" }, metadata: { category: "architecture", tags: ["decision-record", "design", "adr"] } }); // Response: // { // "message": "Template customized successfully", // "templateName": "architecture-decision", // "availableTemplates": [ // "standard", // "api", // "workflow", // "architecture-decision" // ] // } ``` -------------------------------- ### Manage Documentation Metadata (TypeScript) Source: https://github.com/ryanjoachim/mcp-rtfm/blob/main/README.md Illustrates how to manage documentation metadata using the 'update_metadata' tool. This involves setting or updating properties like 'title', 'category', and 'tags' for a specific document, enhancing organization and discoverability. It also shows how to retrieve related documents based on this metadata. ```typescript // 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" } }); ``` -------------------------------- ### Find related documentation in TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Discovers related documents based on shared metadata, tags, categories, and content links. Helps maintain documentation networks. ```typescript // Find documentation related to techStack.md const related = await use_mcp_tool({ server: "mcp-rtfm", tool: "get_related_docs", args: { projectPath: "/home/user/my-project", docFile: "techStack.md" } }); ``` -------------------------------- ### Read Documentation Content Without State Change Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Retrieves the content of a specific documentation file without altering the state machine. This is useful for previewing or reading multiple documents in parallel without affecting the workflow. Requires project path and document file name. ```typescript // Get content without changing workflow state const content = await use_mcp_tool({ server: "mcp-rtfm", tool: "get_doc_content", args: { projectPath: "/home/user/my-project", docFile: "errorHandling.md" } }); // Returns file content as plain text // Useful for: // - Preview without locking for editing // - Reading multiple docs in parallel // - Content extraction without workflow impact ``` -------------------------------- ### POST /read_doc Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Reads the content of a specified documentation file. This must be called before attempting to update a document using the `update_doc` tool. ```APIDOC ## POST /read_doc ### Description Reads and returns the full content of a specified documentation file. This action is a prerequisite for modifying a document using the `update_doc` tool. ### Method POST ### Endpoint /read_doc ### Parameters #### Query Parameters - **projectPath** (string) - Required - The absolute path to the project directory. - **docFile** (string) - Required - The name of the documentation file to read (e.g., "techStack.md"). ### Request Body ```json { "projectPath": "/home/user/my-project", "docFile": "techStack.md" } ``` ### Response #### Success Response (200) - **content** (string) - The full content of the requested documentation file, including YAML front matter and markdown body. #### Response Example ```text --- title: Tech Stack category: technology tags: technology, dependencies lastUpdated: 2025-11-10T06:35:00.000Z --- # Tech Stack ## Purpose and Overview [Documentation content...] ``` ``` -------------------------------- ### Read Documentation File - TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Reads the content of a specified documentation file from the project. This function must be called before attempting to update the same document. It requires the projectPath and the docFile name as arguments and returns the full content of the documentation file, including any existing front matter and body content. ```typescript const content = await use_mcp_tool({ server: "mcp-rtfm", tool: "read_doc", args: { projectPath: "/home/user/my-project", docFile: "techStack.md" } }); ``` -------------------------------- ### get_doc_content - Read Without State Change Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Retrieves documentation content without affecting the state machine. Useful for previews or parallel reading. ```APIDOC ## GET /get_doc_content ### Description Retrieves the content of a specific documentation file without altering the tool's state. This is useful for previewing content or reading multiple documents concurrently without triggering workflow changes. ### Method GET ### Endpoint `/get_doc_content` ### Parameters #### Query Parameters - **projectPath** (string) - Required - The path to the project directory. - **docFile** (string) - Required - The name of the documentation file to retrieve. ### Request Example ```json { "projectPath": "/home/user/my-project", "docFile": "errorHandling.md" } ``` ### Response #### Success Response (200) - Returns the content of the specified documentation file as plain text. #### Response Example ``` // Content of errorHandling.md will be returned here as plain text. ``` ``` -------------------------------- ### Update document metadata in TypeScript Source: https://context7.com/ryanjoachim/mcp-rtfm/llms.txt Updates metadata fields like title, category, and tags for better document organization. Automatically tracks last updated timestamp. ```typescript // Update metadata for a documentation file await use_mcp_tool({ server: "mcp-rtfm", tool: "update_metadata", args: { projectPath: "/home/user/my-project", docFile: "techStack.md", metadata: { title: "Technology Stack Overview", category: "architecture", tags: ["infrastructure", "dependencies", "configuration", "docker"] } } }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.