opalserve 3.0.0 → 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.
- package/LICENSE +21 -21
- package/README.md +576 -124
- package/assets/logo.svg +51 -51
- package/dist/cli/commands/admin.js +6 -6
- package/dist/cli/commands/context.d.ts.map +1 -1
- package/dist/cli/commands/context.js +54 -75
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/ui/banner.d.ts.map +1 -1
- package/dist/cli/ui/banner.js +15 -14
- package/dist/cli/ui/banner.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/index.js +1 -1
- package/dist/core/server-manager.d.ts.map +1 -1
- package/dist/core/server-manager.js +2 -1
- package/dist/core/server-manager.js.map +1 -1
- package/dist/dashboard/assets/charts-CKTlvUso.js +68 -0
- package/dist/dashboard/assets/icons-DciuKSzL.js +131 -0
- package/dist/dashboard/assets/index-BrOv-3xx.css +1 -0
- package/dist/dashboard/assets/index-DnqqzxX6.js +33 -0
- package/dist/dashboard/assets/react-BJczIp53.js +28 -0
- package/dist/dashboard/index.html +17 -14
- package/dist/integrations/github.js +3 -3
- package/dist/integrations/slack.js +1 -1
- package/dist/monitoring/tracker.js +13 -13
- package/dist/server/mcp-gateway.d.ts.map +1 -1
- package/dist/server/mcp-gateway.js +2 -1
- package/dist/server/mcp-gateway.js.map +1 -1
- package/dist/server/routes/context.js +1 -1
- package/dist/server/routes/health.d.ts.map +1 -1
- package/dist/server/routes/health.js +2 -1
- package/dist/server/routes/health.js.map +1 -1
- package/dist/server/routes/stats.js +6 -6
- package/dist/storage/database.d.ts.map +1 -1
- package/dist/storage/database.js +146 -130
- package/dist/storage/database.js.map +1 -1
- package/package.json +91 -91
- package/dist/dashboard/assets/index-BNOtcUPs.js +0 -257
- package/dist/dashboard/assets/index-Duwp34GW.css +0 -1
package/README.md
CHANGED
|
@@ -1,140 +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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
│ │ │
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
|
|
49
81
|
## Quick Start
|
|
50
82
|
|
|
51
83
|
```bash
|
|
52
|
-
# Install
|
|
84
|
+
# 1. Install globally
|
|
53
85
|
npm install -g opalserve
|
|
54
|
-
|
|
55
|
-
#
|
|
56
|
-
opalserve init
|
|
57
|
-
|
|
58
|
-
# Start the
|
|
59
|
-
opalserve start
|
|
60
|
-
|
|
61
|
-
#
|
|
62
|
-
opalserve server add --name files --stdio "npx -y @modelcontextprotocol/server-filesystem ."
|
|
63
|
-
|
|
64
|
-
#
|
|
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
|
|
65
97
|
opalserve tools search "read file"
|
|
66
98
|
```
|
|
67
99
|
|
|
68
|
-
|
|
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.
|
|
69
101
|
|
|
70
|
-
|
|
71
|
-
# Initialize team server
|
|
72
|
-
opalserve admin init
|
|
102
|
+
## Trust Check
|
|
73
103
|
|
|
74
|
-
|
|
75
|
-
# (set mode: "team-server" in opalserve.config.json)
|
|
76
|
-
opalserve start
|
|
77
|
-
|
|
78
|
-
# On each developer's machine:
|
|
79
|
-
opalserve login
|
|
80
|
-
opalserve sync
|
|
81
|
-
|
|
82
|
-
# Upload shared docs
|
|
83
|
-
opalserve context add ./docs/architecture.md
|
|
84
|
-
opalserve context add ./docs/api-spec.md
|
|
85
|
-
|
|
86
|
-
# Search team knowledge
|
|
87
|
-
opalserve context search "authentication flow"
|
|
88
|
-
```
|
|
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.
|
|
89
105
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- Usage overview with charts
|
|
94
|
-
- Server status monitoring
|
|
95
|
-
- User management
|
|
96
|
-
- Tool browser with search
|
|
97
|
-
- Knowledge base management
|
|
98
|
-
- API key + integration settings
|
|
99
|
-
|
|
100
|
-
## CLI Commands
|
|
106
|
+
```bash
|
|
107
|
+
opalserve --version
|
|
108
|
+
# 3.1.0
|
|
101
109
|
|
|
110
|
+
opalserve start
|
|
111
|
+
# HTTP API http://127.0.0.1:3456
|
|
112
|
+
# Dashboard http://127.0.0.1:3456/dashboard
|
|
102
113
|
```
|
|
103
|
-
opalserve init Setup wizard
|
|
104
|
-
opalserve start Start server
|
|
105
|
-
opalserve status Show status
|
|
106
|
-
opalserve login / logout / whoami Auth commands
|
|
107
|
-
opalserve sync Pull team configs
|
|
108
|
-
opalserve server list|add|remove Server management
|
|
109
|
-
opalserve tools list|search Tool discovery
|
|
110
|
-
opalserve context add|list|search Knowledge base
|
|
111
|
-
opalserve health Health checks
|
|
112
|
-
opalserve admin init|stats|users Team admin
|
|
113
|
-
opalserve admin limits|permissions Access control
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Library Usage
|
|
117
114
|
|
|
118
|
-
|
|
119
|
-
import { OpalServeRegistry } from 'opalserve';
|
|
115
|
+
For source builds, the same release checks are used locally and in CI:
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
await registry.start();
|
|
129
|
-
const tools = registry.listTools();
|
|
130
|
-
const results = registry.searchTools('read file');
|
|
131
|
-
await registry.stop();
|
|
117
|
+
```bash
|
|
118
|
+
pnpm typecheck
|
|
119
|
+
pnpm lint
|
|
120
|
+
pnpm test
|
|
121
|
+
pnpm build
|
|
122
|
+
pnpm pack --dry-run
|
|
132
123
|
```
|
|
133
124
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
---
|
|
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.
|