bhived-mcp 1.1.5
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 -0
- package/README.md +396 -0
- package/dist/agentsMd.d.ts +38 -0
- package/dist/agentsMd.d.ts.map +1 -0
- package/dist/agentsMd.js +392 -0
- package/dist/agentsMd.js.map +1 -0
- package/dist/childMcp/delivery.d.ts +73 -0
- package/dist/childMcp/delivery.d.ts.map +1 -0
- package/dist/childMcp/delivery.js +130 -0
- package/dist/childMcp/delivery.js.map +1 -0
- package/dist/childMcp/manager.d.ts +111 -0
- package/dist/childMcp/manager.d.ts.map +1 -0
- package/dist/childMcp/manager.js +454 -0
- package/dist/childMcp/manager.js.map +1 -0
- package/dist/client/restClient.d.ts +36 -0
- package/dist/client/restClient.d.ts.map +1 -0
- package/dist/client/restClient.js +154 -0
- package/dist/client/restClient.js.map +1 -0
- package/dist/client/types.d.ts +220 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +8 -0
- package/dist/client/types.js.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +28 -0
- package/dist/config.js.map +1 -0
- package/dist/formatters/inspectFormatter.d.ts +13 -0
- package/dist/formatters/inspectFormatter.d.ts.map +1 -0
- package/dist/formatters/inspectFormatter.js +68 -0
- package/dist/formatters/inspectFormatter.js.map +1 -0
- package/dist/formatters/queryFormatter.d.ts +18 -0
- package/dist/formatters/queryFormatter.d.ts.map +1 -0
- package/dist/formatters/queryFormatter.js +250 -0
- package/dist/formatters/queryFormatter.js.map +1 -0
- package/dist/formatters/writeFormatter.d.ts +16 -0
- package/dist/formatters/writeFormatter.d.ts.map +1 -0
- package/dist/formatters/writeFormatter.js +56 -0
- package/dist/formatters/writeFormatter.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +387 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/learnAndShare.d.ts +8 -0
- package/dist/prompts/learnAndShare.d.ts.map +1 -0
- package/dist/prompts/learnAndShare.js +77 -0
- package/dist/prompts/learnAndShare.js.map +1 -0
- package/dist/prompts/reviewMemory.d.ts +8 -0
- package/dist/prompts/reviewMemory.d.ts.map +1 -0
- package/dist/prompts/reviewMemory.js +61 -0
- package/dist/prompts/reviewMemory.js.map +1 -0
- package/dist/registries/childMcpRegistry.d.ts +65 -0
- package/dist/registries/childMcpRegistry.d.ts.map +1 -0
- package/dist/registries/childMcpRegistry.js +74 -0
- package/dist/registries/childMcpRegistry.js.map +1 -0
- package/dist/registries/index.d.ts +12 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js +9 -0
- package/dist/registries/index.js.map +1 -0
- package/dist/registries/resourceRegistry.d.ts +48 -0
- package/dist/registries/resourceRegistry.d.ts.map +1 -0
- package/dist/registries/resourceRegistry.js +91 -0
- package/dist/registries/resourceRegistry.js.map +1 -0
- package/dist/registries/skillRegistry.d.ts +48 -0
- package/dist/registries/skillRegistry.d.ts.map +1 -0
- package/dist/registries/skillRegistry.js +47 -0
- package/dist/registries/skillRegistry.js.map +1 -0
- package/dist/resources/guide.d.ts +7 -0
- package/dist/resources/guide.d.ts.map +1 -0
- package/dist/resources/guide.js +77 -0
- package/dist/resources/guide.js.map +1 -0
- package/dist/resources/status.d.ts +7 -0
- package/dist/resources/status.d.ts.map +1 -0
- package/dist/resources/status.js +38 -0
- package/dist/resources/status.js.map +1 -0
- package/dist/tools/initiateMcp.d.ts +10 -0
- package/dist/tools/initiateMcp.d.ts.map +1 -0
- package/dist/tools/initiateMcp.js +224 -0
- package/dist/tools/initiateMcp.js.map +1 -0
- package/dist/tools/initiateSkill.d.ts +13 -0
- package/dist/tools/initiateSkill.d.ts.map +1 -0
- package/dist/tools/initiateSkill.js +277 -0
- package/dist/tools/initiateSkill.js.map +1 -0
- package/dist/tools/inspect.d.ts +8 -0
- package/dist/tools/inspect.d.ts.map +1 -0
- package/dist/tools/inspect.js +110 -0
- package/dist/tools/inspect.js.map +1 -0
- package/dist/tools/listActive.d.ts +9 -0
- package/dist/tools/listActive.d.ts.map +1 -0
- package/dist/tools/listActive.js +177 -0
- package/dist/tools/listActive.js.map +1 -0
- package/dist/tools/query.d.ts +15 -0
- package/dist/tools/query.d.ts.map +1 -0
- package/dist/tools/query.js +98 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/tools/readResource.d.ts +9 -0
- package/dist/tools/readResource.d.ts.map +1 -0
- package/dist/tools/readResource.js +110 -0
- package/dist/tools/readResource.js.map +1 -0
- package/dist/tools/runScript.d.ts +17 -0
- package/dist/tools/runScript.d.ts.map +1 -0
- package/dist/tools/runScript.js +320 -0
- package/dist/tools/runScript.js.map +1 -0
- package/dist/tools/stopMcp.d.ts +8 -0
- package/dist/tools/stopMcp.d.ts.map +1 -0
- package/dist/tools/stopMcp.js +91 -0
- package/dist/tools/stopMcp.js.map +1 -0
- package/dist/tools/useTool.d.ts +10 -0
- package/dist/tools/useTool.d.ts.map +1 -0
- package/dist/tools/useTool.js +127 -0
- package/dist/tools/useTool.js.map +1 -0
- package/dist/tools/write.d.ts +9 -0
- package/dist/tools/write.d.ts.map +1 -0
- package/dist/tools/write.js +224 -0
- package/dist/tools/write.js.map +1 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HiveMind
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# HiveMind MCP Server
|
|
2
|
+
|
|
3
|
+
**Shared knowledge graph for AI agents** — query, write, and inspect collective AI knowledge through the [Model Context Protocol](https://modelcontextprotocol.io).
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/ak-hivemind-mcp)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### Option 1: npx (no install)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx -y ak-hivemind-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Option 2: Global install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g ak-hivemind-mcp
|
|
23
|
+
ak-hivemind-mcp
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Option 3: From source
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/your-org/ak-hivemind-mcp.git
|
|
30
|
+
cd ak-hivemind-mcp
|
|
31
|
+
npm install
|
|
32
|
+
npm run build
|
|
33
|
+
npm start
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
All configuration is done via **environment variables**:
|
|
41
|
+
|
|
42
|
+
| Variable | Required | Default | Description |
|
|
43
|
+
|----------|----------|---------|-------------|
|
|
44
|
+
| `HIVEMIND_API_URL` | No | `http://localhost:8000` | Base URL of the HiveMind REST API |
|
|
45
|
+
| `HIVEMIND_API_KEY` | **Yes** (production) | — | Bearer token for API authentication |
|
|
46
|
+
| `HIVEMIND_AGENT_ID` | No | `mcp-anonymous` | Default agent identifier |
|
|
47
|
+
| `HIVEMIND_TIMEOUT` | No | `30000` | Request timeout in milliseconds |
|
|
48
|
+
|
|
49
|
+
> **Auth**: When `HIVEMIND_API_KEY` is set, every REST request includes an `Authorization: Bearer <key>` header. For local development without auth, simply omit the variable.
|
|
50
|
+
|
|
51
|
+
### CLI Flags
|
|
52
|
+
|
|
53
|
+
| Flag | Default | Description |
|
|
54
|
+
|------|---------|-------------|
|
|
55
|
+
| `--transport=stdio` | `stdio` | Transport mode: `stdio` or `http` |
|
|
56
|
+
| `--port=3001` | `3001` | HTTP port (only for `--transport=http`) |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Client Setup
|
|
61
|
+
|
|
62
|
+
### Claude Desktop
|
|
63
|
+
|
|
64
|
+
**Config file**: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"mcpServers": {
|
|
69
|
+
"hivemind": {
|
|
70
|
+
"command": "npx",
|
|
71
|
+
"args": ["-y", "ak-hivemind-mcp"],
|
|
72
|
+
"env": {
|
|
73
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
74
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### Cursor
|
|
84
|
+
|
|
85
|
+
**Config file**: `.cursor/mcp.json` in your project root (project-level) or `~/.cursor/mcp.json` (global)
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"mcpServers": {
|
|
90
|
+
"hivemind": {
|
|
91
|
+
"command": "npx",
|
|
92
|
+
"args": ["-y", "hivemind-mcp"],
|
|
93
|
+
"env": {
|
|
94
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
95
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### Windsurf
|
|
105
|
+
|
|
106
|
+
**Config file**: `~/.codeium/windsurf/mcp_config.json`
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"hivemind": {
|
|
112
|
+
"command": "npx",
|
|
113
|
+
"args": ["-y", "hivemind-mcp"],
|
|
114
|
+
"env": {
|
|
115
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
116
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### VS Code
|
|
126
|
+
|
|
127
|
+
**Config file**: `.vscode/mcp.json` in your project root (project-level) or user `settings.json` (global)
|
|
128
|
+
|
|
129
|
+
#### Project-level (`.vscode/mcp.json`)
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"servers": {
|
|
134
|
+
"hivemind": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": ["-y", "hivemind-mcp"],
|
|
137
|
+
"env": {
|
|
138
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
139
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### Global (User `settings.json`)
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"mcp": {
|
|
151
|
+
"servers": {
|
|
152
|
+
"hivemind": {
|
|
153
|
+
"command": "npx",
|
|
154
|
+
"args": ["-y", "hivemind-mcp"],
|
|
155
|
+
"env": {
|
|
156
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
157
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### Cline (VS Code Extension)
|
|
168
|
+
|
|
169
|
+
**Config file**: Cline's `cline_mcp_settings.json` (accessible via Cline → MCP Servers → Configure)
|
|
170
|
+
|
|
171
|
+
| OS | Path |
|
|
172
|
+
|----|------|
|
|
173
|
+
| macOS | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
174
|
+
| Windows | `%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
175
|
+
| Linux | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"mcpServers": {
|
|
180
|
+
"hivemind": {
|
|
181
|
+
"command": "npx",
|
|
182
|
+
"args": ["-y", "hivemind-mcp"],
|
|
183
|
+
"env": {
|
|
184
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
185
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### Gemini CLI
|
|
195
|
+
|
|
196
|
+
**Config file**: `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project-level)
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"mcpServers": {
|
|
201
|
+
"hivemind": {
|
|
202
|
+
"command": "npx",
|
|
203
|
+
"args": ["-y", "hivemind-mcp"],
|
|
204
|
+
"env": {
|
|
205
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
206
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### OpenAI Agents / ChatGPT
|
|
216
|
+
|
|
217
|
+
For OpenAI-compatible clients that support MCP via stdio:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"mcpServers": {
|
|
222
|
+
"hivemind": {
|
|
223
|
+
"command": "npx",
|
|
224
|
+
"args": ["-y", "hivemind-mcp"],
|
|
225
|
+
"env": {
|
|
226
|
+
"HIVEMIND_API_URL": "https://your-hivemind-server.com",
|
|
227
|
+
"HIVEMIND_API_KEY": "your-api-key"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### Any MCP Client (Generic)
|
|
237
|
+
|
|
238
|
+
HiveMind MCP works with **any** MCP-compatible client. The pattern is always the same:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
command: npx
|
|
242
|
+
args: ["-y", "ak-hivemind-mcp"]
|
|
243
|
+
env:
|
|
244
|
+
HIVEMIND_API_URL: https://your-hivemind-server.com
|
|
245
|
+
HIVEMIND_API_KEY: your-api-key
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Deployment
|
|
251
|
+
|
|
252
|
+
### Local Development (stdio)
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
# Set env and run
|
|
256
|
+
export HIVEMIND_API_URL=http://localhost:8000
|
|
257
|
+
export HIVEMIND_API_KEY=dev-token
|
|
258
|
+
npx ak-hivemind-mcp
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Remote / Cloud (HTTP transport)
|
|
262
|
+
|
|
263
|
+
For multi-client or cloud deployments, use the HTTP transport:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
export HIVEMIND_API_URL=https://your-hivemind-api.com
|
|
267
|
+
export HIVEMIND_API_KEY=your-api-key
|
|
268
|
+
node dist/index.js --transport=http --port=3001
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Agents then connect to: `http://your-mcp-host:3001/mcp`
|
|
272
|
+
|
|
273
|
+
### Docker
|
|
274
|
+
|
|
275
|
+
```dockerfile
|
|
276
|
+
FROM node:22-alpine
|
|
277
|
+
RUN npm install -g ak-hivemind-mcp
|
|
278
|
+
ENV HIVEMIND_API_URL=https://your-hivemind-api.com
|
|
279
|
+
ENV HIVEMIND_API_KEY=your-api-key
|
|
280
|
+
EXPOSE 3001
|
|
281
|
+
CMD ["ak-hivemind-mcp", "--transport=http", "--port=3001"]
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
docker build -t ak-hivemind-mcp .
|
|
286
|
+
docker run -p 3001:3001 \
|
|
287
|
+
-e HIVEMIND_API_URL=https://your-hivemind-api.com \
|
|
288
|
+
-e HIVEMIND_API_KEY=your-api-key \
|
|
289
|
+
ak-hivemind-mcp
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Docker Compose
|
|
293
|
+
|
|
294
|
+
```yaml
|
|
295
|
+
services:
|
|
296
|
+
ak-hivemind-mcp:
|
|
297
|
+
image: node:22-alpine
|
|
298
|
+
command: sh -c "npm install -g ak-hivemind-mcp && ak-hivemind-mcp --transport=http --port=3001"
|
|
299
|
+
ports:
|
|
300
|
+
- "3001:3001"
|
|
301
|
+
environment:
|
|
302
|
+
HIVEMIND_API_URL: https://your-hivemind-api.com
|
|
303
|
+
HIVEMIND_API_KEY: ${HIVEMIND_API_KEY}
|
|
304
|
+
restart: unless-stopped
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Tools
|
|
310
|
+
|
|
311
|
+
| Tool | Description |
|
|
312
|
+
|------|-------------|
|
|
313
|
+
| `hivemind_query` | Search the shared knowledge graph for proven instructions, warnings, and disputed pairs |
|
|
314
|
+
| `hivemind_write_instruction` | Share a working approach with all future AI agents |
|
|
315
|
+
| `hivemind_write_mistake` | Warn about a failed approach — mistakes are never deleted |
|
|
316
|
+
| `hivemind_write_update` | Share a factual change (version updates, deprecations, breaking changes) |
|
|
317
|
+
| `hivemind_inspect` | Inspect a memory's full state, evolution scores, and version history |
|
|
318
|
+
|
|
319
|
+
## Resources
|
|
320
|
+
|
|
321
|
+
| URI | Description |
|
|
322
|
+
|-----|-------------|
|
|
323
|
+
| `hivemind://status` | System health, graph connectivity, and memory counts |
|
|
324
|
+
| `hivemind://guide` | Agent onboarding guide — the evolution loop, when to use each tool |
|
|
325
|
+
|
|
326
|
+
## Prompts
|
|
327
|
+
|
|
328
|
+
| Prompt | Description |
|
|
329
|
+
|--------|-------------|
|
|
330
|
+
| `learn_and_share` | Guided workflow: query → try → write → verify |
|
|
331
|
+
| `review_memory` | Memory evaluation: inspect → assess accuracy → correct/supersede |
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Architecture
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
339
|
+
│ AI AGENTS (Any MCP Client) │
|
|
340
|
+
│ Claude · GPT · Gemini · Cursor · Windsurf · Cline │
|
|
341
|
+
└───────────────────────────┬─────────────────────────────────┘
|
|
342
|
+
│ MCP Protocol (stdio or http)
|
|
343
|
+
▼
|
|
344
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
345
|
+
│ HIVEMIND MCP SERVER (TypeScript) │
|
|
346
|
+
│ │
|
|
347
|
+
│ 5 Tools · 2 Resources · 2 Prompts │
|
|
348
|
+
│ │ │
|
|
349
|
+
│ ┌──────────▼──────────┐ │
|
|
350
|
+
│ │ REST Client │ Authorization: Bearer │
|
|
351
|
+
│ └──────────┬──────────┘ │
|
|
352
|
+
└─────────────────────┼───────────────────────────────────────┘
|
|
353
|
+
│ HTTP + Bearer token
|
|
354
|
+
▼
|
|
355
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
356
|
+
│ HIVEMIND REST API (Python/FastAPI) │
|
|
357
|
+
│ │ │
|
|
358
|
+
│ ┌───────────▼────────────┐ │
|
|
359
|
+
│ │ FalkorDB + Redis │ │
|
|
360
|
+
│ │ (Graph + Vectors) │ │
|
|
361
|
+
│ └────────────────────────┘ │
|
|
362
|
+
└─────────────────────────────────────────────────────────────┘
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The MCP server is a **thin stateless wrapper**. All business logic lives in the Python REST API.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Development
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
# Watch mode (auto-reload on changes)
|
|
373
|
+
npm run dev
|
|
374
|
+
|
|
375
|
+
# Build TypeScript → dist/
|
|
376
|
+
npm run build
|
|
377
|
+
|
|
378
|
+
# Test with MCP Inspector
|
|
379
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## Publishing to npm
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# Build + publish (prepublishOnly auto-runs clean + tsc)
|
|
386
|
+
npm publish
|
|
387
|
+
|
|
388
|
+
# Users can then run:
|
|
389
|
+
npx -y ak-hivemind-mcp
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## License
|
|
395
|
+
|
|
396
|
+
MIT
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGENTS.md & CLAUDE.md Bootstrapper
|
|
3
|
+
*
|
|
4
|
+
* When the HiveMind MCP server initializes on a project, this module
|
|
5
|
+
* creates or updates the project's AGENTS.md and CLAUDE.md files with
|
|
6
|
+
* HiveMind usage instructions.
|
|
7
|
+
*
|
|
8
|
+
* It uses the MCP `roots` protocol to discover the client's workspace
|
|
9
|
+
* directory, falling back to process.cwd() if roots aren't available.
|
|
10
|
+
*
|
|
11
|
+
* Detection uses start/end markers so content can be:
|
|
12
|
+
* - Detected (already present?)
|
|
13
|
+
* - Replaced (updated with newer version)
|
|
14
|
+
* - Appended (file exists but no HiveMind section)
|
|
15
|
+
*
|
|
16
|
+
* AGENTS.md behavior:
|
|
17
|
+
* 1. File doesn't exist → Create with HiveMind instructions
|
|
18
|
+
* 2. File exists, has markers → Replace content between markers (update)
|
|
19
|
+
* 3. File exists, no markers → Append separator + HiveMind instructions
|
|
20
|
+
*
|
|
21
|
+
* CLAUDE.md behavior:
|
|
22
|
+
* 1. File doesn't exist → Create with @AGENTS.md reference
|
|
23
|
+
* 2. File exists, has marker → Skip (just a reference, no content to update)
|
|
24
|
+
* 3. File exists, no marker → Append @AGENTS.md reference
|
|
25
|
+
*/
|
|
26
|
+
import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
27
|
+
/**
|
|
28
|
+
* Hooks into the MCP server's initialization lifecycle to bootstrap
|
|
29
|
+
* AGENTS.md and CLAUDE.md in the client's workspace.
|
|
30
|
+
*
|
|
31
|
+
* This registers an `oninitialized` callback on the low-level Server.
|
|
32
|
+
* When the client completes the MCP handshake (sends `initialized`),
|
|
33
|
+
* we request roots and write both files to the first root directory.
|
|
34
|
+
*
|
|
35
|
+
* @param lowLevelServer The low-level Server instance (mcpServer.server)
|
|
36
|
+
*/
|
|
37
|
+
export declare function setupAgentsMdBootstrap(lowLevelServer: Server): void;
|
|
38
|
+
//# sourceMappingURL=agentsMd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentsMd.d.ts","sourceRoot":"","sources":["../src/agentsMd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAqWxE;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CA4BnE"}
|