nodebb-plugin-integration 0.4.2 → 0.4.4

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
@@ -1,320 +1,199 @@
1
- # NodeBB Integration Layer
2
-
3
- AI integration layer for NodeBB forums with MCP, semantic search, RAG pipeline and Qdrant vector storage.
4
-
5
- ![Node.js](https://img.shields.io/badge/node-%3E%3D20-green)
6
- ![Tests](https://github.com/Sergey-ek/nodebb-plugin-integration/actions/workflows/test.yml/badge.svg)
7
- ![License](https://img.shields.io/badge/license-MIT-blue)
8
-
9
- ## Features
10
-
11
- * NodeBB integration adapter
12
- * MCP (Model Context Protocol) server
13
- * Semantic search
14
- * RAG knowledge pipeline
15
- * Qdrant vector database support
16
- * OpenAI embeddings support
17
- * Fake embeddings for local development
18
- * Standalone development mode
19
- * Automated tests with GitHub Actions
20
-
21
- ## Architecture
22
-
23
- ```
24
- NodeBB
25
-
26
- |
27
- |
28
-
29
- Integration Layer
30
-
31
- |
32
- +-------------+-------------+
33
-
34
- | |
35
-
36
- MCP AI
37
-
38
- | |
39
-
40
- Tools API Embeddings
41
-
42
- |
43
-
44
- Qdrant
45
-
46
- |
47
-
48
- Knowledge Base
49
- ```
50
-
51
- ## Requirements
52
-
53
- * Node.js >= 20
54
- * npm >= 10
55
-
56
- Optional:
57
-
58
- * NodeBB
59
- * Redis
60
- * Qdrant
61
- * OpenAI API key
62
-
63
- ## Installation
64
-
65
- Clone repository:
66
-
67
- ```bash
68
- git clone https://github.com/Sergey-ek/nodebb-plugin-integration.git
69
-
70
- cd nodebb-plugin-integration
71
- ```
72
-
73
- Install dependencies:
74
-
75
- ```bash
76
- npm install
77
- ```
78
-
79
- Create environment file:
80
-
81
- ```bash
82
- cp .env.example .env
83
- ```
84
-
85
- ## Development mode
86
-
87
- By default the project uses fake embeddings:
88
-
89
- ```
90
- AI_PROVIDER=fake
91
- ```
92
-
93
- This allows running tests without:
94
-
95
- * OpenAI
96
- * Qdrant
97
- * NodeBB
98
-
99
- Run diagnostics:
100
-
101
- ```bash
102
- npm run diagnose
103
- ```
104
-
105
- Example:
106
-
107
- ```
108
- {
109
- environment: "development",
110
- embeddings: {
111
- provider: "fake",
112
- size: 1536
113
- }
114
- }
115
- ```
116
-
117
- ## Testing
118
-
119
- Syntax check:
120
-
121
- ```bash
122
- npm run check
123
- ```
124
-
125
- Run tests:
126
-
127
- ```bash
128
- npm test
129
- ```
130
-
131
- Expected:
132
-
133
- ```
134
- 8 passing
135
- ```
136
-
137
- ## NodeBB Integration
138
-
139
- Configure:
140
-
141
- ```
142
- NODEBB_URL=http://localhost:4567
143
-
144
- NODEBB_API_KEY=your_token
145
- ```
146
-
147
- When running inside NodeBB, the plugin uses native NodeBB modules.
148
-
149
- Standalone mode provides safe fallback adapters.
150
-
151
- ## AI Pipeline
152
-
153
- Flow:
154
-
155
- ```
156
- Forum post
157
-
158
- |
159
-
160
- Embedding generation
161
-
162
- |
163
-
164
- Vector storage
165
-
166
- |
167
-
168
- Qdrant similarity search
169
-
170
- |
171
-
172
- Knowledge retrieval
173
-
174
- |
175
-
176
- AI response
177
- ```
178
-
179
- Supported providers:
180
-
181
- ### Fake
182
-
183
- Development mode:
184
-
185
- ```
186
- AI_PROVIDER=fake
187
- ```
188
-
189
- ### OpenAI
190
-
191
- Production mode:
192
-
193
- ```
194
- AI_PROVIDER=openai
195
-
196
- OPENAI_API_KEY=your_key
197
- ```
198
-
199
- ## Qdrant
200
-
201
- Configure:
202
-
203
- ```
204
- QDRANT_URL=http://localhost:6333
205
-
206
- QDRANT_COLLECTION=nodebb_knowledge
207
- ```
208
-
209
- The system automatically:
210
-
211
- * checks collection;
212
- * creates collection;
213
- * stores vectors;
214
- * performs similarity search.
215
-
216
- ## MCP Server
217
-
218
- Start MCP:
219
-
220
- ```bash
221
- npm run mcp
222
- ```
223
-
224
- Available tools:
225
-
226
- ```
227
- get_forum_info
228
-
229
- get_post
230
-
231
- get_topic
232
-
233
- get_user
234
-
235
- search_knowledge
236
- ```
237
-
238
- Example:
239
-
240
- ```
241
- search_knowledge
242
-
243
- {
244
- "query": "installation guide",
245
- "limit": 5
246
- }
247
- ```
248
-
249
- ## Project Structure
250
-
251
- ```
252
- .
253
- ├── library.js
254
-
255
- ├── package.json
256
-
257
- ├── plugin.json
258
-
259
- ├── src
260
-
261
- │ ├── ai
262
-
263
- │ │ ├── embeddings.js
264
-
265
- │ │ ├── openai.js
266
-
267
- │ │ ├── qdrant.js
268
-
269
- │ │ ├── indexer.js
270
-
271
- │ │ └── search.js
272
-
273
- │ │
274
-
275
- │ ├── mcp
276
-
277
- │ │ ├── server.js
278
-
279
- │ │ └── tools.js
280
-
281
- │ │
282
-
283
- │ ├── nodebb
284
-
285
- │ │ ├── meta.js
286
-
287
- │ │ ├── posts.js
288
-
289
- │ │ ├── topics.js
290
-
291
- │ │ └── users.js
292
-
293
- │ │
294
-
295
- │ └── config
296
-
297
- │ └── index.js
298
-
299
- │
300
-
301
- └── test
302
-
303
- └── plugin.test.js
304
- ```
305
-
306
- ## Security
307
-
308
- Never commit:
309
-
310
- ```
311
- .env
312
-
313
- OPENAI_API_KEY
314
-
315
- NODEBB_API_KEY
316
- ```
317
-
318
- ## License
319
-
320
- MIT
1
+ # NodeBB Integration Layer
2
+
3
+ Integration plugin for NodeBB forums providing MCP (Model Context Protocol), AI-powered semantic search, RAG retrieval and Qdrant vector storage.
4
+
5
+ ## Features
6
+
7
+ - NodeBB integration
8
+ - MCP server using Streamable HTTP
9
+ - Separate MCP child process managed by NodeBB
10
+ - Bearer token authentication
11
+ - Internal API authentication between MCP and NodeBB
12
+ - OpenAI embeddings
13
+ - Qdrant vector storage and semantic search
14
+ - RAG retrieval with NodeBB access control
15
+ - Individual post indexing, including replies
16
+ - Configurable excluded categories
17
+ - OpenAI and Fake AI provider modes
18
+ - ACP configuration interface
19
+ - Automated tests
20
+
21
+ ## Architecture
22
+
23
+ NodeBB → Integration Plugin → MCP / AI
24
+
25
+ MCP: Streamable HTTP → MCP Child Process → Internal NodeBB API → NodeBB Access Control
26
+
27
+ AI: OpenAI → Embeddings → Qdrant → Vector Search → Knowledge Retrieval
28
+
29
+ ## Requirements
30
+
31
+ - Node.js >= 20
32
+ - npm >= 10
33
+ - NodeBB 4.x
34
+
35
+ AI functionality requires an OpenAI API key and a Qdrant server. MCP requires a running NodeBB instance.
36
+
37
+ ## Installation
38
+
39
+ Install the plugin using the NodeBB plugin management interface or your usual NodeBB plugin installation procedure.
40
+
41
+ Install dependencies in the plugin directory using npm install.
42
+
43
+ Restart NodeBB and configure the plugin in ACP → Plugins → NodeBB Integration.
44
+
45
+ ## Configuration
46
+
47
+ The plugin is configured through the NodeBB ACP interface.
48
+
49
+ ### AI Provider
50
+
51
+ Two providers are available.
52
+
53
+ **OpenAI**
54
+
55
+ Enables:
56
+ - OpenAI embedding generation
57
+ - Qdrant vector storage
58
+ - Post indexing
59
+ - Semantic search
60
+ - RAG retrieval
61
+
62
+ Configure the OpenAI API key, embedding model, embedding dimensions, Qdrant URL and collection name.
63
+
64
+ **Fake**
65
+
66
+ Disables AI functionality completely:
67
+ - OpenAI API is not called.
68
+ - Qdrant is not accessed.
69
+ - Embeddings are not generated.
70
+ - Post indexing is disabled.
71
+ - Semantic search is disabled.
72
+
73
+ NodeBB integration and MCP remain available.
74
+
75
+ OpenAI and Qdrant settings are preserved when switching providers. Selecting OpenAI again re-enables the AI pipeline.
76
+
77
+ Fake mode is useful for developing and testing the NodeBB and MCP integration without external AI services.
78
+
79
+ ### Excluded Categories
80
+
81
+ Categories selected in ACP are excluded from AI indexing and semantic search.
82
+
83
+ ## AI Pipeline
84
+
85
+ When OpenAI is enabled:
86
+
87
+ Forum Post → Embedding Generation → Qdrant Vector Storage → Semantic Search → NodeBB Access Control → Knowledge Retrieval
88
+
89
+ Each post is indexed independently, including replies.
90
+
91
+ Search results are checked against NodeBB permissions before post content is retrieved. Posts and topics that the service user cannot read are excluded.
92
+
93
+ Qdrant stores vectors and metadata only. Post text is retrieved from NodeBB after access checks.
94
+
95
+ ## Qdrant
96
+
97
+ Configure the Qdrant URL, collection name and embedding dimensions through ACP.
98
+
99
+ The plugin checks whether the collection exists and creates it when necessary.
100
+
101
+ Qdrant is not accessed when Fake is selected.
102
+
103
+ ## MCP Server
104
+
105
+ The MCP server is managed by the NodeBB plugin and runs as a separate child process.
106
+
107
+ Transport:
108
+ - Streamable HTTP
109
+ - Bearer token authentication
110
+
111
+ The MCP server communicates with NodeBB through an authenticated internal API using a separate secret managed by the plugin.
112
+
113
+ Configure in ACP:
114
+ - Enable or disable MCP
115
+ - Bind address
116
+ - Port
117
+ - NodeBB URL
118
+ - Bearer token
119
+ - Service user UID
120
+
121
+ The service user UID is configured by the administrator. MCP clients cannot override it.
122
+
123
+ ### Available Tools
124
+
125
+ - get_forum_info — Get public forum information.
126
+ - get_post — Retrieve a post after access checks.
127
+ - get_topic — Retrieve a topic after access checks.
128
+ - get_user — Retrieve public user information.
129
+ - search_knowledge — Search indexed forum knowledge.
130
+
131
+ search_knowledge requires the OpenAI provider. In Fake mode, it returns an explicit AI-disabled error.
132
+
133
+ ## Security
134
+
135
+ - MCP clients authenticate using a Bearer token.
136
+ - Internal API requests use a separate secret.
137
+ - Secret values are never returned to the ACP interface.
138
+ - Empty secret fields preserve existing values.
139
+ - User IDs supplied by MCP clients are not trusted.
140
+ - The configured service user is used for access checks.
141
+ - Post and topic permissions are checked before content is returned.
142
+ - Access-check failures deny access.
143
+ - Qdrant payloads contain identifiers and metadata, not post text.
144
+
145
+ Never commit API keys, tokens or other secrets.
146
+
147
+ ## Development and Testing
148
+
149
+ Install dependencies: npm install
150
+
151
+ Syntax checks: npm run check
152
+
153
+ Tests: npm test
154
+
155
+
156
+ The test suite validates configuration, MCP tool arguments and other plugin components.
157
+
158
+ ## Project Structure
159
+
160
+ library.js
161
+ package.json
162
+ plugin.json
163
+ public/
164
+ js/admin.js
165
+ templates/admin/plugins/integration.tpl
166
+ src/
167
+ ai/
168
+ embeddings.js
169
+ indexer.js
170
+ openai.js
171
+ qdrant.js
172
+ search.js
173
+ config/
174
+ index.js
175
+ validation.js
176
+ events/
177
+ index.js
178
+ mcp/
179
+ manager.js
180
+ server.js
181
+ tools.js
182
+ nodebb/
183
+ categories.js
184
+ index.js
185
+ meta.js
186
+ posts.js
187
+ privileges.js
188
+ topics.js
189
+ users.js
190
+ routes/
191
+ api.js
192
+ index.js
193
+ test/
194
+ config-validation.test.js
195
+ mcp-tools.test.js
196
+
197
+ ## License
198
+
199
+ MIT