afterxleep/doc-bot
If you are the rightful owner of doc-bot and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Docbot is an open-source MCP server designed to provide intelligent documentation access for any project.
doc-bot
A generic MCP (Model Context Protocol) server that provides intelligent documentation and rules for any project. Works with any MCP-compatible AI tools and IDEs.
It's platform agnostic and designed to replace and extend the rule systems provided by different IDEs, such as Cursor (Cursor Rules) or Claude (CLAUDE.md). Instead of relying on separate rule-sets for each tool, you can use doc-bot to provide unified documentation for agentic coding across all your AI assistants.
What is doc-bot?
doc-bot is an intelligent documentation server that:
- š Searches your project documentation instantly
- š§ Auto-indexes content for smart inference (no manual keyword mapping!)
- š Applies global rules to every AI interaction
- šÆ Suggests contextual documentation based on file patterns
- š¤ Detects code patterns, frameworks, and keywords automatically
- š Updates automatically when docs change
Why MCP Instead of Static Rules?
Traditional AI assistants use static rule files (like Cursor Rules or Copilot's .github/copilot-instructions.md) that have significant limitations. doc-bot's MCP approach offers powerful advantages:
š Dynamic Search vs Static Rules
Static Systems:
- All rules must fit in a single file or limited token window
- AI reads everything, even irrelevant rules
- No way to search or filter documentation
- Rules compete for precious context space
MCP with doc-bot:
- AI searches for exactly what it needs
- Unlimited documentation size - only relevant parts are retrieved
- Smart keyword and pattern matching
- Context window used efficiently
š§ Contextual Intelligence
Static Systems:
- Same rules applied everywhere
- No awareness of what you're working on
- Can't provide specific help for your current task
MCP with doc-bot:
- AI searches for relevant documentation based on your query
- Context-aware suggestions from your actual questions
- Different documentation retrieved for different tasks
- Intelligent inference from keywords and search terms
š Scalability Without Limits
Static Systems:
- Limited by token count (typically 2-4k tokens)
- Adding more rules means removing others
- Documentation competes with your actual code for context
MCP with doc-bot:
- Store thousands of documentation files
- No token limit - documentation lives outside the context
- AI retrieves only what's needed
- Your context window stays free for actual work
š Live Updates
Static Systems:
- Changes require restarting your AI/IDE
- No way to know if rules are current
- Manual synchronization across tools
MCP with doc-bot:
- Hot reload on documentation changes
- Always serves the latest version
- Single source of truth for all AI tools
šÆ Smart Discovery
Static Systems:
- AI doesn't know what documentation exists
- Users must know to ask specific questions
- No exploration or discovery capabilities
- AI agents rely on basic grep searches through codebases to infer project patterns
MCP with doc-bot:
- AI can list all available documentation
- Discovers relevant docs automatically
- Suggests documentation based on context
- Searchable knowledge base with intelligent ranking
- No need for AI to grep through your codebase - dedicated search engine
Installation
-
Create your documentation folder in your project root (see organization section below)
-
Add doc-bot to your MCP-compatible AI tool configuration:
{ "mcpServers": { "doc-bot": { "command": "npx", "args": ["@afterxleep/doc-bot@latest"] } } }
Custom docs folder:
{ "mcpServers": { "doc-bot": { "command": "npx", "args": ["@afterxleep/doc-bot@latest", "--docs", "./my-custom-docs"] } } }
With verbose logging (for debugging):
{ "mcpServers": { "doc-bot": { "command": "npx", "args": ["@afterxleep/doc-bot@latest", "--verbose"] } } }
-
Restart your AI tool
-
Ensure Agent Compliance (Essential): Add the expert-engineered integration protocol to guarantee your agent uses doc-bot:
ā” Setup: Copy the rule from into your agent configuration. šÆ Why This Matters: Without this rule, agents may default to general knowledge instead of your doc-bot documentation.
Platform-Specific Instructions:
- Claude Code: Add rule to your global
CLAUDE.md
- Cursor: Create a
.mdc
file in.cursor/rules/
directory withalwaysApply: true
- GitHub Copilot: Add rule to
.github/copilot-instructions.md
- Continue.dev: Add rule to system prompt configuration
- Claude Code: Add rule to your global
How to organize your documentation
Create a doc-bot/
folder in your project root with markdown files using frontmatter:
your-project/
āāā doc-bot/
ā āāā coding-standards.md # Global rule (alwaysApply: true)
ā āāā security.md # Global rule (alwaysApply: true)
ā āāā testing.md # Contextual rule (alwaysApply: false)
ā āāā api-development.md # Contextual rule (alwaysApply: false)
ā āāā troubleshooting.md # Contextual rule (alwaysApply: false)
āāā package.json
Note: The doc-bot
folder is the default location. You can use any folder name by specifying it with the --docs
option.
Documentation types:
- Global Rules (
alwaysApply: true
): Critical guidelines applied to every AI interaction - Contextual Rules (
alwaysApply: false
): Rules applied based on file patterns and context
Example documentation files:
Global Rule Example (doc-bot/coding-standards.md
):
---
alwaysApply: true
title: "Coding Standards"
description: "Core coding standards that apply to all code"
keywords: ["code-quality", "standards", "best-practices"]
---
# Coding Standards
- Use 2 spaces for indentation
- Maximum line length: 100 characters
- Always use const/let, never var
- Prefer async/await over promises
- Write descriptive variable names
Contextual Rule Example (doc-bot/testing.md
):
---
alwaysApply: false
title: "Testing Guide"
description: "How to write and run tests"
keywords: ["testing", "jest", "tdd", "unit-tests"]
---
# Testing Guide
All test files should:
- Use describe/it blocks for organization
- Include both positive and negative test cases
- Mock external dependencies
- Aim for 80%+ code coverage
Run tests with: `npm test`
Frontmatter-Based Configuration
doc-bot uses frontmatter in your markdown files to automatically detect and categorize rules - no manifest.json required!
Frontmatter Fields:
alwaysApply: true
- Global rules applied to every AI interactionalwaysApply: false
- Contextual rules searched and applied based on relevancekeywords: ["list", "of", "keywords"]
- For smart indexing and searchtitle
anddescription
- Standard metadata
šÆ Automatic Intelligence
doc-bot automatically analyzes your documentation to provide smart suggestions:
- Keyword-based search from frontmatter metadata
- Multi-term search with fuzzy matching capabilities
- Smart inference from documentation content
- Automatic indexing - no manual configuration needed
Writing effective documentation
For best results, include descriptive frontmatter:
---
alwaysApply: false
title: "React Component Guidelines"
description: "Best practices for building React components"
keywords: ["react", "components", "hooks", "jsx"]
---
# React Component Guidelines
Your documentation content here...
Development setup
Running locally
-
Clone the repository:
git clone https://github.com/afterxleep/doc-bot.git cd doc-bot
-
Install dependencies:
npm install
-
Run the server (uses built-in doc-bot/ folder):
npm start
-
Run with file watching (recommended for development):
npm run dev
-
Run with examples documentation:
npm run start:examples
-
Run tests:
npm test
Note: This is an MCP server that communicates via stdio transport, not HTTP. When running locally, it will start the MCP server and show you the configuration to add to your MCP client (like Claude Code).
Testing your setup
Ask your AI assistant something like "What documentation is available?" to test that doc-bot is working.
CLI Options
doc-bot [options]
Options:
-d, --docs <path> Path to docs folder (default: doc-bot)
-c, --config <path> Path to manifest file (optional, for backward compatibility)
-v, --verbose Enable verbose logging
-w, --watch Watch for file changes
-h, --help Show help
Example usage:
# Basic usage with default doc-bot folder
doc-bot
# Specify a custom docs folder
doc-bot --docs ./my-docs
# With verbose logging and file watching
doc-bot --verbose --watch
# With optional manifest for backward compatibility
doc-bot --config ./manifest.json
Publishing and Development
Local Development
-
Clone and setup:
git clone https://github.com/afterxleep/doc-bot.git cd doc-bot npm install
-
Run locally:
npm run dev # With file watching npm start # Basic run npm test # Run tests
-
Test with Claude Code: Add to your Claude Code config:
{ "mcpServers": { "doc-bot": { "command": "node", "args": ["/path/to/doc-bot/bin/doc-bot.js", "--verbose", "--watch"] } } }
Publishing to npm
-
Test the package:
npm run test npm run lint
-
Update version:
npm version patch|minor|major
-
Publish:
npm publish
Push Changes
git add .
git commit -m "feat: your feature description"
git push origin main
git push --tags # Push version tags
License
MIT License - see the file for details.