@jive-ai/cli 0.0.14 → 0.0.16

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 (2) hide show
  1. package/dist/index.mjs +28 -19
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1281,8 +1281,8 @@ var McpConnectionManager = class {
1281
1281
  }
1282
1282
  return results;
1283
1283
  }
1284
- listTools() {
1285
- return Array.from(this.tools.values()).map((tool) => ({
1284
+ listTools(serverName) {
1285
+ return Array.from(this.tools.values()).filter((tool) => tool.serverName === serverName).map((tool) => ({
1286
1286
  id: tool.id,
1287
1287
  name: tool.toolName,
1288
1288
  description: truncateString(tool.description, 100)
@@ -1377,20 +1377,9 @@ async function startMcpServer() {
1377
1377
  const apiUrl = API_URL;
1378
1378
  log(`Jive server connecting to ${apiUrl}`);
1379
1379
  const connectionManager = new McpConnectionManager();
1380
- try {
1381
- const response = await fetch(`${apiUrl}/api/mcp-config`, {
1382
- method: "GET",
1383
- headers: { "X-API-Key": apiKey }
1384
- });
1385
- if (!response.ok) throw new Error(`Failed to fetch MCP configs: ${response.status} ${response.statusText}`);
1386
- const { servers } = await response.json();
1387
- log(`Found ${servers.length} MCP server config(s)`);
1388
- if (servers.length > 0) await connectionManager.initialize(servers);
1389
- else log("No MCP servers configured for this team");
1390
- } catch (error) {
1391
- log("Error fetching MCP configs:", error);
1392
- log("Continuing without MCP tool connections...");
1393
- }
1380
+ const mcpServers = await getApiClient().getMcpServers(teamId);
1381
+ if (mcpServers.length > 0) await connectionManager.initialize(mcpServers);
1382
+ else log("No MCP servers configured for this team");
1394
1383
  const server = new Server({
1395
1384
  name: "jive-mcp",
1396
1385
  version: "1.0.0"
@@ -1419,9 +1408,21 @@ async function startMcpServer() {
1419
1408
  required: ["id", "prompt"]
1420
1409
  }
1421
1410
  },
1411
+ {
1412
+ name: "list_mcp_servers",
1413
+ description: "List all MCP servers for the selected team. Returns lightweight list of server names, descriptions and IDs."
1414
+ },
1422
1415
  {
1423
1416
  name: "list_tools",
1424
- description: "List all MCP tools for the selected team. Returns lightweight list of tool names, descriptions and IDs."
1417
+ description: "List all MCP tools for the selected team. Returns lightweight list of tool names, descriptions and IDs.",
1418
+ inputSchema: {
1419
+ type: "object",
1420
+ properties: { server: {
1421
+ type: "string",
1422
+ description: "MCP server name to list tools for"
1423
+ } },
1424
+ required: ["server"]
1425
+ }
1425
1426
  },
1426
1427
  {
1427
1428
  name: "get_tools",
@@ -1513,8 +1514,16 @@ async function startMcpServer() {
1513
1514
  type: "text",
1514
1515
  text: (await apiRequest(`/api/subagents/${args.id}/call`, { prompt: args.prompt })).prompt
1515
1516
  }] };
1517
+ case "list_mcp_servers": {
1518
+ const serverQuery = args.server;
1519
+ const results = mcpServers.filter((server$1) => [server$1.id, server$1.name].some((name$1) => name$1.toLowerCase().includes(serverQuery.toLowerCase())));
1520
+ return { content: [{
1521
+ type: "text",
1522
+ text: JSON.stringify(results, null, 2)
1523
+ }] };
1524
+ }
1516
1525
  case "list_tools": {
1517
- const results = connectionManager.listTools();
1526
+ const results = connectionManager.listTools(args.server);
1518
1527
  return { content: [{
1519
1528
  type: "text",
1520
1529
  text: JSON.stringify(results, null, 2)
@@ -2086,7 +2095,7 @@ async function checkTeamMembership() {
2086
2095
 
2087
2096
  //#endregion
2088
2097
  //#region package.json
2089
- var version = "0.0.13";
2098
+ var version = "0.0.15";
2090
2099
 
2091
2100
  //#endregion
2092
2101
  //#region src/index.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@jive-ai/cli",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "dist",