mcp-docs-service
v7.2.1
Published
MCP Documentation Service - A Model Context Protocol implementation for documentation management
Maintainers
Readme
MCP Documentation Service
What is it?
MCP Documentation Service is a Model Context Protocol (MCP) implementation for documentation management with a focus on single-file documentation generation for AI assistants. It provides tools for reading, writing, and managing markdown docs with frontmatter metadata, all optimized for LLM context windows. The service works seamlessly with AI assistants like Claude in Cursor or Claude Desktop.
Features
- Single-File Documentation: Generate one comprehensive document for AI assistants
- Read and Write Documents: Easily read and write markdown documents with frontmatter
- Edit Documents: Make precise line-based edits with diff previews
- List and Search: Find documents by content or metadata
- Navigation Generation: Create navigation structures automatically
- Health Checks: Analyze documentation quality and find issues
- Docker Support: Run consistently across any environment
Quick Start
Option 1: Using Docker (Recommended)
The easiest way to get started with consistent behavior across environments:
# Pull and run directly
docker run -v ./docs:/app/docs -p 3899:3899 ghcr.io/alekspetrov/mcp-docs-service:latest /app/docs --single-doc
# Or with docker-compose
docker-compose up -dSee Docker Usage for more configuration options.
Option 2: Node Installation
Requires Node to be installed on your machine.
# Install globally
npm install -g mcp-docs-service
# Or use directly with npx
npx mcp-docs-service /path/to/docs --single-docCursor Integration
To use with Cursor, create a .cursor/mcp.json file in your project root:
{
"mcpServers": {
"docs-manager": {
"command": "npx",
"args": [
"-y",
"mcp-docs-service@latest",
"/path/to/your/docs",
"--single-doc"
]
}
}
}Advanced Cursor Integration with Rules
For an enhanced experience with Cursor's AI, add a .cursorrules file to your project:
{
"rules": {
"context_initialization": {
"description": "Starting point for each interaction",
"steps": [
"ALWAYS read docs/single-file-docs.md first",
"ALWAYS read docs/docker-usage.md when Docker is mentioned"
]
},
"operational_protocol": {
"description": "How to approach documentation tasks",
"tool_selection": [
"ALWAYS use mcp_docs_manager_* functions for ALL documentation tasks",
"PREFER mcp_docs_manager_generate_llms_doc for creating single documents"
]
},
"safety_requirements": [
"ALWAYS regenerate single_doc after documentation changes"
]
}
}This configuration helps AI assistants in Cursor understand how to best work with your documentation, ensuring they always:
- Read the most important docs first
- Use the proper MCP tools for documentation tasks
- Follow best practices for documentation management
Direct Cursor Integration
For direct integration with Cursor IDE without using npm or Docker:
- Copy the path to the
cursor-run-mcp-docs.shscript in your project - Open Cursor Settings → Features → MCP Servers
- Add a new server with the following settings:
- Name:
docs-manager - Type:
stdio - Command: Paste the full path to
cursor-run-mcp-docs.sh - Args: Add
/path/to/your/docs --single-doc
- Name:
The script will automatically start the MCP Documentation Service directly from Cursor.
Best Practices for Documentation Tools
When working with the MCP Documentation Service, always:
Use the Right Tools for Documentation Tasks:
mcp_docs_manager_read_document- For reading documentsmcp_docs_manager_write_document- For creating/updating docsmcp_docs_manager_generate_llms_doc- For generating the single comprehensive docmcp_docs_manager_interactive_template- For creating docs with templates
Regenerate Single Docs After Changes:
npx mcp-docs-service /path/to/docs --generate-single-docOr ask Claude: "Please regenerate the single doc after my changes"
Organize Documentation for AI Understanding:
- Keep a
.notesdirectory with essential documentation - Use consistent frontmatter in all markdown files
- Maintain clear relationships between documents
- Keep a
Claude Desktop Integration
To use MCP Docs Service with Claude Desktop:
Install Claude Desktop - Download the latest version from Claude's website.
Configure Claude Desktop for MCP:
- Open Claude Desktop
- Click on the Claude menu and select "Developer Settings"
- This will create a configuration file at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
Edit the configuration file to add the MCP Docs Service:
{
"mcpServers": {
"docs-manager": {
"command": "npx",
"args": ["-y", "mcp-docs-service", "/path/to/your/docs"]
}
}
}Make sure to replace /path/to/your/docs with the absolute path to your documentation directory.
Restart Claude Desktop completely.
Verify the tool is available - After restarting, you should see a green dot for docs-manager MCP tool (Cursor Settings > MCP)
Troubleshooting:
- If the server doesn't appear, check the logs at:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
- Ensure Node.js is installed on your system
- Make sure the paths in your configuration are absolute and valid
- If the server doesn't appear, check the logs at:
Examples
Using with Claude in Cursor
When using Claude in Cursor, you can invoke the tools in two ways:
- Using Natural Language (Recommended):
- Simply ask Claude to perform the task in plain English:
Can you search my documentation for anything related to "getting started"?Please list all the markdown files in my docs directory.Could you check if there are any issues with my documentation?- Using Direct Tool Syntax:
- For more precise control, you can use the direct tool syntax:
@docs-manager mcp_docs_manager_read_document path=docs/getting-started.md@docs-manager mcp_docs_manager_list_documents recursive=true@docs-manager mcp_docs_manager_check_documentation_healthUsing with Claude Desktop
When using Claude Desktop, you can invoke the tools in two ways:
- Using Natural Language (Recommended):
Can you read the README.md file for me?Please find all documents that mention "API" in my documentation.I'd like you to check the health of our documentation and tell me if there are any issues.- Using the Tool Picker:
- Click the hammer icon in the bottom right corner of the input box
- Select "docs-manager" from the list of available tools
- Choose the specific tool you want to use
- Fill in the required parameters and click "Run"
Claude will interpret your natural language requests and use the appropriate tool with the correct parameters. You don't need to remember the exact tool names or parameter formats - just describe what you want to do!
Common Tool Commands
Here are some common commands you can use with the tools:
Reading a Document
@docs-manager mcp_docs_manager_read_document path=docs/getting-started.mdWriting a Document
@docs-manager mcp_docs_manager_write_document path=docs/new-document.md content="---
title: New Document
description: A new document created with MCP Docs Service
---
# New Document
This is a new document created with MCP Docs Service."