nodebb-plugin-integration 0.4.4 → 0.6.0

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,199 +1,210 @@
1
- # NodeBB Integration Layer
1
+ # NodeBB Integration
2
2
 
3
- Integration plugin for NodeBB forums providing MCP (Model Context Protocol), AI-powered semantic search, RAG retrieval and Qdrant vector storage.
3
+ AI and MCP integration layer for NodeBB.
4
4
 
5
- ## Features
5
+ The plugin connects NodeBB to AI-powered semantic search and exposes forum functionality to external AI clients through the Model Context Protocol (MCP).
6
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
7
+ - **Version:** 0.6.0
8
+ - **License:** MIT
9
+ - **NodeBB:** 4.x
10
+ - **Node.js:** >= 22
20
11
 
21
- ## Architecture
12
+ ## Features
22
13
 
23
- NodeBB → Integration Plugin → MCP / AI
14
+ - MCP server using Streamable HTTP transport.
15
+ - Separate MCP child process managed by the plugin.
16
+ - Bearer-token authentication for MCP clients.
17
+ - Separate authentication token for the internal NodeBB API.
18
+ - Configurable MCP bind address, port and service account.
19
+ - 15 MCP tools for forum information, reading, searching and content management.
20
+ - OpenAI embedding generation and semantic search.
21
+ - Qdrant vector database integration.
22
+ - Permission-aware retrieval: search results are filtered using NodeBB access permissions.
23
+ - Individual post indexing and category exclusions.
24
+ - OpenAI and Fake AI provider modes.
25
+ - NodeBB ACP configuration interface.
26
+ - Automated tests for API handlers and MCP tools.
24
27
 
25
- MCP: Streamable HTTP → MCP Child Process → Internal NodeBB API → NodeBB Access Control
28
+ ## Requirements
26
29
 
27
- AI: OpenAI → Embeddings → Qdrant → Vector Search → Knowledge Retrieval
30
+ - Node.js >= 22.
31
+ - npm >= 10.
32
+ - NodeBB 4.x.
33
+ - A running NodeBB instance.
28
34
 
29
- ## Requirements
35
+ Additional services are required for AI semantic search:
30
36
 
31
- - Node.js >= 20
32
- - npm >= 10
33
- - NodeBB 4.x
37
+ - An OpenAI API key.
38
+ - A reachable Qdrant instance and collection configured for the plugin's embedding model.
34
39
 
35
- AI functionality requires an OpenAI API key and a Qdrant server. MCP requires a running NodeBB instance.
40
+ MCP can be used independently of semantic search. The `search_knowledge` tool requires the OpenAI provider and Qdrant.
36
41
 
37
42
  ## Installation
38
43
 
39
- Install the plugin using the NodeBB plugin management interface or your usual NodeBB plugin installation procedure.
44
+ Install the plugin using the NodeBB administration interface or the standard NodeBB plugin installation procedure.
45
+
46
+ For a manual installation:
40
47
 
41
- Install dependencies in the plugin directory using npm install.
48
+ ```bash
49
+ cd /path/to/nodebb
50
+ npm install nodebb-plugin-integration
51
+ ```
42
52
 
43
- Restart NodeBB and configure the plugin in ACP → Plugins → NodeBB Integration.
53
+ Build and restart NodeBB using the standard procedure for your installation.
54
+
55
+ After installation, open:
56
+
57
+ **NodeBB ACP → Plugins → NodeBB Integration**
58
+
59
+ Configure the required options and save the settings.
44
60
 
45
61
  ## Configuration
46
62
 
47
- The plugin is configured through the NodeBB ACP interface.
63
+ The plugin configuration is managed through the NodeBB ACP.
48
64
 
49
- ### AI Provider
65
+ ### AI provider
50
66
 
51
- Two providers are available.
67
+ The plugin supports two provider modes:
52
68
 
53
- **OpenAI**
69
+ - **OpenAI** — enables embeddings and semantic search.
70
+ - **Fake** — disables calls to the OpenAI service. Semantic search is unavailable in this mode.
54
71
 
