@journeyrewards/hive-mcp-server 1.0.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/README.md +172 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +454 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Journey Hive MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server for Journey Hive Agent Orchestration. Enables AI assistants like Claude Desktop, Cursor, and other MCP-compatible clients to interact with your Journey Hive agent swarm.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @journeyrewards/hive-mcp-server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Run with npx
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @journeyrewards/hive-mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
### Environment Variables
|
|
22
|
+
|
|
23
|
+
| Variable | Description | Default |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `JOURNEY_HIVE_API_KEY` | Your Journey Hive API key (format: `jh_live_...` or `jh_test_...`) | Required |
|
|
26
|
+
| `JOURNEY_HIVE_BASE_URL` | Base URL for the Journey Hive API | `https://journey-hive.replit.app` |
|
|
27
|
+
|
|
28
|
+
### Claude Desktop
|
|
29
|
+
|
|
30
|
+
Add the following to your `claude_desktop_config.json`:
|
|
31
|
+
|
|
32
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
33
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"mcpServers": {
|
|
38
|
+
"journey-hive": {
|
|
39
|
+
"command": "npx",
|
|
40
|
+
"args": ["@journeyrewards/hive-mcp-server"],
|
|
41
|
+
"env": {
|
|
42
|
+
"JOURNEY_HIVE_API_KEY": "jh_live_your_api_key_here",
|
|
43
|
+
"JOURNEY_HIVE_BASE_URL": "https://journey-hive.replit.app"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If installed globally:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"journey-hive": {
|
|
56
|
+
"command": "hive-mcp",
|
|
57
|
+
"env": {
|
|
58
|
+
"JOURNEY_HIVE_API_KEY": "jh_live_your_api_key_here"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Cursor
|
|
66
|
+
|
|
67
|
+
Add to your Cursor MCP settings (`.cursor/mcp.json` in your project or global config):
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"journey-hive": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["@journeyrewards/hive-mcp-server"],
|
|
75
|
+
"env": {
|
|
76
|
+
"JOURNEY_HIVE_API_KEY": "jh_live_your_api_key_here"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Available Tools
|
|
84
|
+
|
|
85
|
+
| Tool | Description | Required Parameters |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| `send_message` | Send a message to an agent and get a response | `message` (agent_id optional if default configured) |
|
|
88
|
+
| `create_conversation` | Create a new conversation with an agent | None (agent_id optional if default configured) |
|
|
89
|
+
| `list_conversations` | List conversations, optionally filtered by agent | None |
|
|
90
|
+
| `get_conversation` | Get details of a specific conversation | `conversation_id` |
|
|
91
|
+
| `get_conversation_messages` | Get all messages in a conversation | `conversation_id` |
|
|
92
|
+
| `list_agents` | List all available agents | None |
|
|
93
|
+
| `get_agent` | Get details of a specific agent | `agent_id` |
|
|
94
|
+
| `update_agent_soul` | Update an agent's soul template or personality | `agent_id` |
|
|
95
|
+
| `get_usage` | Get API usage statistics | None |
|
|
96
|
+
|
|
97
|
+
### Tool Details
|
|
98
|
+
|
|
99
|
+
#### send_message
|
|
100
|
+
Send a message to a Journey Hive agent. Optionally continue an existing conversation or use streaming.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
Parameters:
|
|
104
|
+
- agent_id (string, required): The agent ID
|
|
105
|
+
- message (string, required): The message text
|
|
106
|
+
- conversation_id (string, optional): Continue an existing conversation
|
|
107
|
+
- stream (boolean, optional): Use streaming mode
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### create_conversation
|
|
111
|
+
Create a new conversation thread with an agent.
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Parameters:
|
|
115
|
+
- agent_id (string, required): The agent ID
|
|
116
|
+
- external_user_id (string, optional): External user identifier
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### list_conversations
|
|
120
|
+
List conversations with optional filters.
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Parameters:
|
|
124
|
+
- agent_id (string, optional): Filter by agent
|
|
125
|
+
- limit (number, optional): Max results to return
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### update_agent_soul
|
|
129
|
+
Update an agent's personality and behavior configuration.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Parameters:
|
|
133
|
+
- agent_id (string, required): The agent ID
|
|
134
|
+
- soul_template (string, optional): New soul template
|
|
135
|
+
- personality_notes (string, optional): New personality notes
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### get_usage
|
|
139
|
+
Get API usage statistics over a time period.
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Parameters:
|
|
143
|
+
- days (number, optional): Number of days to look back (default: 7)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Available Resources
|
|
147
|
+
|
|
148
|
+
| URI Pattern | Description |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `agent://{agent_id}` | Returns agent details as JSON |
|
|
151
|
+
| `conversation://{conversation_id}` | Returns conversation with all messages |
|
|
152
|
+
|
|
153
|
+
## Available Prompts
|
|
154
|
+
|
|
155
|
+
| Prompt | Description | Parameters |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `chat_with_agent` | Send a message and get a formatted response | `agent_id`, `message` |
|
|
158
|
+
| `analyze_conversation` | Analyze conversation history | `conversation_id` |
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Build
|
|
164
|
+
npm run build
|
|
165
|
+
|
|
166
|
+
# Run
|
|
167
|
+
npm start
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
5
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
7
|
+
const API_KEY = process.env.JOURNEY_HIVE_API_KEY || "";
|
|
8
|
+
const BASE_URL = (process.env.JOURNEY_HIVE_BASE_URL || "https://journey-hive.replit.app").replace(/\/+$/, "");
|
|
9
|
+
async function apiRequest(method, path, body) {
|
|
10
|
+
const url = `${BASE_URL}${path}`;
|
|
11
|
+
const headers = {
|
|
12
|
+
"Authorization": `Bearer ${API_KEY}`,
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
};
|
|
15
|
+
const res = await fetch(url, {
|
|
16
|
+
method,
|
|
17
|
+
headers,
|
|
18
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
19
|
+
});
|
|
20
|
+
if (!res.ok) {
|
|
21
|
+
const errorBody = await res.text();
|
|
22
|
+
let errorMessage;
|
|
23
|
+
try {
|
|
24
|
+
const parsed = JSON.parse(errorBody);
|
|
25
|
+
errorMessage = parsed.error?.message || errorBody;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
errorMessage = errorBody;
|
|
29
|
+
}
|
|
30
|
+
throw new Error(`API error ${res.status}: ${errorMessage}`);
|
|
31
|
+
}
|
|
32
|
+
return res.json();
|
|
33
|
+
}
|
|
34
|
+
async function apiRequestStreaming(path, body) {
|
|
35
|
+
const url = `${BASE_URL}${path}`;
|
|
36
|
+
const headers = {
|
|
37
|
+
"Authorization": `Bearer ${API_KEY}`,
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
};
|
|
40
|
+
const res = await fetch(url, {
|
|
41
|
+
method: "POST",
|
|
42
|
+
headers,
|
|
43
|
+
body: JSON.stringify(body),
|
|
44
|
+
});
|
|
45
|
+
if (!res.ok) {
|
|
46
|
+
const errorBody = await res.text();
|
|
47
|
+
let errorMessage;
|
|
48
|
+
try {
|
|
49
|
+
const parsed = JSON.parse(errorBody);
|
|
50
|
+
errorMessage = parsed.error?.message || errorBody;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
errorMessage = errorBody;
|
|
54
|
+
}
|
|
55
|
+
throw new Error(`API error ${res.status}: ${errorMessage}`);
|
|
56
|
+
}
|
|
57
|
+
const text = await res.text();
|
|
58
|
+
let accumulated = "";
|
|
59
|
+
const lines = text.split("\n");
|
|
60
|
+
for (const line of lines) {
|
|
61
|
+
if (line.startsWith("data: ")) {
|
|
62
|
+
try {
|
|
63
|
+
const data = JSON.parse(line.slice(6));
|
|
64
|
+
if (data.delta) {
|
|
65
|
+
accumulated += data.delta;
|
|
66
|
+
}
|
|
67
|
+
else if (data.text && !data.delta) {
|
|
68
|
+
accumulated = data.text;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// skip unparseable lines
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return accumulated || text;
|
|
77
|
+
}
|
|
78
|
+
const server = new index_js_1.Server({
|
|
79
|
+
name: "journey-hive",
|
|
80
|
+
version: "1.0.0",
|
|
81
|
+
}, {
|
|
82
|
+
capabilities: {
|
|
83
|
+
tools: {},
|
|
84
|
+
resources: {},
|
|
85
|
+
prompts: {},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
89
|
+
tools: [
|
|
90
|
+
{
|
|
91
|
+
name: "send_message",
|
|
92
|
+
description: "Send a message to a Journey Hive agent and get a response",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
agent_id: { type: "string", description: "The agent ID to send the message to. Optional if a default controller agent is configured on the server." },
|
|
97
|
+
message: { type: "string", description: "The message text to send" },
|
|
98
|
+
conversation_id: { type: "string", description: "Optional conversation ID to continue an existing conversation" },
|
|
99
|
+
stream: { type: "boolean", description: "Whether to use streaming (returns accumulated text)" },
|
|
100
|
+
},
|
|
101
|
+
required: ["message"],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "create_conversation",
|
|
106
|
+
description: "Create a new conversation with a Journey Hive agent",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
agent_id: { type: "string", description: "The agent ID to create a conversation with. Optional if a default controller agent is configured." },
|
|
111
|
+
external_user_id: { type: "string", description: "Optional external user identifier" },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "list_conversations",
|
|
117
|
+
description: "List conversations, optionally filtered by agent",
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
agent_id: { type: "string", description: "Filter by agent ID" },
|
|
122
|
+
limit: { type: "number", description: "Maximum number of conversations to return" },
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "get_conversation",
|
|
128
|
+
description: "Get details of a specific conversation",
|
|
129
|
+
inputSchema: {
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: {
|
|
132
|
+
conversation_id: { type: "string", description: "The conversation ID" },
|
|
133
|
+
},
|
|
134
|
+
required: ["conversation_id"],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "get_conversation_messages",
|
|
139
|
+
description: "Get all messages in a conversation",
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
conversation_id: { type: "string", description: "The conversation ID" },
|
|
144
|
+
},
|
|
145
|
+
required: ["conversation_id"],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "list_agents",
|
|
150
|
+
description: "List all available Journey Hive agents",
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: "object",
|
|
153
|
+
properties: {},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "get_agent",
|
|
158
|
+
description: "Get details of a specific agent",
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: "object",
|
|
161
|
+
properties: {
|
|
162
|
+
agent_id: { type: "string", description: "The agent ID" },
|
|
163
|
+
},
|
|
164
|
+
required: ["agent_id"],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "update_agent_soul",
|
|
169
|
+
description: "Update an agent's soul template or personality notes",
|
|
170
|
+
inputSchema: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
agent_id: { type: "string", description: "The agent ID to update" },
|
|
174
|
+
soul_template: { type: "string", description: "New soul template content" },
|
|
175
|
+
personality_notes: { type: "string", description: "New personality notes" },
|
|
176
|
+
},
|
|
177
|
+
required: ["agent_id"],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "get_usage",
|
|
182
|
+
description: "Get API usage statistics",
|
|
183
|
+
inputSchema: {
|
|
184
|
+
type: "object",
|
|
185
|
+
properties: {
|
|
186
|
+
days: { type: "number", description: "Number of days to look back (default: 7)" },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
}));
|
|
192
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
193
|
+
const { name, arguments: args } = request.params;
|
|
194
|
+
try {
|
|
195
|
+
switch (name) {
|
|
196
|
+
case "send_message": {
|
|
197
|
+
const { agent_id, message, conversation_id, stream } = args;
|
|
198
|
+
const body = {
|
|
199
|
+
input: message,
|
|
200
|
+
stream: !!stream,
|
|
201
|
+
};
|
|
202
|
+
if (agent_id)
|
|
203
|
+
body.agent_id = agent_id;
|
|
204
|
+
if (conversation_id)
|
|
205
|
+
body.conversation_id = conversation_id;
|
|
206
|
+
if (stream) {
|
|
207
|
+
const text = await apiRequestStreaming("/v1/responses", body);
|
|
208
|
+
return {
|
|
209
|
+
content: [{ type: "text", text }],
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
const result = await apiRequest("POST", "/v1/responses", body);
|
|
213
|
+
const outputText = result.output?.[0]?.content?.[0]?.text || JSON.stringify(result);
|
|
214
|
+
return {
|
|
215
|
+
content: [{ type: "text", text: outputText }],
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
case "create_conversation": {
|
|
219
|
+
const { agent_id, external_user_id } = args;
|
|
220
|
+
const body = {};
|
|
221
|
+
if (agent_id)
|
|
222
|
+
body.agent_id = agent_id;
|
|
223
|
+
if (external_user_id)
|
|
224
|
+
body.external_user_id = external_user_id;
|
|
225
|
+
const result = await apiRequest("POST", "/v1/conversations", body);
|
|
226
|
+
return {
|
|
227
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
case "list_conversations": {
|
|
231
|
+
const { agent_id, limit } = args;
|
|
232
|
+
const params = new URLSearchParams();
|
|
233
|
+
if (agent_id)
|
|
234
|
+
params.set("agent_id", agent_id);
|
|
235
|
+
if (limit)
|
|
236
|
+
params.set("limit", String(limit));
|
|
237
|
+
const query = params.toString();
|
|
238
|
+
const path = `/v1/conversations${query ? `?${query}` : ""}`;
|
|
239
|
+
const result = await apiRequest("GET", path);
|
|
240
|
+
return {
|
|
241
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
case "get_conversation": {
|
|
245
|
+
const { conversation_id } = args;
|
|
246
|
+
const result = await apiRequest("GET", `/v1/conversations/${conversation_id}`);
|
|
247
|
+
return {
|
|
248
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
case "get_conversation_messages": {
|
|
252
|
+
const { conversation_id } = args;
|
|
253
|
+
const result = await apiRequest("GET", `/v1/conversations/${conversation_id}/messages`);
|
|
254
|
+
return {
|
|
255
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
case "list_agents": {
|
|
259
|
+
const result = await apiRequest("GET", "/v1/agents");
|
|
260
|
+
return {
|
|
261
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
case "get_agent": {
|
|
265
|
+
const { agent_id } = args;
|
|
266
|
+
const result = await apiRequest("GET", `/v1/agents/${agent_id}`);
|
|
267
|
+
return {
|
|
268
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
case "update_agent_soul": {
|
|
272
|
+
const { agent_id, soul_template, personality_notes } = args;
|
|
273
|
+
const body = {};
|
|
274
|
+
if (soul_template !== undefined)
|
|
275
|
+
body.soul_template = soul_template;
|
|
276
|
+
if (personality_notes !== undefined)
|
|
277
|
+
body.personality_notes = personality_notes;
|
|
278
|
+
const result = await apiRequest("PATCH", `/v1/agents/${agent_id}`, body);
|
|
279
|
+
return {
|
|
280
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
case "get_usage": {
|
|
284
|
+
const { days } = args;
|
|
285
|
+
const params = days ? `?days=${days}` : "";
|
|
286
|
+
const result = await apiRequest("GET", `/v1/usage${params}`);
|
|
287
|
+
return {
|
|
288
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
default:
|
|
292
|
+
return {
|
|
293
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
294
|
+
isError: true,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
300
|
+
return {
|
|
301
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
302
|
+
isError: true,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => ({
|
|
307
|
+
resources: [
|
|
308
|
+
{
|
|
309
|
+
uri: "agent://list",
|
|
310
|
+
name: "Agent List",
|
|
311
|
+
description: "List of all available Journey Hive agents",
|
|
312
|
+
mimeType: "application/json",
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
}));
|
|
316
|
+
server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
|
|
317
|
+
const { uri } = request.params;
|
|
318
|
+
if (uri === "agent://list") {
|
|
319
|
+
const result = await apiRequest("GET", "/v1/agents");
|
|
320
|
+
return {
|
|
321
|
+
contents: [
|
|
322
|
+
{
|
|
323
|
+
uri,
|
|
324
|
+
mimeType: "application/json",
|
|
325
|
+
text: JSON.stringify(result, null, 2),
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
const agentMatch = uri.match(/^agent:\/\/(.+)$/);
|
|
331
|
+
if (agentMatch) {
|
|
332
|
+
const agentId = agentMatch[1];
|
|
333
|
+
const result = await apiRequest("GET", `/v1/agents/${agentId}`);
|
|
334
|
+
return {
|
|
335
|
+
contents: [
|
|
336
|
+
{
|
|
337
|
+
uri,
|
|
338
|
+
mimeType: "application/json",
|
|
339
|
+
text: JSON.stringify(result, null, 2),
|
|
340
|
+
},
|
|
341
|
+
],
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
const convMatch = uri.match(/^conversation:\/\/(.+)$/);
|
|
345
|
+
if (convMatch) {
|
|
346
|
+
const conversationId = convMatch[1];
|
|
347
|
+
const [conversation, messages] = await Promise.all([
|
|
348
|
+
apiRequest("GET", `/v1/conversations/${conversationId}`),
|
|
349
|
+
apiRequest("GET", `/v1/conversations/${conversationId}/messages`),
|
|
350
|
+
]);
|
|
351
|
+
return {
|
|
352
|
+
contents: [
|
|
353
|
+
{
|
|
354
|
+
uri,
|
|
355
|
+
mimeType: "application/json",
|
|
356
|
+
text: JSON.stringify({ conversation, messages }, null, 2),
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
throw new Error(`Unknown resource URI: ${uri}`);
|
|
362
|
+
});
|
|
363
|
+
server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async () => ({
|
|
364
|
+
prompts: [
|
|
365
|
+
{
|
|
366
|
+
name: "chat_with_agent",
|
|
367
|
+
description: "Send a message to a Journey Hive agent and get a formatted response",
|
|
368
|
+
arguments: [
|
|
369
|
+
{ name: "agent_id", description: "The agent ID to chat with", required: true },
|
|
370
|
+
{ name: "message", description: "The message to send", required: true },
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: "analyze_conversation",
|
|
375
|
+
description: "Fetch conversation history and provide analysis",
|
|
376
|
+
arguments: [
|
|
377
|
+
{ name: "conversation_id", description: "The conversation ID to analyze", required: true },
|
|
378
|
+
],
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
}));
|
|
382
|
+
server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request) => {
|
|
383
|
+
const { name, arguments: args } = request.params;
|
|
384
|
+
switch (name) {
|
|
385
|
+
case "chat_with_agent": {
|
|
386
|
+
const agentId = args?.agent_id;
|
|
387
|
+
const message = args?.message;
|
|
388
|
+
if (!agentId || !message) {
|
|
389
|
+
throw new Error("agent_id and message are required");
|
|
390
|
+
}
|
|
391
|
+
const result = await apiRequest("POST", "/v1/responses", {
|
|
392
|
+
agent_id: agentId,
|
|
393
|
+
input: message,
|
|
394
|
+
});
|
|
395
|
+
const responseText = result.output?.[0]?.content?.[0]?.text || JSON.stringify(result);
|
|
396
|
+
return {
|
|
397
|
+
description: `Response from agent ${agentId}`,
|
|
398
|
+
messages: [
|
|
399
|
+
{
|
|
400
|
+
role: "user",
|
|
401
|
+
content: {
|
|
402
|
+
type: "text",
|
|
403
|
+
text: `I sent the following message to Journey Hive agent ${agentId}:\n\n"${message}"\n\nThe agent responded:\n\n${responseText}`,
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
case "analyze_conversation": {
|
|
410
|
+
const conversationId = args?.conversation_id;
|
|
411
|
+
if (!conversationId) {
|
|
412
|
+
throw new Error("conversation_id is required");
|
|
413
|
+
}
|
|
414
|
+
const [conversation, messagesResult] = await Promise.all([
|
|
415
|
+
apiRequest("GET", `/v1/conversations/${conversationId}`),
|
|
416
|
+
apiRequest("GET", `/v1/conversations/${conversationId}/messages`),
|
|
417
|
+
]);
|
|
418
|
+
const messages = messagesResult.data || [];
|
|
419
|
+
const formattedMessages = messages
|
|
420
|
+
.map((m) => {
|
|
421
|
+
const text = m.content?.[0]?.text || "";
|
|
422
|
+
return `[${m.role}]: ${text}`;
|
|
423
|
+
})
|
|
424
|
+
.join("\n\n");
|
|
425
|
+
return {
|
|
426
|
+
description: `Analysis of conversation ${conversationId}`,
|
|
427
|
+
messages: [
|
|
428
|
+
{
|
|
429
|
+
role: "user",
|
|
430
|
+
content: {
|
|
431
|
+
type: "text",
|
|
432
|
+
text: `Please analyze the following conversation from Journey Hive (conversation ID: ${conversationId}, agent: ${conversation.agent_id}, status: ${conversation.status}):\n\n${formattedMessages}\n\nProvide insights on:\n1. The main topics discussed\n2. The quality and helpfulness of agent responses\n3. Any issues or areas for improvement\n4. A summary of the conversation flow`,
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
default:
|
|
439
|
+
throw new Error(`Unknown prompt: ${name}`);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
async function main() {
|
|
443
|
+
if (!API_KEY) {
|
|
444
|
+
console.error("Warning: JOURNEY_HIVE_API_KEY environment variable is not set");
|
|
445
|
+
}
|
|
446
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
447
|
+
await server.connect(transport);
|
|
448
|
+
console.error("Journey Hive MCP server running on stdio");
|
|
449
|
+
}
|
|
450
|
+
main().catch((error) => {
|
|
451
|
+
console.error("Fatal error:", error);
|
|
452
|
+
process.exit(1);
|
|
453
|
+
});
|
|
454
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src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0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@journeyrewards/hive-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for Journey Hive Agent Orchestration — use with Claude Desktop, Cursor, and other MCP clients",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"hive-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/journeyrewards/hive-mcp-server"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://journey-hive.replit.app/api-guides",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"journeyrewards",
|
|
27
|
+
"journey-hive",
|
|
28
|
+
"mcp",
|
|
29
|
+
"model-context-protocol",
|
|
30
|
+
"ai-agents",
|
|
31
|
+
"claude-desktop"
|
|
32
|
+
],
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"typescript": "^5.4.0"
|
|
41
|
+
}
|
|
42
|
+
}
|