opalserve 3.0.1 → 3.1.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.
Files changed (41) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +568 -545
  3. package/assets/logo.svg +51 -51
  4. package/dist/cli/commands/admin.js +6 -6
  5. package/dist/cli/commands/context.d.ts.map +1 -1
  6. package/dist/cli/commands/context.js +9 -2
  7. package/dist/cli/commands/context.js.map +1 -1
  8. package/dist/cli/index.js +2 -1
  9. package/dist/cli/index.js.map +1 -1
  10. package/dist/cli/ui/banner.d.ts.map +1 -1
  11. package/dist/cli/ui/banner.js +15 -14
  12. package/dist/cli/ui/banner.js.map +1 -1
  13. package/dist/constants.d.ts +1 -1
  14. package/dist/constants.js +1 -1
  15. package/dist/context/index.js +1 -1
  16. package/dist/core/server-manager.d.ts.map +1 -1
  17. package/dist/core/server-manager.js +2 -1
  18. package/dist/core/server-manager.js.map +1 -1
  19. package/dist/dashboard/assets/charts-CKTlvUso.js +68 -0
  20. package/dist/dashboard/assets/icons-DciuKSzL.js +131 -0
  21. package/dist/dashboard/assets/index-BrOv-3xx.css +1 -0
  22. package/dist/dashboard/assets/index-DnqqzxX6.js +33 -0
  23. package/dist/dashboard/assets/react-BJczIp53.js +28 -0
  24. package/dist/dashboard/index.html +17 -14
  25. package/dist/integrations/github.js +3 -3
  26. package/dist/integrations/slack.js +1 -1
  27. package/dist/monitoring/tracker.js +13 -13
  28. package/dist/server/mcp-gateway.d.ts.map +1 -1
  29. package/dist/server/mcp-gateway.js +2 -1
  30. package/dist/server/mcp-gateway.js.map +1 -1
  31. package/dist/server/routes/context.js +1 -1
  32. package/dist/server/routes/health.d.ts.map +1 -1
  33. package/dist/server/routes/health.js +2 -1
  34. package/dist/server/routes/health.js.map +1 -1
  35. package/dist/server/routes/stats.js +6 -6
  36. package/dist/storage/database.d.ts.map +1 -1
  37. package/dist/storage/database.js +132 -129
  38. package/dist/storage/database.js.map +1 -1
  39. package/package.json +91 -91
  40. package/dist/dashboard/assets/index-BNOtcUPs.js +0 -257
  41. package/dist/dashboard/assets/index-Duwp34GW.css +0 -1