55
- Enables:
56
- - OpenAI embedding generation
57
- - Qdrant vector storage
58
- - Post indexing
59
- - Semantic search
60
- - RAG retrieval
72
+ For semantic search, configure the OpenAI API key, embedding settings and Qdrant connection according to your deployment.
61
73
 
62
- Configure the OpenAI API key, embedding model, embedding dimensions, Qdrant URL and collection name.
74
+ ### Search and indexing
63
75
 
64
- **Fake**
76
+ The plugin uses embeddings to index forum content and Qdrant to store and retrieve vectors.
65
77
 
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.
78
+ Search results are not returned solely on the basis of vector similarity. Before returning a result, the plugin checks whether the configured NodeBB service user can read the corresponding post and topic.
72
79
 
73
- NodeBB integration and MCP remain available.
80
+ Excluded Categories allows selected categories to be omitted from semantic search.
74
81
 
75
- OpenAI and Qdrant settings are preserved when switching providers. Selecting OpenAI again re-enables the AI pipeline.
82
+ The plugin validates retrieved post metadata against NodeBB before returning post content. Qdrant is used as the vector index; NodeBB remains the source of post content and access permissions.
76
83
 
77
- Fake mode is useful for developing and testing the NodeBB and MCP integration without external AI services.
84
+ ### MCP server
78
85
 
79
- ### Excluded Categories
86
+ MCP settings include:
80
87
 
81
- Categories selected in ACP are excluded from AI indexing and semantic search.
88
+ | Setting | Description |
89
+ |---|---|
90
+ | Enable MCP | Enables or disables the MCP server |
91
+ | Bind address | Address on which the MCP HTTP server listens |
92
+ | Port | MCP HTTP port |
93
+ | NodeBB URL | Internal URL used by the MCP process to reach NodeBB |
94
+ | Bearer token | Authentication token for MCP clients |
95
+ | Service user UID | NodeBB account used for permission checks and write operations |
82
96
 
83
- ## AI Pipeline
97
+ Default MCP connection settings:
84
98
 
85
- When OpenAI is enabled:
99
+ ```text
100
+ Bind address: 127.0.0.1
101
+ Port: 3100
102
+ NodeBB URL: http://127.0.0.1:4567
103
+ ```
86
104
 
87
- Forum Post → Embedding Generation → Qdrant Vector Storage → Semantic Search → NodeBB Access Control → Knowledge Retrieval
105
+ The default bind address restricts the MCP listener to localhost. Change it only when remote access is intentionally required and the network exposure is secured.
88
106
 
89
- Each post is indexed independently, including replies.
107
+ The plugin automatically generates a separate random token for its internal API. This token is distinct from the MCP client Bearer token and is not intended to be shared with clients.
90
108
 
91
- Search results are checked against NodeBB permissions before post content is retrieved. Posts and topics that the service user cannot read are excluded.
109
+ The configured service user is the actor for MCP operations. A client cannot override the acting UID.
92
110
 
93
- Qdrant stores vectors and metadata only. Post text is retrieved from NodeBB after access checks.
111
+ ## MCP tools
94
112
 
95
- ## Qdrant
113
+ The MCP server provides 15 tools:
96
114
 
97
- Configure the Qdrant URL, collection name and embedding dimensions through ACP.
115
+ | Tool | Description |
116
+ |---|---|
117
+ | `get_forum_info` | Get public forum information |
118
+ | `get_post` | Read a post |
119
+ | `get_topic` | Read topic metadata |
120
+ | `get_user` | Read public user profile fields |
121
+ | `search_knowledge` | Search indexed forum content semantically |
122
+ | `create_topic` | Create a topic |
123
+ | `delete_topic` | Soft-delete a topic |
124
+ | `restore_topic` | Restore a topic |
125
+ | `list_topics` | List accessible topics |
126
+ | `create_post` | Create a reply |
127
+ | `edit_post` | Edit a post |
128
+ | `delete_post` | Soft-delete a post |
129
+ | `restore_post` | Restore a post |
130
+ | `delete_user_posts` | Soft-delete a user's replies in batches |
131
+ | `list_posts` | List posts in a topic |
98
132
 
