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:
- 🔍 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
Installation
Create your documentation folder in your project root (see organization section below)
Add doc-bot to your MCP-compatible AI tool configuration:
{ "mcpServers": { "docbot": { "command": "npx", "args": ["@afterxleep/doc-bot", "--docs", "./doc-bot"] } } }
Restart your AI tool
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: You can use any folder name - just specify it in your MCP configuration:
"args": ["@afterxleep/doc-bot", "--docs", "./my-custom-docs"]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: ["*.js"]
---
# 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 applied based on file patternsfilePatterns: ["*.js"]- When to apply contextual rules (only needed foralwaysApply: false)keywords: ["list", "of", "keywords"]- For smart indexing and searchtitleanddescription- Standard metadata
🎯 Automatic Intelligence
doc-bot automatically analyzes your documentation to provide smart suggestions:
- Keyword-based search from frontmatter metadata
- Context-aware suggestions based on file patterns
- 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"]
filePatterns: ["*.js"]
---
# 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 startRun with file watching (recommended for development):
npm run devRun with examples documentation:
npm run start:examplesRun 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 (required)
-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 helpExample usage:
# Basic usage (no manifest.json needed)
doc-bot --docs ./my-docs
# With verbose logging and file watching
doc-bot --docs ./my-docs --verbose --watch
# With optional manifest for backward compatibility
doc-bot --docs ./my-docs --config ./manifest.jsonPublishing 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": { "docs": { "command": "node", "args": ["/path/to/doc-bot/bin/doc-bot.js", "--docs", "./doc-bot", "--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.