package/README.md CHANGED
@@ -1,569 +1,592 @@
1
- <p align="center">
2
- <img src="assets/banner.svg" alt="OpalServe" width="800" />
3
- </p>
4
-
5
- <p align="center">
6
- <strong>The control plane for your team's AI tools</strong>
7
- </p>
8
-
9
- <p align="center">
10
- <a href="https://www.npmjs.com/package/opalserve"><img src="https://img.shields.io/npm/v/opalserve?style=flat-square&color=F97316" alt="npm version" /></a>
11
- <a href="https://www.npmjs.com/package/opalserve"><img src="https://img.shields.io/npm/dm/opalserve?style=flat-square" alt="downloads" /></a>
12
- <a href="https://github.com/adityaidev/opalserve/blob/master/LICENSE"><img src="https://img.shields.io/github/license/adityaidev/opalserve?style=flat-square" alt="license" /></a>
13
- <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square" alt="node version" /></a>
14
- <a href="https://github.com/adityaidev/opalserve"><img src="https://img.shields.io/github/stars/adityaidev/opalserve?style=flat-square" alt="GitHub stars" /></a>
15
- </p>
16
-
17
- ---
18
-
19
- **OpalServe** is an open-source platform that gives engineering teams a single place to register, discover, and govern the MCP (Model Context Protocol) servers their AI coding tools depend on. Instead of every developer manually configuring Claude Desktop, Cursor, Codex, or Windsurf with scattered server definitions, OpalServe provides a centralized registry with shared knowledge bases, usage analytics, role-based access control, and a built-in MCP gateway -- so your team's AI tools stay consistent, observable, and secure.
20
-
21
- ---
22
-
23
- ## Feature Highlights
24
-
25
- | | Feature | Description |
26
- |---|---|---|
27
- | :books: | **Team MCP Registry** | Admin registers servers once; every developer pulls them with `opalserve sync` |
28
- | :brain: | **Shared Knowledge Base** | Upload architecture docs, coding standards, and API specs -- AI tools query them automatically via MCP |
29
- | :bar_chart: | **Usage Analytics Dashboard** | React SPA showing tool calls, token usage, active users, and error rates in real time |
30
- | :lock: | **Auth & Access Control** | User accounts, JWT tokens, API keys, rate limits, and per-role tool permissions |
31
- | :electric_plug: | **GitHub + Slack Integrations** | Webhooks auto-update context; Slack slash commands for search and notifications |
32
- | :globe_with_meridians: | **MCP Gateway** | OpalServe itself is an MCP server -- connect any AI client to access every tool from one endpoint |
33
- | :art: | **Beautiful CLI** | Interactive setup wizard, gradient banners, color-coded tables, 20+ commands |
34
- | :seedling: | **100% Open Source** | MIT licensed, self-host for free, no vendor lock-in |
35
-
36
- ---
37
-
38
- ## Architecture
39
-
40
- ```
41
- ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
42
- │ GitHub │ │ Slack │ │ Filesystem │ │ PostgreSQL │
43
- │ MCP Server │ │ MCP Server │ │ MCP Server │ │ MCP Server │
44
- └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
45
- │ │ │ │
46
- └────────────────┼────────────────┼────────────────┘
47
- │ MCP Protocol (stdio / SSE)
48
-
49
- ┌──────────┴──────────────────────────────┐
50
- │ OpalServe Team Server │
51
- │ │
52
- │ ┌─────────────┐ ┌──────────────────┐ │
53
- │ │ MCP Server │ │ Shared Knowledge │ │
54
- │ │ Registry │ │ Base (FTS) │ │
55
- │ └─────────────┘ └──────────────────┘ │
56
- │ ┌─────────────┐ ┌──────────────────┐ │
57
- │ │ Usage │ │ Auth / API Keys │ │
58
- │ │ Analytics │ │ Rate Limiting │ │
59
- │ └─────────────┘ └──────────────────┘ │
60
- │ ┌─────────────┐ ┌──────────────────┐ │
61
- │ │ MCP Gateway │ │ React Dashboard │ │
62
- │ │ (stdio/SSE) │ │ (/dashboard) │ │
63
- │ └─────────────┘ └──────────────────┘ │
64
- │ │
65
- │ SQLite DB ── Fastify HTTP API (:3456) │
66
- └──────────────────┬──────────────────────┘
67
-
68
- HTTPS API + MCP Protocol (stdio / SSE)
69
-
70
- ┌──────────────────────┼──────────────────────┐
71
- │ │ │
72
- ┌────────┴─────────┐ ┌────────┴─────────┐ ┌────────┴─────────┐
73
- │ Dev A │ │ Dev B │ │ Dev C │
74
- │ Claude Code │ │ Cursor │ │ Codex / Windsurf │
75
- │ opalserve sync │ │ opalserve sync │ │ opalserve sync │
76
- └──────────────────┘ └──────────────────┘ └──────────────────┘
77
- ```
78
-
79
- ---
80
-
1
+ <p align="center">
2
+ <img src="assets/banner.svg" alt="OpalServe" width="800" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>The control plane for your team's AI tools</strong>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/opalserve"><img src="https://img.shields.io/npm/v/opalserve?style=flat-square&color=F97316" alt="npm version" /></a>
11
+ <a href="https://www.npmjs.com/package/opalserve"><img src="https://img.shields.io/npm/dm/opalserve?style=flat-square" alt="downloads" /></a>
12
+ <a href="https://github.com/adityaidev/opalserve/blob/master/LICENSE"><img src="https://img.shields.io/github/license/adityaidev/opalserve?style=flat-square" alt="license" /></a>
13
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square" alt="node version" /></a>
14
+ <a href="https://github.com/adityaidev/opalserve"><img src="https://img.shields.io/github/stars/adityaidev/opalserve?style=flat-square" alt="GitHub stars" /></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ **OpalServe** is an open-source platform that gives engineering teams a single place to register, discover, and govern the MCP (Model Context Protocol) servers their AI coding tools depend on. Instead of every developer manually configuring Claude Desktop, Cursor, Codex, or Windsurf with scattered server definitions, OpalServe provides a centralized registry with shared knowledge bases, usage analytics, role-based access control, and a built-in MCP gateway -- so your team's AI tools stay consistent, observable, and secure.
20
+
21
+ ---
22
+
23
+ ## Feature Highlights
24
+
25
+ | | Feature | Description |
26
+ |---|---|---|
27
+ | :books: | **Team MCP Registry** | Admin registers servers once; every developer pulls them with `opalserve sync` |
28
+ | :brain: | **Shared Knowledge Base** | Upload architecture docs, coding standards, and API specs -- AI tools query them automatically via MCP |
29
+ | :bar_chart: | **Usage Analytics Dashboard** | React SPA showing tool calls, token usage, active users, and error rates in real time |
30
+ | :lock: | **Auth & Access Control** | User accounts, JWT tokens, API keys, rate limits, and per-role tool permissions |
31
+ | :electric_plug: | **GitHub + Slack Integrations** | Webhooks auto-update context; Slack slash commands for search and notifications |
32
+ | :globe_with_meridians: | **MCP Gateway** | OpalServe itself is an MCP server -- connect any AI client to access every tool from one endpoint |
33
+ | :art: | **Beautiful CLI** | Interactive setup wizard, gradient banners, color-coded tables, 20+ commands |
34
+ | :seedling: | **100% Open Source** | MIT licensed, self-host for free, no vendor lock-in |
35
+
36
+ ---
37
+
38
+ ## Architecture
39
+
40
+ ```
41
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
42
+ │ GitHub │ │ Slack │ │ Filesystem │ │ PostgreSQL │
43
+ │ MCP Server │ │ MCP Server │ │ MCP Server │ │ MCP Server │
44
+ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
45
+ │ │ │ │
46
+ └────────────────┼────────────────┼────────────────┘
47
+ │ MCP Protocol (stdio / SSE)
48
+
49
+ ┌──────────┴──────────────────────────────┐
50
+ │ OpalServe Team Server │
51
+ │ │
52
+ │ ┌─────────────┐ ┌──────────────────┐ │
53
+ │ │ MCP Server │ │ Shared Knowledge │ │
54
+ │ │ Registry │ │ Base (FTS) │ │
55
+ │ └─────────────┘ └──────────────────┘ │
56
+ │ ┌─────────────┐ ┌──────────────────┐ │
57
+ │ │ Usage │ │ Auth / API Keys │ │
58
+ │ │ Analytics │ │ Rate Limiting │ │
59
+ │ └─────────────┘ └──────────────────┘ │
60
+ │ ┌─────────────┐ ┌──────────────────┐ │
61
+ │ │ MCP Gateway │ │ React Dashboard │ │
62
+ │ │ (stdio/SSE) │ │ (/dashboard) │ │
63
+ │ └─────────────┘ └──────────────────┘ │
64
+ │ │
65
+ │ SQLite DB ── Fastify HTTP API (:3456) │
66
+ └──────────────────┬──────────────────────┘
67
+
68
+ HTTPS API + MCP Protocol (stdio / SSE)
69
+
70
+ ┌──────────────────────┼──────────────────────┐
71
+ │ │ │
72
+ ┌────────┴─────────┐ ┌────────┴─────────┐ ┌────────┴─────────┐
73
+ │ Dev A │ │ Dev B │ │ Dev C │
74
+ │ Claude Code │ │ Cursor │ │ Codex / Windsurf │
75
+ │ opalserve sync │ │ opalserve sync │ │ opalserve sync │
76
+ └──────────────────┘ └──────────────────┘ └──────────────────┘
77
+ ```
78
+
79
+ ---
80
+
81
81
  ## Quick Start