99
- The plugin checks whether the collection exists and creates it when necessary.
133
+ All write operations use native NodeBB methods and permission checks.
100
134
 
101
- Qdrant is not accessed when Fake is selected.
135
+ Deletion tools perform soft deletion, not permanent data removal. `delete_user_posts` skips the first post of every topic. Restoring a topic does not automatically restore posts that were separately deleted.
102
136
 
103
- ## MCP Server
137
+ See the complete reference for argument schemas, defaults, limits, response fields, permissions, pagination and examples:
104
138
 
105
- The MCP server is managed by the NodeBB plugin and runs as a separate child process.
139
+ - [MCP API Reference (English)](docs/MCP.md)
140
+ - [Справочник MCP API (Русский)](docs/MCP.ru.md)
106
141
 
107
- Transport:
108
- - Streamable HTTP
109
- - Bearer token authentication
142
+ ## Security
110
143
 
111
- The MCP server communicates with NodeBB through an authenticated internal API using a separate secret managed by the plugin.
144
+ - MCP clients must authenticate with a Bearer token.
145
+ - The internal NodeBB API uses a separate automatically generated token.
146
+ - Internal API routes require authentication and are disabled when MCP is disabled.
147
+ - The default MCP bind address is `127.0.0.1`.
148
+ - The configured service user determines the permissions available to MCP operations.
149
+ - Read operations apply NodeBB access checks.
150
+ - Semantic search filters results by the service user's permissions.
151
+ - Public user lookup returns only the selected profile fields.
152
+ - Secret values are not included in the plugin's public configuration information.
112
153
 
113
- Configure in ACP:
114
- - Enable or disable MCP
115
- - Bind address
116
- - Port
117
- - NodeBB URL
118
- - Bearer token
119
- - Service user UID
154
+ Use a dedicated NodeBB service account with only the permissions required for the intended MCP operations. Do not expose the internal API token.
120
155
 
121
- The service user UID is configured by the administrator. MCP clients cannot override it.
156
+ ## Development
122
157
 
123
- ### Available Tools
158
+ Install dependencies:
124
159
 
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.
160
+ ```bash
161
+ npm install
162
+ ```
130
163
 
131
- search_knowledge requires the OpenAI provider. In Fake mode, it returns an explicit AI-disabled error.
164
+ Run syntax checks:
132
165
 
133
- ## Security
166
+ ```bash
167
+ npm run check
168
+ ```
169
+
170
+ Run the test suite:
171
+
172
+ ```bash
173
+ npm test
174
+ ```
175
+
176
+ The tests cover API authentication, API handlers, argument validation and MCP tool behavior.
177
+
178
+ ## Project structure
179
+
180
+ ```text
181
+ .
182
+ ├── library.js
183
+ ├── plugin.json
184
+ ├── package.json
185
+ ├── README.md
186
+ ├── README.ru.md
187
+ ├── docs/
188
+ │ ├── MCP.md
189
+ │ └── MCP.ru.md
190
+ ├── src/
191
+ │ ├── ai/
192
+ │ ├── config/
193
+ │ ├── mcp/
194
+ │ ├── nodebb/
195
+ │ └── routes/
196
+ ├── public/
197
+ ├── languages/
198
+ └── test/
199
+ ```
200
+
201
+ ## Compatibility
202
+
203
+ Designed for NodeBB 4.x.
204
+ Version 0.6.0 has been tested with NodeBB 4.16.7.
134
205
 
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
206
+ The plugin requires Node.js >= 22. Native NodeBB response fields may vary between NodeBB versions.
196
207
 
197
208
  ## License
198
209
 
199
- MIT
210
+ MIT