@jive-ai/cli 0.0.26 → 0.0.31
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 +1 -1
- package/dist/index.mjs +4832 -1718
- package/package.json +20 -6
- package/dist/config-BP7v03In.mjs +0 -3
- package/docs/auth.md +0 -378
- package/docs/getting-started.md +0 -263
- package/docs/init.md +0 -591
- package/docs/mcp.md +0 -899
- package/docs/subagents.md +0 -702
- package/docs/sync.md +0 -673
- package/docs/team.md +0 -514
package/docs/mcp.md
DELETED
|
@@ -1,899 +0,0 @@
|
|
|
1
|
-
# MCP Server Commands
|
|
2
|
-
|
|
3
|
-
MCP (Model Context Protocol) servers extend Claude's capabilities by providing additional tools. Jive helps teams share and manage MCP server configurations across projects.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
MCP server management in Jive allows you to:
|
|
8
|
-
- Share MCP server configurations with your team
|
|
9
|
-
- Pull team MCP servers to your local project
|
|
10
|
-
- Push local MCP servers to share with your team
|
|
11
|
-
- Add new MCP servers interactively
|
|
12
|
-
- Remove MCP servers from the team
|
|
13
|
-
- Merge team configurations with local ones
|
|
14
|
-
|
|
15
|
-
## MCP Configuration Format
|
|
16
|
-
|
|
17
|
-
MCP servers are configured in `.mcp.json` at the project root:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"mcpServers": {
|
|
22
|
-
"weather-api": {
|
|
23
|
-
"command": "npx",
|
|
24
|
-
"args": ["-y", "@modelcontextprotocol/server-weather"],
|
|
25
|
-
"env": {
|
|
26
|
-
"API_KEY": "your-api-key"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"file-system": {
|
|
30
|
-
"command": "npx",
|
|
31
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed"]
|
|
32
|
-
},
|
|
33
|
-
"jive-mcp": {
|
|
34
|
-
"command": "npx",
|
|
35
|
-
"args": ["-y", "jive-cli", "mcp", "start"],
|
|
36
|
-
"env": {
|
|
37
|
-
"JIVE_API_URL": "https://next.getjive.app",
|
|
38
|
-
"JIVE_TEAM_ID": "team-abc123",
|
|
39
|
-
"JIVE_AUTH_TOKEN": "your-token"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**Server Configuration Fields:**
|
|
47
|
-
- `command` (required) - Executable command (e.g., `npx`, `node`, `python`)
|
|
48
|
-
- `args` (optional) - Array of command arguments
|
|
49
|
-
- `env` (optional) - Object of environment variables
|
|
50
|
-
|
|
51
|
-
## Commands
|
|
52
|
-
|
|
53
|
-
### `jive mcp list`
|
|
54
|
-
|
|
55
|
-
List all MCP servers for the active team.
|
|
56
|
-
|
|
57
|
-
**Usage:**
|
|
58
|
-
```bash
|
|
59
|
-
jive mcp list
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Requirements:**
|
|
63
|
-
- Must be authenticated
|
|
64
|
-
- Must be in a Jive-initialized project
|
|
65
|
-
|
|
66
|
-
**Process:**
|
|
67
|
-
1. Gets active team ID from `.jive/config.json`
|
|
68
|
-
2. Fetches team MCP servers from API (`GET /api/teams/{teamId}/mcp-servers`)
|
|
69
|
-
3. Displays formatted list
|
|
70
|
-
|
|
71
|
-
**Output:**
|
|
72
|
-
```
|
|
73
|
-
Team MCP servers:
|
|
74
|
-
|
|
75
|
-
weather-api (mcp-123)
|
|
76
|
-
Command: npx -y @modelcontextprotocol/server-weather
|
|
77
|
-
Environment: API_KEY
|
|
78
|
-
|
|
79
|
-
file-system (mcp-456)
|
|
80
|
-
Command: npx -y @modelcontextprotocol/server-filesystem /allowed
|
|
81
|
-
Environment: (none)
|
|
82
|
-
|
|
83
|
-
database (mcp-789)
|
|
84
|
-
Command: node server.js
|
|
85
|
-
Environment: DB_HOST, DB_USER, DB_PASS
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Notes:**
|
|
89
|
-
- Shows server name, ID, command, and environment variables
|
|
90
|
-
- Environment variable values are not displayed (security)
|
|
91
|
-
- Only shows servers for the active team
|
|
92
|
-
|
|
93
|
-
**Error Conditions:**
|
|
94
|
-
- Not authenticated
|
|
95
|
-
- Project not initialized
|
|
96
|
-
- Network connectivity issues
|
|
97
|
-
|
|
98
|
-
**Implementation:** `src/commands/mcp.ts` (mcpCommands.list)
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
### `jive mcp pull`
|
|
103
|
-
|
|
104
|
-
Download team MCP servers to local `.mcp.json`.
|
|
105
|
-
|
|
106
|
-
**Usage:**
|
|
107
|
-
```bash
|
|
108
|
-
jive mcp pull [--merge]
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
**Options:**
|
|
112
|
-
- `--merge` - Merge with local servers instead of replacing (default: replace)
|
|
113
|
-
|
|
114
|
-
**Requirements:**
|
|
115
|
-
- Must be authenticated
|
|
116
|
-
- Must be in a Jive-initialized project
|
|
117
|
-
|
|
118
|
-
**Process:**
|
|
119
|
-
1. Creates backup at `.mcp.json.backup`
|
|
120
|
-
2. Fetches remote MCP servers from team API
|
|
121
|
-
3. **If `--merge`:**
|
|
122
|
-
- Merges with local servers
|
|
123
|
-
- Remote servers take precedence on conflicts
|
|
124
|
-
- Preserves local-only servers
|
|
125
|
-
4. **If not merge (default):**
|
|
126
|
-
- Replaces all servers except `jive-mcp`
|
|
127
|
-
- `jive-mcp` server is always preserved
|
|
128
|
-
5. Writes updated `.mcp.json`
|
|
129
|
-
|
|
130
|
-
**Output (replace mode):**
|
|
131
|
-
```bash
|
|
132
|
-
jive mcp pull
|
|
133
|
-
```
|
|
134
|
-
```
|
|
135
|
-
Creating backup: .mcp.json.backup
|
|
136
|
-
Pulling MCP servers from team...
|
|
137
|
-
|
|
138
|
-
✓ weather-api
|
|
139
|
-
✓ file-system
|
|
140
|
-
✓ database
|
|
141
|
-
|
|
142
|
-
Downloaded 3 MCP servers
|
|
143
|
-
Preserved jive-mcp server
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Output (merge mode):**
|
|
147
|
-
```bash
|
|
148
|
-
jive mcp pull --merge
|
|
149
|
-
```
|
|
150
|
-
```
|
|
151
|
-
Creating backup: .mcp.json.backup
|
|
152
|
-
Merging MCP servers from team...
|
|
153
|
-
|
|
154
|
-
✓ weather-api (updated)
|
|
155
|
-
✓ file-system (updated)
|
|
156
|
-
✓ database (new)
|
|
157
|
-
✓ local-only-server (preserved)
|
|
158
|
-
|
|
159
|
-
Merged 3 team servers with 1 local server
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
**Before Pull:**
|
|
163
|
-
```json
|
|
164
|
-
{
|
|
165
|
-
"mcpServers": {
|
|
166
|
-
"jive-mcp": { "command": "npx", "args": ["jive-cli", "mcp", "start"] },
|
|
167
|
-
"local-only-server": { "command": "node", "args": ["local.js"] }
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**After Pull (replace):**
|
|
173
|
-
```json
|
|
174
|
-
{
|
|
175
|
-
"mcpServers": {
|
|
176
|
-
"jive-mcp": { "command": "npx", "args": ["jive-cli", "mcp", "start"] },
|
|
177
|
-
"weather-api": { "command": "npx", "args": ["-y", "server-weather"] },
|
|
178
|
-
"file-system": { "command": "npx", "args": ["-y", "server-filesystem"] }
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
**After Pull (--merge):**
|
|
184
|
-
```json
|
|
185
|
-
{
|
|
186
|
-
"mcpServers": {
|
|
187
|
-
"jive-mcp": { "command": "npx", "args": ["jive-cli", "mcp", "start"] },
|
|
188
|
-
"local-only-server": { "command": "node", "args": ["local.js"] },
|
|
189
|
-
"weather-api": { "command": "npx", "args": ["-y", "server-weather"] },
|
|
190
|
-
"file-system": { "command": "npx", "args": ["-y", "server-filesystem"] }
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
**Notes:**
|
|
196
|
-
- Always creates a backup before modifying `.mcp.json`
|
|
197
|
-
- `jive-mcp` server is never removed
|
|
198
|
-
- Use `--merge` to preserve local-only servers
|
|
199
|
-
- Restart Claude Code after pulling to apply changes
|
|
200
|
-
|
|
201
|
-
**Error Conditions:**
|
|
202
|
-
- Not authenticated
|
|
203
|
-
- Project not initialized
|
|
204
|
-
- Network connectivity issues
|
|
205
|
-
- File system permission errors
|
|
206
|
-
|
|
207
|
-
**Implementation:** `src/commands/mcp.ts` (mcpCommands.pull)
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
### `jive mcp push`
|
|
212
|
-
|
|
213
|
-
Upload local MCP servers to the team.
|
|
214
|
-
|
|
215
|
-
**Usage:**
|
|
216
|
-
```bash
|
|
217
|
-
jive mcp push [--force]
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
**Options:**
|
|
221
|
-
- `--force` - Force push without conflict checks (not fully implemented)
|
|
222
|
-
|
|
223
|
-
**Requirements:**
|
|
224
|
-
- Must be authenticated
|
|
225
|
-
- Must be in a Jive-initialized project
|
|
226
|
-
- Must have `.mcp.json` file
|
|
227
|
-
|
|
228
|
-
**Process:**
|
|
229
|
-
1. Reads `.mcp.json` from project root
|
|
230
|
-
2. For each server (except `jive-mcp`):
|
|
231
|
-
- Attempts to create server on team via `POST /api/teams/{teamId}/mcp-servers`
|
|
232
|
-
- Ignores errors (servers may already exist)
|
|
233
|
-
3. Displays summary of uploaded servers
|
|
234
|
-
|
|
235
|
-
**Output:**
|
|
236
|
-
```bash
|
|
237
|
-
jive mcp push
|
|
238
|
-
```
|
|
239
|
-
```
|
|
240
|
-
Pushing MCP servers to team...
|
|
241
|
-
|
|
242
|
-
✓ weather-api
|
|
243
|
-
✓ file-system
|
|
244
|
-
⊘ database (already exists)
|
|
245
|
-
|
|
246
|
-
Pushed 2 servers, skipped 1
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
**Notes:**
|
|
250
|
-
- Does not update existing servers (create-only currently)
|
|
251
|
-
- Skips `jive-mcp` server (reserved by Jive)
|
|
252
|
-
- Safe to run multiple times (idempotent)
|
|
253
|
-
- Other team members must run `jive mcp pull` to get changes
|
|
254
|
-
|
|
255
|
-
**Error Conditions:**
|
|
256
|
-
- Not authenticated
|
|
257
|
-
- Project not initialized
|
|
258
|
-
- `.mcp.json` not found
|
|
259
|
-
- Invalid JSON in `.mcp.json`
|
|
260
|
-
- Network connectivity issues
|
|
261
|
-
|
|
262
|
-
**Implementation:** `src/commands/mcp.ts` (mcpCommands.push)
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
### `jive mcp add <name>`
|
|
267
|
-
|
|
268
|
-
Add a new MCP server to the team interactively.
|
|
269
|
-
|
|
270
|
-
**Usage:**
|
|
271
|
-
```bash
|
|
272
|
-
jive mcp add <name>
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
**Arguments:**
|
|
276
|
-
- `<name>` (required) - Name for the MCP server (e.g., `weather-api`)
|
|
277
|
-
|
|
278
|
-
**Requirements:**
|
|
279
|
-
- Must be authenticated
|
|
280
|
-
- Must be in a Jive-initialized project
|
|
281
|
-
|
|
282
|
-
**Interactive Prompts:**
|
|
283
|
-
- **Command:** Executable to run (e.g., `npx`, `node`, `python`)
|
|
284
|
-
- **Arguments:** Comma-separated list of arguments
|
|
285
|
-
- **Environment variables:** Key=value pairs, one per line (empty line to finish)
|
|
286
|
-
|
|
287
|
-
**Process:**
|
|
288
|
-
1. Prompts for server configuration
|
|
289
|
-
2. Creates server on team via `POST /api/teams/{teamId}/mcp-servers`
|
|
290
|
-
3. Adds server to local `.mcp.json`
|
|
291
|
-
4. Creates `.mcp.json` if it doesn't exist
|
|
292
|
-
|
|
293
|
-
**Output:**
|
|
294
|
-
```bash
|
|
295
|
-
jive mcp add weather-api
|
|
296
|
-
```
|
|
297
|
-
```
|
|
298
|
-
? Command: npx
|
|
299
|
-
? Arguments (comma-separated): -y, @modelcontextprotocol/server-weather
|
|
300
|
-
? Environment variables (KEY=VALUE, empty line to finish):
|
|
301
|
-
API_KEY=your-api-key-here
|
|
302
|
-
|
|
303
|
-
✓ MCP server added to team
|
|
304
|
-
✓ Added to .mcp.json
|
|
305
|
-
|
|
306
|
-
Restart Claude Code to use the new server.
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
**Created Configuration:**
|
|
310
|
-
```json
|
|
311
|
-
{
|
|
312
|
-
"mcpServers": {
|
|
313
|
-
"weather-api": {
|
|
314
|
-
"command": "npx",
|
|
315
|
-
"args": ["-y", "@modelcontextprotocol/server-weather"],
|
|
316
|
-
"env": {
|
|
317
|
-
"API_KEY": "your-api-key-here"
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
**Examples:**
|
|
325
|
-
|
|
326
|
-
**Node.js server:**
|
|
327
|
-
```bash
|
|
328
|
-
jive mcp add my-server
|
|
329
|
-
# Command: node
|
|
330
|
-
# Arguments: dist/server.js
|
|
331
|
-
# Environment: PORT=3000
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
**Python server:**
|
|
335
|
-
```bash
|
|
336
|
-
jive mcp add python-tools
|
|
337
|
-
# Command: python
|
|
338
|
-
# Arguments: -m, mcp_server
|
|
339
|
-
# Environment: PYTHONPATH=/path/to/modules
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
**NPM package:**
|
|
343
|
-
```bash
|
|
344
|
-
jive mcp add filesystem
|
|
345
|
-
# Command: npx
|
|
346
|
-
# Arguments: -y, @modelcontextprotocol/server-filesystem, /allowed/path
|
|
347
|
-
# Environment: (none)
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
**Notes:**
|
|
351
|
-
- Server is immediately available to team members (after they pull)
|
|
352
|
-
- Must restart Claude Code to use the new server
|
|
353
|
-
- Environment variables are stored in `.mcp.json` (keep secrets safe!)
|
|
354
|
-
|
|
355
|
-
**Error Conditions:**
|
|
356
|
-
- Not authenticated
|
|
357
|
-
- Project not initialized
|
|
358
|
-
- Server name already exists
|
|
359
|
-
- Network connectivity issues
|
|
360
|
-
- Invalid command or arguments
|
|
361
|
-
|
|
362
|
-
**Implementation:** `src/commands/mcp.ts` (mcpCommands.add)
|
|
363
|
-
|
|
364
|
-
---
|
|
365
|
-
|
|
366
|
-
### `jive mcp remove <name-or-id>`
|
|
367
|
-
|
|
368
|
-
Remove an MCP server from the team.
|
|
369
|
-
|
|
370
|
-
**Usage:**
|
|
371
|
-
```bash
|
|
372
|
-
jive mcp remove <name-or-id>
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
**Arguments:**
|
|
376
|
-
- `<name-or-id>` (required) - Name or ID of MCP server to remove
|
|
377
|
-
|
|
378
|
-
**Requirements:**
|
|
379
|
-
- Must be authenticated
|
|
380
|
-
- Must be in a Jive-initialized project
|
|
381
|
-
|
|
382
|
-
**Interactive Prompts:**
|
|
383
|
-
- **Confirmation:** "Are you sure you want to remove {name}?" (Y/n)
|
|
384
|
-
|
|
385
|
-
**Process:**
|
|
386
|
-
1. Fetches team MCP servers to find match by name or ID
|
|
387
|
-
2. Displays server details
|
|
388
|
-
3. Prompts for confirmation
|
|
389
|
-
4. Deletes from server via `DELETE /api/mcp-servers/{id}`
|
|
390
|
-
5. Removes from local `.mcp.json` if present
|
|
391
|
-
|
|
392
|
-
**Output:**
|
|
393
|
-
```bash
|
|
394
|
-
jive mcp remove weather-api
|
|
395
|
-
```
|
|
396
|
-
```
|
|
397
|
-
Found MCP server: weather-api
|
|
398
|
-
Command: npx -y @modelcontextprotocol/server-weather
|
|
399
|
-
ID: mcp-123
|
|
400
|
-
|
|
401
|
-
? Are you sure you want to remove weather-api? (Y/n) Yes
|
|
402
|
-
|
|
403
|
-
✓ Removed from team
|
|
404
|
-
✓ Removed from .mcp.json
|
|
405
|
-
|
|
406
|
-
Restart Claude Code to apply changes.
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
**By ID:**
|
|
410
|
-
```bash
|
|
411
|
-
jive mcp remove mcp-123
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
**Before Removal:**
|
|
415
|
-
```json
|
|
416
|
-
{
|
|
417
|
-
"mcpServers": {
|
|
418
|
-
"weather-api": { "command": "npx", "args": ["..."] },
|
|
419
|
-
"file-system": { "command": "npx", "args": ["..."] }
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
**After Removal:**
|
|
425
|
-
```json
|
|
426
|
-
{
|
|
427
|
-
"mcpServers": {
|
|
428
|
-
"file-system": { "command": "npx", "args": ["..."] }
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
**Notes:**
|
|
434
|
-
- Removes from team (affects all team members)
|
|
435
|
-
- Also removes from local `.mcp.json` if present
|
|
436
|
-
- Cannot remove `jive-mcp` server (reserved)
|
|
437
|
-
- Other team members will still have local configuration until they pull
|
|
438
|
-
|
|
439
|
-
**Error Conditions:**
|
|
440
|
-
- Not authenticated
|
|
441
|
-
- Project not initialized
|
|
442
|
-
- MCP server not found
|
|
443
|
-
- Attempting to remove `jive-mcp`
|
|
444
|
-
- User cancels confirmation
|
|
445
|
-
- Network connectivity issues
|
|
446
|
-
|
|
447
|
-
**Implementation:** `src/commands/mcp.ts` (mcpCommands.remove)
|
|
448
|
-
|
|
449
|
-
---
|
|
450
|
-
|
|
451
|
-
### `jive mcp start`
|
|
452
|
-
|
|
453
|
-
Start the Jive MCP server for stdio communication.
|
|
454
|
-
|
|
455
|
-
**Usage:**
|
|
456
|
-
```bash
|
|
457
|
-
jive mcp start
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
**Requirements:**
|
|
461
|
-
- Must be authenticated
|
|
462
|
-
- Must have active team configured
|
|
463
|
-
|
|
464
|
-
**Process:**
|
|
465
|
-
1. Initializes MCP server with stdio transport
|
|
466
|
-
2. Provides tools for Claude Code integration:
|
|
467
|
-
- `search_subagents` - Search for subagents by name/description
|
|
468
|
-
- `call_subagent` - Get subagent prompt with user input
|
|
469
|
-
- `search_tools` - Search for MCP tools across servers
|
|
470
|
-
- `get_tools` - Get TypeScript definitions for tools
|
|
471
|
-
- `call_tool` - Execute TypeScript code that calls MCP tools
|
|
472
|
-
3. Manages connections to other MCP servers
|
|
473
|
-
4. Handles tool execution and code transpilation
|
|
474
|
-
|
|
475
|
-
**Output:**
|
|
476
|
-
```
|
|
477
|
-
Starting Jive MCP server...
|
|
478
|
-
Server running on stdio
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
**Notes:**
|
|
482
|
-
- This command is typically run automatically by Claude Code
|
|
483
|
-
- Not intended for direct user invocation
|
|
484
|
-
- Configured in `.mcp.json` by `jive init`
|
|
485
|
-
- Runs in the background as a Claude Code MCP server
|
|
486
|
-
|
|
487
|
-
**Tools Provided:**
|
|
488
|
-
|
|
489
|
-
**`search_subagents`:**
|
|
490
|
-
```json
|
|
491
|
-
{
|
|
492
|
-
"query": "code review"
|
|
493
|
-
}
|
|
494
|
-
```
|
|
495
|
-
Returns matching subagents.
|
|
496
|
-
|
|
497
|
-
**`call_subagent`:**
|
|
498
|
-
```json
|
|
499
|
-
{
|
|
500
|
-
"name": "code-reviewer",
|
|
501
|
-
"input": "Review this code..."
|
|
502
|
-
}
|
|
503
|
-
```
|
|
504
|
-
Returns subagent prompt with injected input.
|
|
505
|
-
|
|
506
|
-
**`search_tools`:**
|
|
507
|
-
```json
|
|
508
|
-
{
|
|
509
|
-
"query": "file"
|
|
510
|
-
}
|
|
511
|
-
```
|
|
512
|
-
Returns MCP tools matching the query.
|
|
513
|
-
|
|
514
|
-
**`get_tools`:**
|
|
515
|
-
```json
|
|
516
|
-
{
|
|
517
|
-
"server": "weather-api",
|
|
518
|
-
"tools": ["get_forecast"]
|
|
519
|
-
}
|
|
520
|
-
```
|
|
521
|
-
Returns TypeScript definitions for the tools.
|
|
522
|
-
|
|
523
|
-
**`call_tool`:**
|
|
524
|
-
```json
|
|
525
|
-
{
|
|
526
|
-
"code": "const forecast = await getWeatherForecast({city: 'NYC'});"
|
|
527
|
-
}
|
|
528
|
-
```
|
|
529
|
-
Transpiles and executes TypeScript code calling MCP tools.
|
|
530
|
-
|
|
531
|
-
**Error Conditions:**
|
|
532
|
-
- Not authenticated
|
|
533
|
-
- No active team configured
|
|
534
|
-
- Port already in use (stdio conflicts)
|
|
535
|
-
|
|
536
|
-
**Implementation:** `src/mcp/index.ts`
|
|
537
|
-
|
|
538
|
-
---
|
|
539
|
-
|
|
540
|
-
## MCP Workflows
|
|
541
|
-
|
|
542
|
-
### Adding a Public MCP Server
|
|
543
|
-
|
|
544
|
-
1. **Find the MCP server package:**
|
|
545
|
-
- Search npm: `@modelcontextprotocol/server-*`
|
|
546
|
-
- Check MCP documentation
|
|
547
|
-
|
|
548
|
-
2. **Add to team:**
|
|
549
|
-
```bash
|
|
550
|
-
jive mcp add weather-api
|
|
551
|
-
```
|
|
552
|
-
- Command: `npx`
|
|
553
|
-
- Arguments: `-y, @modelcontextprotocol/server-weather`
|
|
554
|
-
- Environment: `API_KEY=your-key`
|
|
555
|
-
|
|
556
|
-
3. **Team members pull:**
|
|
557
|
-
```bash
|
|
558
|
-
jive mcp pull
|
|
559
|
-
```
|
|
560
|
-
|
|
561
|
-
4. **Restart Claude Code**
|
|
562
|
-
|
|
563
|
-
### Adding a Custom MCP Server
|
|
564
|
-
|
|
565
|
-
1. **Develop your MCP server:**
|
|
566
|
-
```javascript
|
|
567
|
-
// server.js
|
|
568
|
-
const { Server } = require('@modelcontextprotocol/sdk/server');
|
|
569
|
-
// ... implement server
|
|
570
|
-
```
|
|
571
|
-
|
|
572
|
-
2. **Add to team:**
|
|
573
|
-
```bash
|
|
574
|
-
jive mcp add my-custom-server
|
|
575
|
-
```
|
|
576
|
-
- Command: `node`
|
|
577
|
-
- Arguments: `path/to/server.js`
|
|
578
|
-
- Environment: `CONFIG_PATH=...`
|
|
579
|
-
|
|
580
|
-
3. **Share with team:**
|
|
581
|
-
- Team members run `jive mcp pull`
|
|
582
|
-
- They need access to the server code (shared repo)
|
|
583
|
-
|
|
584
|
-
### Managing Environment Variables
|
|
585
|
-
|
|
586
|
-
**Development vs Production:**
|
|
587
|
-
|
|
588
|
-
`.mcp.json` (committed):
|
|
589
|
-
```json
|
|
590
|
-
{
|
|
591
|
-
"mcpServers": {
|
|
592
|
-
"weather-api": {
|
|
593
|
-
"command": "npx",
|
|
594
|
-
"args": ["-y", "server-weather"],
|
|
595
|
-
"env": {
|
|
596
|
-
"API_KEY": "${WEATHER_API_KEY}"
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
`.env` (not committed):
|
|
604
|
-
```
|
|
605
|
-
WEATHER_API_KEY=actual-secret-key
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
**Security best practices:**
|
|
609
|
-
- Don't commit API keys to `.mcp.json`
|
|
610
|
-
- Use environment variable references: `${VAR_NAME}`
|
|
611
|
-
- Store actual values in `.env` (add to `.gitignore`)
|
|
612
|
-
- Share setup instructions with team
|
|
613
|
-
|
|
614
|
-
### Syncing MCP Configurations
|
|
615
|
-
|
|
616
|
-
**Initial setup (new team member):**
|
|
617
|
-
```bash
|
|
618
|
-
# After jive init
|
|
619
|
-
jive mcp pull
|
|
620
|
-
# Creates .mcp.json with team servers
|
|
621
|
-
```
|
|
622
|
-
|
|
623
|
-
**Regular updates:**
|
|
624
|
-
```bash
|
|
625
|
-
# Pull team changes
|
|
626
|
-
jive mcp pull --merge
|
|
627
|
-
# Preserves local-only servers
|
|
628
|
-
|
|
629
|
-
# Restart Claude Code
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
**Sharing local additions:**
|
|
633
|
-
```bash
|
|
634
|
-
# Add server locally (edit .mcp.json or use jive mcp add)
|
|
635
|
-
jive mcp push
|
|
636
|
-
# Shares with team
|
|
637
|
-
```
|
|
638
|
-
|
|
639
|
-
## MCP Server Configuration
|
|
640
|
-
|
|
641
|
-
### Server Types
|
|
642
|
-
|
|
643
|
-
**npm packages:**
|
|
644
|
-
```json
|
|
645
|
-
{
|
|
646
|
-
"command": "npx",
|
|
647
|
-
"args": ["-y", "@org/package-name", "...args"]
|
|
648
|
-
}
|
|
649
|
-
```
|
|
650
|
-
|
|
651
|
-
**Node.js scripts:**
|
|
652
|
-
```json
|
|
653
|
-
{
|
|
654
|
-
"command": "node",
|
|
655
|
-
"args": ["path/to/server.js"]
|
|
656
|
-
}
|
|
657
|
-
```
|
|
658
|
-
|
|
659
|
-
**Python modules:**
|
|
660
|
-
```json
|
|
661
|
-
{
|
|
662
|
-
"command": "python",
|
|
663
|
-
"args": ["-m", "module_name"]
|
|
664
|
-
}
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
**Executables:**
|
|
668
|
-
```json
|
|
669
|
-
{
|
|
670
|
-
"command": "/path/to/executable",
|
|
671
|
-
"args": ["--option", "value"]
|
|
672
|
-
}
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
### Environment Variables
|
|
676
|
-
|
|
677
|
-
**Simple values:**
|
|
678
|
-
```json
|
|
679
|
-
{
|
|
680
|
-
"env": {
|
|
681
|
-
"API_KEY": "your-key",
|
|
682
|
-
"PORT": "3000"
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
```
|
|
686
|
-
|
|
687
|
-
**References to shell environment:**
|
|
688
|
-
```json
|
|
689
|
-
{
|
|
690
|
-
"env": {
|
|
691
|
-
"API_KEY": "${WEATHER_API_KEY}",
|
|
692
|
-
"HOME": "${HOME}"
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
```
|
|
696
|
-
|
|
697
|
-
**Multiple variables:**
|
|
698
|
-
```json
|
|
699
|
-
{
|
|
700
|
-
"env": {
|
|
701
|
-
"DB_HOST": "localhost",
|
|
702
|
-
"DB_PORT": "5432",
|
|
703
|
-
"DB_USER": "admin",
|
|
704
|
-
"DB_PASS": "${DB_PASSWORD}"
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
```
|
|
708
|
-
|
|
709
|
-
### The jive-mcp Server
|
|
710
|
-
|
|
711
|
-
**Special server added by `jive init`:**
|
|
712
|
-
```json
|
|
713
|
-
{
|
|
714
|
-
"jive-mcp": {
|
|
715
|
-
"command": "npx",
|
|
716
|
-
"args": ["-y", "jive-cli", "mcp", "start"],
|
|
717
|
-
"env": {
|
|
718
|
-
"JIVE_API_URL": "https://next.getjive.app",
|
|
719
|
-
"JIVE_TEAM_ID": "team-abc123",
|
|
720
|
-
"JIVE_AUTH_TOKEN": "your-token"
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
```
|
|
725
|
-
|
|
726
|
-
**Purpose:**
|
|
727
|
-
- Provides subagent execution tools
|
|
728
|
-
- Enables MCP tool discovery and execution
|
|
729
|
-
- Connects Claude Code to Jive platform
|
|
730
|
-
|
|
731
|
-
**Notes:**
|
|
732
|
-
- Never pushed to team (excluded by `jive mcp push`)
|
|
733
|
-
- Never removed by `jive mcp pull` (always preserved)
|
|
734
|
-
- Re-created/updated by `jive init`
|
|
735
|
-
|
|
736
|
-
## Troubleshooting
|
|
737
|
-
|
|
738
|
-
### MCP Server Not Loading
|
|
739
|
-
|
|
740
|
-
**Symptoms:**
|
|
741
|
-
- Server appears in `.mcp.json` but tools not available
|
|
742
|
-
- Claude Code doesn't recognize server
|
|
743
|
-
|
|
744
|
-
**Solutions:**
|
|
745
|
-
1. Restart Claude Code
|
|
746
|
-
2. Check server configuration:
|
|
747
|
-
```bash
|
|
748
|
-
jive doctor
|
|
749
|
-
```
|
|
750
|
-
3. Verify command is valid:
|
|
751
|
-
```bash
|
|
752
|
-
npx -y @modelcontextprotocol/server-weather
|
|
753
|
-
```
|
|
754
|
-
4. Check Claude Code MCP logs
|
|
755
|
-
|
|
756
|
-
### Environment Variables Not Working
|
|
757
|
-
|
|
758
|
-
**Symptoms:**
|
|
759
|
-
- Server fails to start
|
|
760
|
-
- Authentication errors
|
|
761
|
-
|
|
762
|
-
**Solutions:**
|
|
763
|
-
1. Check variable references:
|
|
764
|
-
```json
|
|
765
|
-
"env": {
|
|
766
|
-
"API_KEY": "${MY_API_KEY}" // Shell env var
|
|
767
|
-
}
|
|
768
|
-
```
|
|
769
|
-
|
|
770
|
-
2. Set variables in shell:
|
|
771
|
-
```bash
|
|
772
|
-
export MY_API_KEY=actual-key
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
3. Or use `.env` file (if supported)
|
|
776
|
-
|
|
777
|
-
4. Or use literal values (not recommended for secrets):
|
|
778
|
-
```json
|
|
779
|
-
"env": {
|
|
780
|
-
"API_KEY": "actual-key" // Not recommended
|
|
781
|
-
}
|
|
782
|
-
```
|
|
783
|
-
|
|
784
|
-
### Pull Overwrites Local Changes
|
|
785
|
-
|
|
786
|
-
**Symptoms:**
|
|
787
|
-
- Local-only servers removed after `jive mcp pull`
|
|
788
|
-
|
|
789
|
-
**Solutions:**
|
|
790
|
-
1. Always use `--merge` to preserve local servers:
|
|
791
|
-
```bash
|
|
792
|
-
jive mcp pull --merge
|
|
793
|
-
```
|
|
794
|
-
|
|
795
|
-
2. Restore from backup:
|
|
796
|
-
```bash
|
|
797
|
-
cp .mcp.json.backup .mcp.json
|
|
798
|
-
```
|
|
799
|
-
|
|
800
|
-
3. Re-add local servers:
|
|
801
|
-
```bash
|
|
802
|
-
jive mcp add my-local-server
|
|
803
|
-
```
|
|
804
|
-
|
|
805
|
-
### Backup File Issues
|
|
806
|
-
|
|
807
|
-
**Symptoms:**
|
|
808
|
-
- `.mcp.json.backup` accumulating
|
|
809
|
-
|
|
810
|
-
**Solutions:**
|
|
811
|
-
```bash
|
|
812
|
-
# Remove old backups
|
|
813
|
-
rm .mcp.json.backup
|
|
814
|
-
|
|
815
|
-
# Add to .gitignore
|
|
816
|
-
echo ".mcp.json.backup" >> .gitignore
|
|
817
|
-
```
|
|
818
|
-
|
|
819
|
-
## Security Considerations
|
|
820
|
-
|
|
821
|
-
### API Keys and Secrets
|
|
822
|
-
|
|
823
|
-
**Never commit secrets to version control:**
|
|
824
|
-
|
|
825
|
-
❌ **Bad:**
|
|
826
|
-
```json
|
|
827
|
-
{
|
|
828
|
-
"env": {
|
|
829
|
-
"API_KEY": "sk-actual-secret-key"
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
✅ **Good:**
|
|
835
|
-
```json
|
|
836
|
-
{
|
|
837
|
-
"env": {
|
|
838
|
-
"API_KEY": "${WEATHER_API_KEY}"
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
```
|
|
842
|
-
|
|
843
|
-
**Share setup instructions:**
|
|
844
|
-
```markdown
|
|
845
|
-
## Setup
|
|
846
|
-
|
|
847
|
-
1. Create `.env` file:
|
|
848
|
-
```
|
|
849
|
-
WEATHER_API_KEY=your-key-here
|
|
850
|
-
```
|
|
851
|
-
|
|
852
|
-
2. Pull MCP servers:
|
|
853
|
-
```bash
|
|
854
|
-
jive mcp pull
|
|
855
|
-
```
|
|
856
|
-
|
|
857
|
-
3. Restart Claude Code
|
|
858
|
-
```
|
|
859
|
-
|
|
860
|
-
### Team Sharing
|
|
861
|
-
|
|
862
|
-
- MCP server configurations are shared with the team
|
|
863
|
-
- Environment variable values in `.mcp.json` are visible to all team members
|
|
864
|
-
- Use variable references for secrets
|
|
865
|
-
- Document required environment variables for the team
|
|
866
|
-
|
|
867
|
-
## Related Commands
|
|
868
|
-
|
|
869
|
-
- [`jive init`](./init.md#jive-init) - Adds `jive-mcp` server
|
|
870
|
-
- [`jive sync`](./sync.md#jive-sync) - Pulls all team resources including MCP servers
|
|
871
|
-
- [`jive team switch`](./team.md#jive-team-switch) - Change active team (affects which servers you see)
|
|
872
|
-
- [`jive doctor`](./init.md#jive-doctor) - Verify MCP configuration
|
|
873
|
-
|
|
874
|
-
## API Endpoints
|
|
875
|
-
|
|
876
|
-
**MCP Server Management:**
|
|
877
|
-
- `GET /api/teams/{teamId}/mcp-servers` - List team MCP servers
|
|
878
|
-
- `POST /api/teams/{teamId}/mcp-servers` - Create MCP server
|
|
879
|
-
- `GET /api/mcp-servers/{id}` - Get MCP server details
|
|
880
|
-
- `PUT /api/mcp-servers/{id}` - Update MCP server
|
|
881
|
-
- `DELETE /api/mcp-servers/{id}` - Delete MCP server
|
|
882
|
-
|
|
883
|
-
## Implementation Details
|
|
884
|
-
|
|
885
|
-
**Source Files:**
|
|
886
|
-
- Main implementation: `src/commands/mcp.ts`
|
|
887
|
-
- MCP server: `src/mcp/index.ts`
|
|
888
|
-
- Config helpers: `src/lib/config.ts`
|
|
889
|
-
- File utilities: `src/lib/fs-utils.ts`
|
|
890
|
-
|
|
891
|
-
**Key Functions:**
|
|
892
|
-
- `mcpCommands.list()` - Lists team MCP servers
|
|
893
|
-
- `mcpCommands.pull()` - Downloads MCP servers
|
|
894
|
-
- `mcpCommands.push()` - Uploads MCP servers
|
|
895
|
-
- `mcpCommands.add()` - Creates new MCP server
|
|
896
|
-
- `mcpCommands.remove()` - Deletes MCP server
|
|
897
|
-
- `startMcpServer()` - Starts Jive MCP server
|
|
898
|
-
- `loadMcpConfig()` - Reads `.mcp.json`
|
|
899
|
-
- `saveMcpConfig()` - Writes `.mcp.json`
|