82
82
 
83
83
  ```bash
84
84
  # 1. Install globally
85
85
  npm install -g opalserve
86
-
87
- # 2. Run the interactive setup wizard
88
- opalserve init
89
-
90
- # 3. Start the server
91
- opalserve start
92
-
93
- # 4. Register your first MCP server
94
- opalserve server add --name files --stdio "npx -y @modelcontextprotocol/server-filesystem ."
95
-
96
- # 5. Discover available tools
86
+
87
+ # 2. Run the interactive setup wizard
88
+ opalserve init
89
+
90
+ # 3. Start the server
91
+ opalserve start
92
+
93
+ # 4. Register your first MCP server
94
+ opalserve server add --name files --stdio "npx -y @modelcontextprotocol/server-filesystem ."
95
+
96
+ # 5. Discover available tools
97
97
  opalserve tools search "read file"
98
98
  ```
99
99
 
100
- > **Tip:** OpalServe runs on port **3456** by default. Visit `http://localhost:3456/dashboard` after starting.
101
-
102
- ---
100
+ > **Tip:** OpalServe runs on port **3456** by default. The dashboard ships inside the npm package and is served from `http://localhost:3456/dashboard` after starting.
103
101
 
104
- ## Team Mode Setup
102
+ ## Trust Check
105
103
 
106
- Team mode turns OpalServe into a shared server that your entire engineering org connects to.
107
-
108
- ### 1. Initialize the team server
104
+ OpalServe 3.1.0 is the trust-launch release: runtime versions, package metadata, docs, CI, and dashboard packaging are aligned so the install path matches the README.
109
105
 
110
106
  ```bash
111
- opalserve admin init
112
- ```
113
-
114
- This creates an admin account, generates encryption keys, and prepares the SQLite database.
115
-
116
- ### 2. Configure team mode
117
-
118
- Edit `opalserve.config.json` and set the mode:
119
-
120
- ```json
121
- {
122
- "mode": "team-server",
123
- "port": 3456,
124
- "host": "0.0.0.0"
125
- }
126
- ```
127
-
128
- ### 3. Start the server
107
+ opalserve --version
108
+ # 3.1.0
129
109
 
130
- ```bash
131
110
  opalserve start
111
+ # HTTP API http://127.0.0.1:3456
112
+ # Dashboard http://127.0.0.1:3456/dashboard
132
113
  ```
133
114
 
134
- ### 4. Invite team members
135
-
136
- ```bash
137
- opalserve admin invite alice@company.com
138
- opalserve admin invite bob@company.com
139
- ```
140
-
141
- ### 5. Developers connect
142
-
143
- On each developer's machine:
144
-
145
- ```bash
146
- npm install -g opalserve
147
-
148
- # Login to the team server
149
- opalserve login
150
-
151
- # Pull all registered servers to local config
152
- opalserve sync
153
- ```
154
-
155
- ### 6. Manage access
156
-
157
- ```bash
158
- # Set rate limits by role
159
- opalserve admin limits --set developer:calls_per_hour:500
160
-
161
- # Set tool permissions
162
- opalserve admin permissions --set developer:filesystem:*:allow
163
- ```
164
-
165
- ---
166
-
167
- ## Knowledge Base
168
-
169
- The knowledge base lets you upload documents that become searchable context for every AI tool connected through OpalServe.
170
-
171
- ### Adding documents
115
+ For source builds, the same release checks are used locally and in CI:
172
116
 
