Package Exports
- @afterxleep/doc-bot
- @afterxleep/doc-bot/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@afterxleep/doc-bot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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:
- 🧠 Auto-indexes content for smart inference, based on metadata and keywords
- 🤖 Provides agentic tools to query, and update your documentation
- 🔄 Updates automatically when docs change
Why MCP Instead of Static Rules?
IDE's use static rule files (like Cursor Rules or Copilot's .github/copilot-instructions.md), and each one has their own format, metadata and approach.
🚀 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 (besides plain 'grep')
- Rules compete for 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:
- Duplicate or symlinked rules to work with multiple agents
- Agents use grepfor basic text-base searching
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
- Adding more rules has impact in your context window
- 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 and AI agents
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 relevance
- 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"] } } } - Note: If a relative path does not work, you can use VSCode - ${workspaceFolder}environment variable- ${workspaceFolder}/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 - AGENT_INTEGRATION_RULE.txtinto 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 .mdcfile 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.jsonNote: 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):
```markdown
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`):
```markdown
---
alwaysApply: false
title: "Testing Guide"
description: "How to write and run tests"
keywords: ["testing", "jest", "tdd", "unit-tests"]
filePatterns: ["*.test.js", "*.spec.js", "__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.
Frontmatter Fields:
- alwaysApply: true- Global rules applied to every AI interaction
- alwaysApply: false- Contextual rules searched and applied based on relevance
- keywords: ["list", "of", "keywords"]- For smart indexing and search
- filePatterns: ["*.js", "src/**/*.ts"]- Apply docs to specific files (see below)
- titleand- description- Standard metadata
- confidence: 0.9- Relevance confidence score (0-1)
🎯 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...File Pattern Matching
doc-bot supports contextual documentation using file patterns. Documentation can be targeted to specific files:
---
alwaysApply: false
title: "React Testing Guide"
keywords: ["testing", "jest", "react"]
filePatterns: ["*.test.jsx", "*.test.tsx", "__tests__/**/*"]
---
# React Testing Guide
This documentation appears only when working with test files...Pattern Examples:
- *.js- All JavaScript files
- src/**/*.ts- TypeScript files in src directory
- [Tt]est.js- Test.js or test.js
- *.{jsx,tsx}- React component files
When AI requests documentation for a specific file (e.g., Button.test.jsx), only docs with matching patterns are returned.
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 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)
  -v, --verbose           Enable verbose logging
  -w, --watch             Watch for file changes
  -h, --help              Show helpExample 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 --watchPublishing 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 tagsLicense
MIT License - see the LICENSE file for details.