@afterxleep/doc-bot 1.7.1 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -95,7 +95,7 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
95
95
  ```json
96
96
  {
97
97
  "mcpServers": {
98
- "docbot": {
98
+ "doc-bot": {
99
99
  "command": "npx",
100
100
  "args": ["@afterxleep/doc-bot"]
101
101
  }
@@ -103,11 +103,11 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
103
103
  }
104
104
  ```
105
105
 
106
- **Note:** By default, doc-bot looks for a `.doc-bot` folder. To use a different folder:
106
+ **Custom docs folder:**
107
107
  ```json
108
108
  {
109
109
  "mcpServers": {
110
- "docbot": {
110
+ "doc-bot": {
111
111
  "command": "npx",
112
112
  "args": ["@afterxleep/doc-bot", "--docs", "./my-custom-docs"]
113
113
  }
@@ -115,6 +115,18 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
115
115
  }
116
116
  ```
117
117
 
118
+ **With verbose logging (for debugging):**
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "doc-bot": {
123
+ "command": "npx",
124
+ "args": ["@afterxleep/doc-bot", "--verbose"]
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
118
130
  3. **Restart your AI tool**
119
131
 
120
132
  ## How to organize your documentation
@@ -308,9 +320,9 @@ doc-bot --config ./manifest.json
308
320
  ```json
309
321
  {
310
322
  "mcpServers": {
311
- "docs": {
323
+ "doc-bot": {
312
324
  "command": "node",
313
- "args": ["/path/to/doc-bot/bin/doc-bot.js", "--watch"]
325
+ "args": ["/path/to/doc-bot/bin/doc-bot.js", "--verbose", "--watch"]
314
326
  }
315
327
  }
316
328
  }
package/bin/doc-bot.js CHANGED
@@ -9,7 +9,7 @@ program
9
9
  .name('doc-bot')
10
10
  .description('Generic MCP server for intelligent documentation access')
11
11
  .version('1.5.0')
12
- .option('-d, --docs <path>', 'Path to docs folder', '.doc-bot')
12
+ .option('-d, --docs <path>', 'Path to docs folder', 'doc-bot')
13
13
  .option('-c, --config <path>', 'Path to manifest file')
14
14
  .option('-v, --verbose', 'Enable verbose logging')
15
15
  .option('-w, --watch', 'Watch for file changes')
@@ -34,14 +34,16 @@ async function main() {
34
34
  console.log(' alwaysApply: true (for global rules)');
35
35
  console.log(' alwaysApply: false (for contextual rules)');
36
36
  console.log('');
37
- console.log('💡 Tip: By default, doc-bot looks for a .doc-bot folder.');
37
+ console.log('💡 Tip: By default, doc-bot looks for a doc-bot folder.');
38
38
  console.log(' Use --docs to specify a different folder.');
39
39
  process.exit(1);
40
40
  }
41
41
 
42
42
  // Manifest is now optional - only create if explicitly requested
43
43
  if (options.config && !await fs.pathExists(configPath)) {
44
- console.log('📝 Creating default manifest.json...');
44
+ if (options.verbose) {
45
+ console.error('📝 Creating default manifest.json...');
46
+ }
45
47
  const defaultManifest = {
46
48
  name: 'Project Documentation',
47
49
  version: '1.0.0',
@@ -58,33 +60,25 @@ async function main() {
58
60
  watch: options.watch
59
61
  });
60
62
 
61
- console.log('🚀 Starting doc-bot...');
62
- console.log(`📁 Documentation: ${docsPath}`);
63
- if (await fs.pathExists(configPath)) {
64
- console.log(`⚙️ Configuration: ${configPath}`);
65
- } else {
66
- console.log(`⚙️ Configuration: Auto-generated from frontmatter`);
67
- }
68
-
69
- if (options.watch) {
70
- console.log('👀 Watching for file changes...');
63
+ if (options.verbose) {
64
+ console.error('🚀 Starting doc-bot...');
65
+ console.error(`📁 Documentation: ${docsPath}`);
66
+ if (await fs.pathExists(configPath)) {
67
+ console.error(`⚙️ Configuration: ${configPath}`);
68
+ } else {
69
+ console.error(`⚙️ Configuration: Auto-generated from frontmatter`);
70
+ }
71
+
72
+ if (options.watch) {
73
+ console.error('👀 Watching for file changes...');
74
+ }
71
75
  }
72
76
 
73
77
  await server.start();
74
- console.log('✅ Server started successfully!');
75
- console.log('');
76
- console.log('📋 Add this to your Claude Code configuration:');
77
- console.log('');
78
- console.log('{');
79
- console.log(' "mcpServers": {');
80
- console.log(' "docs": {');
81
- console.log(` "command": "npx",`);
82
- console.log(` "args": ["doc-bot", "--docs", "${docsPath}"]`);
83
- console.log(' }');
84
- console.log(' }');
85
- console.log('}');
86
- console.log('');
87
- console.log('🔄 Then restart Claude Code');
78
+
79
+ if (options.verbose) {
80
+ console.error(' Server started successfully!');
81
+ }
88
82
  }
89
83
 
90
84
  main().catch(error => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterxleep/doc-bot",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Generic MCP server for intelligent documentation access in any project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -11,8 +11,8 @@ const fs = require('fs').promises;
11
11
  class DocsServer {
12
12
  constructor(options = {}) {
13
13
  this.options = {
14
- docsPath: options.docsPath || './.doc-bot',
15
- configPath: options.configPath || './.doc-bot/manifest.json', // Optional, for backward compatibility
14
+ docsPath: options.docsPath || './doc-bot',
15
+ configPath: options.configPath || './doc-bot/manifest.json', // Optional, for backward compatibility
16
16
  verbose: options.verbose || false,
17
17
  watch: options.watch || false,
18
18
  ...options
@@ -319,7 +319,7 @@ class DocsServer {
319
319
 
320
320
  watcher.on('change', async (filePath) => {
321
321
  if (this.options.verbose) {
322
- console.log(`📄 Documentation updated: ${path.relative(process.cwd(), filePath)}`);
322
+ console.error(`📄 Documentation updated: ${path.relative(process.cwd(), filePath)}`);
323
323
  }
324
324
 
325
325
  // Reload manifest if config changed
@@ -757,11 +757,11 @@ class DocsServer {
757
757
  await this.server.connect(transport);
758
758
 
759
759
  if (this.options.verbose) {
760
- console.log('🔧 Server initialized with MCP transport');
760
+ console.error('🔧 Server initialized with MCP transport');
761
761
  if (this.manifestLoader) {
762
- console.log('📄 Using manifest.json for additional configuration');
762
+ console.error('📄 Using manifest.json for additional configuration');
763
763
  } else {
764
- console.log('🚀 Using frontmatter-based configuration (no manifest needed)');
764
+ console.error('🚀 Using frontmatter-based configuration (no manifest needed)');
765
765
  }
766
766
  }
767
767
  }
@@ -24,7 +24,7 @@ class DocumentationService {
24
24
  async loadDocuments() {
25
25
  try {
26
26
  if (!await fs.pathExists(this.docsPath)) {
27
- console.warn(`Documentation path does not exist: ${this.docsPath}`);
27
+ // Silently return if path doesn't exist - this is normal for MCP servers
28
28
  return;
29
29
  }
30
30
 
@@ -75,7 +75,7 @@ class DocumentationService {
75
75
  content: match[2]
76
76
  };
77
77
  } catch (error) {
78
- console.warn('Failed to parse frontmatter:', error);
78
+ // Silently skip files with invalid frontmatter
79
79
  }
80
80
  }
81
81