173
117
  ```bash
174
- # Upload architecture docs
175
- opalserve context add ./docs/architecture.md
176
-
177
- # Upload API specifications
178
- opalserve context add ./docs/api-spec.md
179
-
180
- # Upload coding standards
181
- opalserve context add ./docs/coding-standards.md
182
- ```
183
-
184
- ### Searching context
185
-
186
- ```bash
187
- # Search by natural language query
188
- opalserve context search "authentication flow"
189
-
190
- # List all uploaded documents
191
- opalserve context list
192
-
193
- # Remove a document
194
- opalserve context remove <document-id>
195
- ```
196
-
197
- When connected via the MCP gateway, AI tools like Claude Desktop can automatically search the knowledge base to ground their responses in your team's actual documentation.
198
-
199
- ---
200
-
201
- ## Admin Dashboard
202
-
203
- OpalServe ships with a built-in React SPA accessible at `/dashboard` when the server is running.
204
-
205
- The dashboard provides:
206
-
207
- - **Usage overview** -- charts for tool calls, token consumption, and active users over time
208
- - **Server monitoring** -- live status of every registered MCP server with health indicators
209
- - **User management** -- view team members, roles, and activity
210
- - **Tool browser** -- searchable catalog of all discovered tools across servers
211
- - **Knowledge base manager** -- upload, browse, and remove context documents
212
- - **Settings** -- API key management, integration configuration, rate limits
213
-
214
- ```
215
- http://localhost:3456/dashboard
216
- ```
217
-
218
- > The dashboard is available in team-server mode. Authentication is required for all management operations.
219
-
220
- ---
221
-
222
- ## CLI Commands
223
-
224
- | Command | Description |
225
- |---|---|
226
- | `opalserve init` | Interactive setup wizard -- configures mode, port, and first server |
227
- | `opalserve start` | Start the registry server (HTTP API + MCP gateway) |
228
- | `opalserve status` | Show server status, connected servers, and tool counts |
229
- | `opalserve health` | Health check all registered servers |
230
- | `opalserve health --server <name>` | Health check a specific server |
231
- | `opalserve login` | Authenticate with a team server |
232
- | `opalserve logout` | Clear stored credentials |
233
- | `opalserve whoami` | Show current authenticated user info |
234
- | `opalserve sync` | Pull team server configurations to local machine |
235
- | `opalserve server list` | List all registered MCP servers |
236
- | `opalserve server add` | Register a new MCP server (stdio, SSE, or streamable-http) |
237
- | `opalserve server remove <name>` | Remove a registered server |
238
- | `opalserve tools list` | List all discovered tools across servers |
239
- | `opalserve tools search <query>` | Search for tools by natural language query |
240
- | `opalserve context add <file>` | Upload a file to the shared knowledge base |
241
- | `opalserve context list` | List all context documents |
242
- | `opalserve context search <query>` | Search the knowledge base |
243
- | `opalserve context remove <id>` | Remove a context document |
244
- | `opalserve admin init` | Initialize team mode with an admin user |
245
- | `opalserve admin stats` | Show usage statistics for the team |
246
- | `opalserve admin users` | List all team members |
247
- | `opalserve admin invite <email>` | Invite a user to the team |
248
- | `opalserve admin limits` | View and manage rate limits |
249
- | `opalserve admin permissions` | View and manage tool permissions |
250
-
251
- ---
252
-
253
- ## HTTP API
254
-
255
- OpalServe exposes a RESTful API under `/api/v1`. All endpoints return JSON.
256
-
257
- ### Health
258
-
259
- ```bash
260
- curl http://localhost:3456/api/v1/health
261
- ```
262
-
263
- ### Servers
264
-
265
- ```bash
266
- # List all servers
267
- curl http://localhost:3456/api/v1/servers
268
-
269
- # Register a new server
270
- curl -X POST http://localhost:3456/api/v1/servers \
271
- -H "Content-Type: application/json" \
272
- -d '{
273
- "name": "filesystem",
274
- "transport": {
275
- "type": "stdio",
276
- "command": "npx",
277
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
278
- }
279
- }'
280
-
281
- # Remove a server
282
- curl -X DELETE http://localhost:3456/api/v1/servers/filesystem
283
-
284
- # Health check a specific server
285
- curl http://localhost:3456/api/v1/servers/filesystem/health
286
- ```
287
-
288
- ### Tools
289
-
290
- ```bash
291
- # List all tools
292
- curl http://localhost:3456/api/v1/tools
293
-
294
- # Search tools
295
- curl "http://localhost:3456/api/v1/tools/search?q=read+file&limit=5"
296
-
297
- # Call a tool
298
- curl -X POST http://localhost:3456/api/v1/tools/filesystem__read_file/call \
299
- -H "Content-Type: application/json" \
300
- -d '{"arguments": {"path": "./README.md"}}'
301
- ```
302
-
303
- ### Authentication (team mode)
304
-
305
- ```bash
306
- # Register
307
- curl -X POST http://localhost:3456/api/v1/auth/register \
308
- -H "Content-Type: application/json" \
309
- -d '{"email": "dev@company.com", "password": "...", "name": "Alice"}'
310
-
311
- # Login
312
- curl -X POST http://localhost:3456/api/v1/auth/login \
313
- -H "Content-Type: application/json" \
314
- -d '{"email": "dev@company.com", "password": "..."}'
315
-
316
- # Get current user
317
- curl http://localhost:3456/api/v1/auth/me \
318
- -H "Authorization: Bearer <token>"
319
-
320
- # Create API key
321
- curl -X POST http://localhost:3456/api/v1/auth/keys \
322
- -H "Authorization: Bearer <token>" \
323
- -H "Content-Type: application/json" \
324
- -d '{"name": "ci-pipeline"}'
325
- ```
326
-
327
- ### Knowledge Base (team mode)
328
-
329
- ```bash
330
- # Upload a document
331
- curl -X POST http://localhost:3456/api/v1/context/documents \
332
- -H "Authorization: Bearer <token>" \
333
- -H "Content-Type: application/json" \
334
- -d '{"title": "Architecture", "content": "...", "type": "markdown"}'
335
-
336
- # Search documents
337
- curl "http://localhost:3456/api/v1/context/search?q=authentication+flow" \
338
- -H "Authorization: Bearer <token>"
339
- ```
340
-
341
- ### Usage Stats (team mode)
342
-
343
- ```bash
344
- # Overview
345
- curl http://localhost:3456/api/v1/stats/overview \
346
- -H "Authorization: Bearer <token>"
347
- ```
348
-
349
- ---
350
-
351
- ## Library Usage
352
-
353
- Use OpalServe programmatically in your Node.js applications:
354
-
355
- ```typescript
356
- import {
357
- OpalServeRegistry,
358
- McpGateway,
359
- KnowledgeBase,
360
- UsageTracker,
361
- } from 'opalserve';
362
-
363
- // Create the registry with server definitions
364
- const registry = await OpalServeRegistry.create({
365
- servers: [
366
- {
367
- name: 'filesystem',
368
- transport: {
369
- type: 'stdio',
370
- command: 'npx',
371
- args: ['-y', '@modelcontextprotocol/server-filesystem', '.'],
372
- },
373
- },
374
- {
375
- name: 'github',
376
- transport: {
377
- type: 'sse',
378
- url: 'https://mcp-github.example.com/sse',
379
- },
380
- },
381
- ],
382
- });
383
-
384
- // Start the registry -- connects to all servers and indexes tools
385
- await registry.start();
386
-
387
- // List all discovered tools
388
- const tools = registry.listTools();
389
- console.log(`Discovered ${tools.length} tools`);
390
-
391
- // Search with natural language
392
- const results = registry.searchTools('read file contents');
393
- for (const result of results) {
394
- console.log(`${result.tool.name} (score: ${result.score})`);
395
- }
396
-
397
- // Graceful shutdown
398
- await registry.stop();
399
- ```
400
-
401
- ---
402
-
403
- ## MCP Gateway
404
-
405
- OpalServe can act as an MCP server itself, exposing every registered tool through a single endpoint. This lets you point Claude Desktop, Cursor, or any MCP-compatible client at OpalServe instead of configuring each server individually.
406
-
407
- ### Claude Desktop
408
-
409
- Add to your `claude_desktop_config.json`:
410
-
411
- ```json
412
- {
413
- "mcpServers": {
414
- "opalserve": {
415
- "command": "opalserve",
416
- "args": ["start", "--mcp"]
417
- }
418
- }
419
- }
420
- ```
421
-
422
- ### Cursor
423
-
424
- Add to your Cursor MCP settings:
425
-
426
- ```json
427
- {
428
- "mcpServers": {
429
- "opalserve": {
430
- "command": "opalserve",
431
- "args": ["start", "--mcp"]
432
- }
433
- }
434
- }
435
- ```
436
-
437
- Once connected, your AI client gains access to:
438
-
439
- - **`opalserve_search`** -- search across all registered tools by natural language query
440
- - **`opalserve_context_search`** -- search the shared knowledge base
441
- - **All proxied tools** -- every tool from every registered server, available through the single gateway
442
-
443
- ---
444
-
445
- ## Integrations
446
-
447
- ### GitHub
448
-
449
- Set up GitHub webhooks to automatically update context when code changes:
450
-
451
- ```bash
452
- # Add GitHub MCP server
453
- opalserve server add --name github --stdio "npx -y @modelcontextprotocol/server-github"
454
-
455
- # Configure webhook (point your repo's webhook to):
456
- # POST http://your-server:3456/api/v1/webhooks/github
457
- ```
458
-
459
- Environment variables:
460
-
461
- ```
462
- GITHUB_TOKEN=ghp_...
463
- GITHUB_WEBHOOK_SECRET=your-secret
464
- ```
465
-
466
- ### Slack
467
-
468
- Enable Slack integration for search commands and notifications:
469
-
470
- ```bash
471
- # Add Slack MCP server
472
- opalserve server add --name slack --stdio "npx -y @modelcontextprotocol/server-slack"
473
- ```
474
-
475
- Configure your Slack app to send events and commands to:
476
-
477
- ```
478
- Events: POST http://your-server:3456/api/v1/slack/events
479
- Commands: POST http://your-server:3456/api/v1/slack/commands
480
- ```
481
-
482
- Environment variables:
483
-
484
- ```
485
- SLACK_BOT_TOKEN=xoxb-...
486
- SLACK_SIGNING_SECRET=your-secret
487
- ```
488
-
489
- ---
490
-
491
- ## Configuration
492
-
493
- OpalServe is configured via `opalserve.config.json` in your project root or home directory.
494
-
495
- ```json
496
- {
497
- "mode": "local",
498
- "port": 3456,
499
- "host": "127.0.0.1",
500
- "servers": [
501
- {
502
- "name": "filesystem",
503
- "transport": {
504
- "type": "stdio",
505
- "command": "npx",
506
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
507
- }
508
- }
509
- ]
510
- }
511
- ```
512
-
513
- | Option | Default | Description |
514
- |---|---|---|
515
- | `mode` | `"local"` | `"local"` for single-user, `"team-server"` for shared |
516
- | `port` | `3456` | HTTP API port |
517
- | `host` | `"127.0.0.1"` | Bind address (`0.0.0.0` for team server) |
518
- | `servers` | `[]` | Array of MCP server configurations |
519
-
520
- Modes: **local** (single developer, no auth) and **team-server** (multi-user with auth, analytics, knowledge base).
521
-
522
- > See the [full configuration reference](https://opalserve.vercel.app/config) for all options.
523
-
524
- ---
525
-
526
- ## Contributing
527
-
528
- Contributions are welcome. To get started:
529
-
530
- ```bash
531
- # Clone the repo
532
- git clone https://github.com/adityaidev/opalserve.git
533
- cd opalserve
534
-
535
- # Install dependencies
536
- pnpm install
537
-
538
- # Start in dev mode (watch + auto-reload)
539
- pnpm dev
540
-
541
- # Type-check
542
118
  pnpm typecheck
543
-
544
- # Lint
545
119
  pnpm lint
546
-
547
- # Run tests
548
120
  pnpm test
121
+ pnpm build
122
+ pnpm pack --dry-run
549
123
  ```
550
124
 
551
- Please open an issue before submitting large PRs. Follow the existing code style -- strict TypeScript, Zod schemas for validation, and `.js` extensions in imports.
552
-
553
- ---
554
-
555
- ## Links
556
-
557
- - **Documentation:** [opalserve.vercel.app](https://opalserve.vercel.app)
558
- - **npm:** [npmjs.com/package/opalserve](https://www.npmjs.com/package/opalserve)
559
- - **GitHub:** [github.com/adityaidev/opalserve](https://github.com/adityaidev/opalserve)
560
- - **Releases:** [github.com/adityaidev/opalserve/releases](https://github.com/adityaidev/opalserve/releases)
561
- - **Issues:** [github.com/adityaidev/opalserve/issues](https://github.com/adityaidev/opalserve/issues)
562
-
563
125
  ---
564
-
565
- ## License
566
-
567
- MIT -- 100% open source, free to self-host.
568
-
569
- See [LICENSE](./LICENSE) for details.
126
+
127
+ ## Team Mode Setup
128
+
129
+ Team mode turns OpalServe into a shared server that your entire engineering org connects to.
130
+
131
+ ### 1. Initialize the team server
132
+
133
+ ```bash
134
+ opalserve admin init
135
+ ```
136
+
137
+ This creates an admin account, generates encryption keys, and prepares the SQLite database.
138
+
139
+ ### 2. Configure team mode
140
+
141
+ Edit `opalserve.config.json` and set the mode:
142
+
143
+ ```json
144
+ {
145
+ "mode": "team-server",
146
+ "port": 3456,
147
+ "host": "0.0.0.0"
148
+ }
149
+ ```
150
+
151
+ ### 3. Start the server
152
+
153
+ ```bash
154
+ opalserve start
155
+ ```
156
+
157
+ ### 4. Invite team members
158
+
159
+ ```bash
160
+ opalserve admin invite alice@company.com
161
+ opalserve admin invite bob@company.com
162
+ ```
163
+
164
+ ### 5. Developers connect
165
+
166
+ On each developer's machine:
167
+
168
+ ```bash
169
+ npm install -g opalserve
170
+
171
+ # Login to the team server
172
+ opalserve login
173
+
174
+ # Pull all registered servers to local config
175
+ opalserve sync
176
+ ```
177
+
178
+ ### 6. Manage access
179
+
180
+ ```bash
181
+ # Set rate limits by role
182
+ opalserve admin limits --set developer:calls_per_hour:500
183
+
184
+ # Set tool permissions
185
+ opalserve admin permissions --set developer:filesystem:*:allow
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Knowledge Base
191
+
192
+ The knowledge base lets you upload documents that become searchable context for every AI tool connected through OpalServe.
193
+
194
+ ### Adding documents
195
+
196
+ ```bash
197
+ # Upload architecture docs
198
+ opalserve context add ./docs/architecture.md
199
+
200
+ # Upload API specifications
201
+ opalserve context add ./docs/api-spec.md
202
+
203
+ # Upload coding standards
204
+ opalserve context add ./docs/coding-standards.md
205
+ ```
206
+
207
+ ### Searching context
208
+
209
+ ```bash
210
+ # Search by natural language query
211
+ opalserve context search "authentication flow"
212
+
213
+ # List all uploaded documents
214
+ opalserve context list
215
+
216
+ # Remove a document
217
+ opalserve context remove <document-id>
218
+ ```
219
+
220
+ When connected via the MCP gateway, AI tools like Claude Desktop can automatically search the knowledge base to ground their responses in your team's actual documentation.
221
+
222
+ ---
223
+
224
+ ## Admin Dashboard
225
+
226
+ OpalServe ships with a built-in React SPA accessible at `/dashboard` when the server is running.
227
+
228
+ The dashboard provides:
229
+
230
+ - **Usage overview** -- charts for tool calls, token consumption, and active users over time
231
+ - **Server monitoring** -- live status of every registered MCP server with health indicators
232
+ - **User management** -- view team members, roles, and activity
233
+ - **Tool browser** -- searchable catalog of all discovered tools across servers
234
+ - **Knowledge base manager** -- upload, browse, and remove context documents
235
+ - **Settings** -- API key management, integration configuration, rate limits
236
+
237
+ ```
238
+ http://localhost:3456/dashboard
239
+ ```
240
+
241
+ > The dashboard is available in team-server mode. Authentication is required for all management operations.
242
+
243
+ ---
244
+
245
+ ## CLI Commands
246
+
247
+ | Command | Description |
248
+ |---|---|
249
+ | `opalserve init` | Interactive setup wizard -- configures mode, port, and first server |
250
+ | `opalserve start` | Start the registry server (HTTP API + MCP gateway) |
251
+ | `opalserve status` | Show server status, connected servers, and tool counts |
252
+ | `opalserve health` | Health check all registered servers |
253
+ | `opalserve health --server <name>` | Health check a specific server |
254
+ | `opalserve login` | Authenticate with a team server |
255
+ | `opalserve logout` | Clear stored credentials |
256
+ | `opalserve whoami` | Show current authenticated user info |
257
+ | `opalserve sync` | Pull team server configurations to local machine |
258
+ | `opalserve server list` | List all registered MCP servers |
259
+ | `opalserve server add` | Register a new MCP server (stdio, SSE, or streamable-http) |
260
+ | `opalserve server remove <name>` | Remove a registered server |
261
+ | `opalserve tools list` | List all discovered tools across servers |
262
+ | `opalserve tools search <query>` | Search for tools by natural language query |
263
+ | `opalserve context add <file>` | Upload a file to the shared knowledge base |
264
+ | `opalserve context list` | List all context documents |
265
+ | `opalserve context search <query>` | Search the knowledge base |
266
+ | `opalserve context remove <id>` | Remove a context document |
267
+ | `opalserve admin init` | Initialize team mode with an admin user |
268
+ | `opalserve admin stats` | Show usage statistics for the team |
269
+ | `opalserve admin users` | List all team members |
270
+ | `opalserve admin invite <email>` | Invite a user to the team |
271
+ | `opalserve admin limits` | View and manage rate limits |
272
+ | `opalserve admin permissions` | View and manage tool permissions |
273
+
274
+ ---
275
+
276
+ ## HTTP API
277
+
278
+ OpalServe exposes a RESTful API under `/api/v1`. All endpoints return JSON.
279
+
280
+ ### Health
281
+
282
+ ```bash
283
+ curl http://localhost:3456/api/v1/health
284
+ ```
285
+
286
+ ### Servers
287
+
288
+ ```bash
289
+ # List all servers
290
+ curl http://localhost:3456/api/v1/servers
291
+
292
+ # Register a new server
293
+ curl -X POST http://localhost:3456/api/v1/servers \
294
+ -H "Content-Type: application/json" \
295
+ -d '{
296
+ "name": "filesystem",
297
+ "transport": {
298
+ "type": "stdio",
299
+ "command": "npx",
300
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
301
+ }
302
+ }'
303
+
304
+ # Remove a server
305
+ curl -X DELETE http://localhost:3456/api/v1/servers/filesystem
306
+
307
+ # Health check a specific server
308
+ curl http://localhost:3456/api/v1/servers/filesystem/health
309
+ ```
310
+
311
+ ### Tools
312
+
313
+ ```bash
314
+ # List all tools
315
+ curl http://localhost:3456/api/v1/tools
316
+
317
+ # Search tools
318
+ curl "http://localhost:3456/api/v1/tools/search?q=read+file&limit=5"
319
+
320
+ # Call a tool
321
+ curl -X POST http://localhost:3456/api/v1/tools/filesystem__read_file/call \
322
+ -H "Content-Type: application/json" \
323
+ -d '{"arguments": {"path": "./README.md"}}'
324
+ ```
325
+
326
+ ### Authentication (team mode)
327
+
328
+ ```bash
329
+ # Register
330
+ curl -X POST http://localhost:3456/api/v1/auth/register \
331
+ -H "Content-Type: application/json" \
332
+ -d '{"email": "dev@company.com", "password": "...", "name": "Alice"}'
333
+
334
+ # Login
335
+ curl -X POST http://localhost:3456/api/v1/auth/login \
336
+ -H "Content-Type: application/json" \
337
+ -d '{"email": "dev@company.com", "password": "..."}'
338
+
339
+ # Get current user
340
+ curl http://localhost:3456/api/v1/auth/me \
341
+ -H "Authorization: Bearer <token>"
342
+
343
+ # Create API key
344
+ curl -X POST http://localhost:3456/api/v1/auth/keys \
345
+ -H "Authorization: Bearer <token>" \
346
+ -H "Content-Type: application/json" \
347
+ -d '{"name": "ci-pipeline"}'
348
+ ```
349
+
350
+ ### Knowledge Base (team mode)
351
+
352
+ ```bash
353
+ # Upload a document
354
+ curl -X POST http://localhost:3456/api/v1/context/documents \
355
+ -H "Authorization: Bearer <token>" \
356
+ -H "Content-Type: application/json" \
357
+ -d '{"title": "Architecture", "content": "...", "type": "markdown"}'
358
+
359
+ # Search documents
360
+ curl "http://localhost:3456/api/v1/context/search?q=authentication+flow" \
361
+ -H "Authorization: Bearer <token>"
362
+ ```
363
+
364
+ ### Usage Stats (team mode)
365
+
366
+ ```bash
367
+ # Overview
368
+ curl http://localhost:3456/api/v1/stats/overview \
369
+ -H "Authorization: Bearer <token>"
370
+ ```
371
+
372
+ ---
373
+
374
+ ## Library Usage
375
+
376
+ Use OpalServe programmatically in your Node.js applications:
377
+
378
+ ```typescript
379
+ import {
380
+ OpalServeRegistry,
381
+ McpGateway,
382
+ KnowledgeBase,
383
+ UsageTracker,
384
+ } from 'opalserve';
385
+
386
+ // Create the registry with server definitions
387
+ const registry = await OpalServeRegistry.create({
388
+ servers: [
389
+ {
390
+ name: 'filesystem',
391
+ transport: {
392
+ type: 'stdio',
393
+ command: 'npx',
394
+ args: ['-y', '@modelcontextprotocol/server-filesystem', '.'],
395
+ },
396
+ },
397
+ {
398
+ name: 'github',
399
+ transport: {
400
+ type: 'sse',
401
+ url: 'https://mcp-github.example.com/sse',
402
+ },
403
+ },
404
+ ],
405
+ });
406
+
407
+ // Start the registry -- connects to all servers and indexes tools
408
+ await registry.start();
409
+
410
+ // List all discovered tools
411
+ const tools = registry.listTools();
412
+ console.log(`Discovered ${tools.length} tools`);
413
+
414
+ // Search with natural language
415
+ const results = registry.searchTools('read file contents');
416
+ for (const result of results) {
417
+ console.log(`${result.tool.name} (score: ${result.score})`);
418
+ }
419
+
420
+ // Graceful shutdown
421
+ await registry.stop();
422
+ ```
423
+
424
+ ---
425
+
426
+ ## MCP Gateway
427
+
428
+ OpalServe can act as an MCP server itself, exposing every registered tool through a single endpoint. This lets you point Claude Desktop, Cursor, or any MCP-compatible client at OpalServe instead of configuring each server individually.
429
+
430
+ ### Claude Desktop
431
+
432
+ Add to your `claude_desktop_config.json`:
433
+
434
+ ```json
435
+ {
436
+ "mcpServers": {
437
+ "opalserve": {
438
+ "command": "opalserve",
439
+ "args": ["start", "--mcp"]
440
+ }
441
+ }
442
+ }
443
+ ```
444
+
445
+ ### Cursor
446
+
447
+ Add to your Cursor MCP settings:
448
+
449
+ ```json
450
+ {
451
+ "mcpServers": {
452
+ "opalserve": {
453
+ "command": "opalserve",
454
+ "args": ["start", "--mcp"]
455
+ }
456
+ }
457
+ }
458
+ ```
459
+
460
+ Once connected, your AI client gains access to:
461
+
462
+ - **`opalserve_search`** -- search across all registered tools by natural language query
463
+ - **`opalserve_context_search`** -- search the shared knowledge base
464
+ - **All proxied tools** -- every tool from every registered server, available through the single gateway
465
+
466
+ ---
467
+
468
+ ## Integrations
469
+
470
+ ### GitHub
471
+
472
+ Set up GitHub webhooks to automatically update context when code changes:
473
+
474
+ ```bash
475
+ # Add GitHub MCP server
476
+ opalserve server add --name github --stdio "npx -y @modelcontextprotocol/server-github"
477
+
478
+ # Configure webhook (point your repo's webhook to):
479
+ # POST http://your-server:3456/api/v1/webhooks/github
480
+ ```
481
+
482
+ Environment variables:
483
+
484
+ ```
485
+ GITHUB_TOKEN=ghp_...
486
+ GITHUB_WEBHOOK_SECRET=your-secret
487
+ ```
488
+
489
+ ### Slack
490
+
491
+ Enable Slack integration for search commands and notifications:
492
+
493
+ ```bash
494
+ # Add Slack MCP server
495
+ opalserve server add --name slack --stdio "npx -y @modelcontextprotocol/server-slack"
496
+ ```
497
+
498
+ Configure your Slack app to send events and commands to:
499
+
500
+ ```
501
+ Events: POST http://your-server:3456/api/v1/slack/events
502
+ Commands: POST http://your-server:3456/api/v1/slack/commands
503
+ ```
504
+
505
+ Environment variables:
506
+
507
+ ```
508
+ SLACK_BOT_TOKEN=xoxb-...
509
+ SLACK_SIGNING_SECRET=your-secret
510
+ ```
511
+
512
+ ---
513
+
514
+ ## Configuration
515
+
516
+ OpalServe is configured via `opalserve.config.json` in your project root or home directory.
517
+
518
+ ```json
519
+ {
520
+ "mode": "local",
521
+ "port": 3456,
522
+ "host": "127.0.0.1",
523
+ "servers": [
524
+ {
525
+ "name": "filesystem",
526
+ "transport": {
527
+ "type": "stdio",
528
+ "command": "npx",
529
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
530
+ }
531
+ }
532
+ ]
533
+ }
534
+ ```
535
+
536
+ | Option | Default | Description |
537
+ |---|---|---|
538
+ | `mode` | `"local"` | `"local"` for single-user, `"team-server"` for shared |
539
+ | `port` | `3456` | HTTP API port |
540
+ | `host` | `"127.0.0.1"` | Bind address (`0.0.0.0` for team server) |
541
+ | `servers` | `[]` | Array of MCP server configurations |
542
+
543
+ Modes: **local** (single developer, no auth) and **team-server** (multi-user with auth, analytics, knowledge base).
544
+
545
+ > See the [full configuration reference](https://opalserve.adityaai.dev/config) for all options.
546
+
547
+ ---
548
+
549
+ ## Contributing
550
+
551
+ Contributions are welcome. To get started:
552
+
553
+ ```bash
554
+ # Clone the repo
555
+ git clone https://github.com/adityaidev/opalserve.git
556
+ cd opalserve
557
+
558
+ # Install dependencies
559
+ pnpm install
560
+
561
+ # Start in dev mode (watch + auto-reload)
562
+ pnpm dev
563
+
564
+ # Type-check
565
+ pnpm typecheck
566
+
567
+ # Lint
568
+ pnpm lint
569
+
570
+ # Run tests
571
+ pnpm test
572
+ ```
573
+
574
+ Please open an issue before submitting large PRs. Follow the existing code style -- strict TypeScript, Zod schemas for validation, and `.js` extensions in imports.
575
+
576
+ ---
577
+
578
+ ## Links
579
+
580
+ - **Documentation:** [opalserve.adityaai.dev](https://opalserve.adityaai.dev)
581
+ - **npm:** [npmjs.com/package/opalserve](https://www.npmjs.com/package/opalserve)
582
+ - **GitHub:** [github.com/adityaidev/opalserve](https://github.com/adityaidev/opalserve)
583
+ - **Releases:** [github.com/adityaidev/opalserve/releases](https://github.com/adityaidev/opalserve/releases)
584
+ - **Issues:** [github.com/adityaidev/opalserve/issues](https://github.com/adityaidev/opalserve/issues)
585
+
586
+ ---
587
+
588
+ ## License
589
+
590
+ MIT -- 100% open source, free to self-host.
591
+
592
+ See [LICENSE](./LICENSE) for details.