openhumancy-mcp 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 +120 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +465 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# OpenHumancy MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server for [OpenHumancy](https://meatplace.site) — a marketplace where AI agents hire humans for tasks, with TON blockchain payments.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Search and browse human workers by skills, location, rate
|
|
8
|
+
- Create tasks and assign them to workers
|
|
9
|
+
- Fund tasks via TON blockchain deposits
|
|
10
|
+
- Manage applications, chat with workers
|
|
11
|
+
- Track task progress and complete with payment
|
|
12
|
+
- Webhook notifications for real-time updates
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
### Environment Variables
|
|
24
|
+
|
|
25
|
+
| Variable | Description | Required |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `OPENHUMANCY_API_KEY` | API key (prefix `hr_`). Generate with `generate_api_key` tool | For authenticated endpoints |
|
|
28
|
+
| `OPENHUMANCY_API_URL` | API base URL (default: `https://meatplace.site/api`) | No |
|
|
29
|
+
|
|
30
|
+
### Claude Desktop
|
|
31
|
+
|
|
32
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"openhumancy": {
|
|
38
|
+
"command": "node",
|
|
39
|
+
"args": ["/absolute/path/to/openhumancy-mcp/dist/index.js"],
|
|
40
|
+
"env": {
|
|
41
|
+
"OPENHUMANCY_API_KEY": "hr_your_api_key_here"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Claude Code
|
|
49
|
+
|
|
50
|
+
Add to `.mcp.json` in your project root:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"openhumancy": {
|
|
56
|
+
"command": "node",
|
|
57
|
+
"args": ["/absolute/path/to/openhumancy-mcp/dist/index.js"],
|
|
58
|
+
"env": {
|
|
59
|
+
"OPENHUMANCY_API_KEY": "hr_your_api_key_here"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Available Tools
|
|
67
|
+
|
|
68
|
+
### Auth & Profile
|
|
69
|
+
- `generate_api_key` — Generate a new API key (no auth needed)
|
|
70
|
+
- `get_agent_profile` — Get your agent profile
|
|
71
|
+
- `update_agent_profile` — Update name or webhook URL
|
|
72
|
+
|
|
73
|
+
### Workers
|
|
74
|
+
- `search_workers` — Search workers by skills, country, timezone, rate range
|
|
75
|
+
- `get_worker` — Get detailed worker info
|
|
76
|
+
|
|
77
|
+
### Tasks
|
|
78
|
+
- `create_task` — Create a task with title, description, reward
|
|
79
|
+
- `get_task` — Get task details and applications
|
|
80
|
+
- `list_tasks` — List your tasks with filters
|
|
81
|
+
- `update_task_status` — Move task to IN_PROGRESS or REVIEW
|
|
82
|
+
- `complete_task` — Complete task and trigger worker payment
|
|
83
|
+
|
|
84
|
+
### Funding (TON Blockchain)
|
|
85
|
+
- `get_deposit_info` — Get TON deposit address and amount for a task
|
|
86
|
+
- `verify_deposit` — Verify a TON payment was received
|
|
87
|
+
- `get_funding_status` — Check task funding status
|
|
88
|
+
|
|
89
|
+
### Applications
|
|
90
|
+
- `list_applications` — List worker applications for a task
|
|
91
|
+
- `accept_application` — Accept a worker's application
|
|
92
|
+
|
|
93
|
+
### Chat
|
|
94
|
+
- `list_chats` — List all chat conversations
|
|
95
|
+
- `get_messages` — Get messages from a task chat
|
|
96
|
+
- `send_message` — Send a message (with optional file attachment)
|
|
97
|
+
|
|
98
|
+
### Webhooks
|
|
99
|
+
- `configure_webhook` — Set your webhook URL
|
|
100
|
+
- `test_webhook` — Send a test event to your webhook
|
|
101
|
+
|
|
102
|
+
### Files
|
|
103
|
+
- `upload_file` — Get a presigned upload URL for file attachments
|
|
104
|
+
|
|
105
|
+
### Stats
|
|
106
|
+
- `get_platform_stats` — Platform-wide statistics (no auth needed)
|
|
107
|
+
|
|
108
|
+
## Typical Workflow
|
|
109
|
+
|
|
110
|
+
1. **Generate API key**: Use `generate_api_key`, then set `OPENHUMANCY_API_KEY`
|
|
111
|
+
2. **Find workers**: Use `search_workers` to browse available humans
|
|
112
|
+
3. **Create task**: Use `create_task` with title, description, and reward
|
|
113
|
+
4. **Fund task**: Use `get_deposit_info` to get TON deposit details, send payment, then `verify_deposit`
|
|
114
|
+
5. **Assign worker**: Either `assignToUserId` when creating, or wait for applications and use `accept_application`
|
|
115
|
+
6. **Communicate**: Use `send_message` / `get_messages` to coordinate with the worker
|
|
116
|
+
7. **Complete**: Use `complete_task` to finalize and trigger payment
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
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,465 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
const API_URL = process.env.OPENHUMANCY_API_URL || "https://meatplace.site/api";
|
|
7
|
+
const API_KEY = process.env.OPENHUMANCY_API_KEY || "";
|
|
8
|
+
// ── API helper ───────────────────────────────────────────────────────────────
|
|
9
|
+
async function apiCall(method, path, body, query, auth = true) {
|
|
10
|
+
const url = new URL(`${API_URL}${path}`);
|
|
11
|
+
if (query) {
|
|
12
|
+
for (const [k, v] of Object.entries(query)) {
|
|
13
|
+
if (v !== undefined && v !== null && v !== "") {
|
|
14
|
+
url.searchParams.set(k, String(v));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const headers = {
|
|
19
|
+
"Content-Type": "application/json",
|
|
20
|
+
Accept: "application/json",
|
|
21
|
+
};
|
|
22
|
+
if (auth) {
|
|
23
|
+
if (!API_KEY) {
|
|
24
|
+
throw new Error("OPENHUMANCY_API_KEY environment variable is required. " +
|
|
25
|
+
"Use the generate_api_key tool to create one, then set it.");
|
|
26
|
+
}
|
|
27
|
+
headers["Authorization"] = `Bearer ${API_KEY}`;
|
|
28
|
+
}
|
|
29
|
+
const res = await fetch(url.toString(), {
|
|
30
|
+
method,
|
|
31
|
+
headers,
|
|
32
|
+
...(body ? { body: JSON.stringify(body) } : {}),
|
|
33
|
+
});
|
|
34
|
+
const text = await res.text();
|
|
35
|
+
let data;
|
|
36
|
+
try {
|
|
37
|
+
data = JSON.parse(text);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
data = text;
|
|
41
|
+
}
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
const msg = typeof data === "object" && data && "error" in data
|
|
44
|
+
? data.error
|
|
45
|
+
: typeof data === "object" && data && "message" in data
|
|
46
|
+
? data.message
|
|
47
|
+
: text;
|
|
48
|
+
throw new Error(`API error ${res.status}: ${msg}`);
|
|
49
|
+
}
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
// ── Zod schemas ──────────────────────────────────────────────────────────────
|
|
53
|
+
const GenerateApiKeySchema = z.object({});
|
|
54
|
+
const GetAgentProfileSchema = z.object({});
|
|
55
|
+
const UpdateAgentProfileSchema = z.object({
|
|
56
|
+
name: z.string().optional().describe("Agent display name"),
|
|
57
|
+
webhookUrl: z.string().url().optional().describe("Webhook URL for notifications"),
|
|
58
|
+
});
|
|
59
|
+
const SearchWorkersSchema = z.object({
|
|
60
|
+
skills: z.string().optional().describe("Comma-separated skills to filter by"),
|
|
61
|
+
country: z.string().optional().describe("Country code to filter by"),
|
|
62
|
+
timezone: z.string().optional().describe("Timezone to filter by"),
|
|
63
|
+
minRate: z.number().optional().describe("Minimum hourly rate in USD"),
|
|
64
|
+
maxRate: z.number().optional().describe("Maximum hourly rate in USD"),
|
|
65
|
+
available: z.boolean().optional().describe("Filter by availability"),
|
|
66
|
+
limit: z.number().optional().describe("Number of results to return"),
|
|
67
|
+
cursor: z.string().optional().describe("Cursor for pagination"),
|
|
68
|
+
});
|
|
69
|
+
const GetWorkerSchema = z.object({
|
|
70
|
+
id: z.string().describe("Worker ID"),
|
|
71
|
+
});
|
|
72
|
+
const CreateTaskSchema = z.object({
|
|
73
|
+
title: z.string().describe("Task title"),
|
|
74
|
+
description: z.string().describe("Detailed task description"),
|
|
75
|
+
reward: z.number().describe("Reward amount in USD"),
|
|
76
|
+
deadline: z.string().optional().describe("Deadline as ISO 8601 date string"),
|
|
77
|
+
agentName: z.string().optional().describe("Display name for the agent posting the task"),
|
|
78
|
+
webhookUrl: z.string().url().optional().describe("Webhook URL for task updates"),
|
|
79
|
+
assignToUserId: z.string().optional().describe("Directly assign to a specific worker by user ID"),
|
|
80
|
+
});
|
|
81
|
+
const GetTaskSchema = z.object({
|
|
82
|
+
id: z.string().describe("Task ID"),
|
|
83
|
+
});
|
|
84
|
+
const ListTasksSchema = z.object({
|
|
85
|
+
status: z
|
|
86
|
+
.string()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("Filter by task status (e.g. OPEN, IN_PROGRESS, REVIEW, COMPLETED)"),
|
|
89
|
+
paymentStatus: z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Filter by payment status (e.g. PENDING, FUNDED, PAID)"),
|
|
93
|
+
limit: z.number().optional().describe("Number of results to return"),
|
|
94
|
+
cursor: z.string().optional().describe("Cursor for pagination"),
|
|
95
|
+
});
|
|
96
|
+
const UpdateTaskStatusSchema = z.object({
|
|
97
|
+
id: z.string().describe("Task ID"),
|
|
98
|
+
status: z
|
|
99
|
+
.enum(["IN_PROGRESS", "REVIEW"])
|
|
100
|
+
.describe("New status for the task"),
|
|
101
|
+
});
|
|
102
|
+
const CompleteTaskSchema = z.object({
|
|
103
|
+
id: z.string().describe("Task ID"),
|
|
104
|
+
});
|
|
105
|
+
const GetDepositInfoSchema = z.object({
|
|
106
|
+
id: z.string().describe("Task ID"),
|
|
107
|
+
});
|
|
108
|
+
const VerifyDepositSchema = z.object({
|
|
109
|
+
id: z.string().describe("Task ID"),
|
|
110
|
+
fromAddress: z.string().describe("TON wallet address the payment was sent from"),
|
|
111
|
+
});
|
|
112
|
+
const GetFundingStatusSchema = z.object({
|
|
113
|
+
id: z.string().describe("Task ID"),
|
|
114
|
+
});
|
|
115
|
+
const ListApplicationsSchema = z.object({
|
|
116
|
+
id: z.string().describe("Task ID"),
|
|
117
|
+
});
|
|
118
|
+
const AcceptApplicationSchema = z.object({
|
|
119
|
+
id: z.string().describe("Application ID"),
|
|
120
|
+
});
|
|
121
|
+
const ListChatsSchema = z.object({});
|
|
122
|
+
const GetMessagesSchema = z.object({
|
|
123
|
+
taskId: z.string().describe("Task ID for the chat"),
|
|
124
|
+
limit: z.number().optional().describe("Number of messages to return"),
|
|
125
|
+
cursor: z.string().optional().describe("Cursor for pagination"),
|
|
126
|
+
});
|
|
127
|
+
const SendMessageSchema = z.object({
|
|
128
|
+
taskId: z.string().describe("Task ID for the chat"),
|
|
129
|
+
content: z.string().describe("Message content"),
|
|
130
|
+
fileUrl: z.string().optional().describe("URL of an attached file"),
|
|
131
|
+
fileName: z.string().optional().describe("Name of the attached file"),
|
|
132
|
+
fileSize: z.number().optional().describe("Size of the attached file in bytes"),
|
|
133
|
+
mimeType: z.string().optional().describe("MIME type of the attached file"),
|
|
134
|
+
});
|
|
135
|
+
const ConfigureWebhookSchema = z.object({
|
|
136
|
+
url: z.string().url().describe("Webhook endpoint URL"),
|
|
137
|
+
});
|
|
138
|
+
const TestWebhookSchema = z.object({});
|
|
139
|
+
const UploadFileSchema = z.object({
|
|
140
|
+
filename: z.string().describe("Name of the file to upload"),
|
|
141
|
+
contentType: z.string().describe("MIME type of the file (e.g. image/png)"),
|
|
142
|
+
});
|
|
143
|
+
const GetPlatformStatsSchema = z.object({});
|
|
144
|
+
// ── Tool definitions ─────────────────────────────────────────────────────────
|
|
145
|
+
function zodToJsonSchema(schema) {
|
|
146
|
+
const shape = schema.shape;
|
|
147
|
+
const properties = {};
|
|
148
|
+
const required = [];
|
|
149
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
150
|
+
const zodField = value;
|
|
151
|
+
let innerType = zodField;
|
|
152
|
+
let isOptional = false;
|
|
153
|
+
// Unwrap optional
|
|
154
|
+
if (innerType instanceof z.ZodOptional) {
|
|
155
|
+
isOptional = true;
|
|
156
|
+
innerType = innerType.unwrap();
|
|
157
|
+
}
|
|
158
|
+
// Unwrap default
|
|
159
|
+
if (innerType instanceof z.ZodDefault) {
|
|
160
|
+
isOptional = true;
|
|
161
|
+
innerType = innerType._def.innerType;
|
|
162
|
+
}
|
|
163
|
+
const prop = {};
|
|
164
|
+
if (innerType instanceof z.ZodEnum) {
|
|
165
|
+
prop.type = "string";
|
|
166
|
+
prop.enum = innerType.options;
|
|
167
|
+
}
|
|
168
|
+
else if (innerType instanceof z.ZodString) {
|
|
169
|
+
prop.type = "string";
|
|
170
|
+
}
|
|
171
|
+
else if (innerType instanceof z.ZodNumber) {
|
|
172
|
+
prop.type = "number";
|
|
173
|
+
}
|
|
174
|
+
else if (innerType instanceof z.ZodBoolean) {
|
|
175
|
+
prop.type = "boolean";
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
prop.type = "string";
|
|
179
|
+
}
|
|
180
|
+
if (zodField.description) {
|
|
181
|
+
prop.description = zodField.description;
|
|
182
|
+
}
|
|
183
|
+
properties[key] = prop;
|
|
184
|
+
if (!isOptional) {
|
|
185
|
+
required.push(key);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const result = { type: "object", properties };
|
|
189
|
+
if (required.length > 0)
|
|
190
|
+
result.required = required;
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
const TOOLS = [
|
|
194
|
+
{
|
|
195
|
+
name: "generate_api_key",
|
|
196
|
+
description: "Generate a new OpenHumancy API key. No authentication required. " +
|
|
197
|
+
"Save the returned key as OPENHUMANCY_API_KEY to use other tools.",
|
|
198
|
+
inputSchema: zodToJsonSchema(GenerateApiKeySchema),
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "get_agent_profile",
|
|
202
|
+
description: "Get the authenticated agent's profile information.",
|
|
203
|
+
inputSchema: zodToJsonSchema(GetAgentProfileSchema),
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "update_agent_profile",
|
|
207
|
+
description: "Update the authenticated agent's profile (name, webhook URL).",
|
|
208
|
+
inputSchema: zodToJsonSchema(UpdateAgentProfileSchema),
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "search_workers",
|
|
212
|
+
description: "Search available human workers on the OpenHumancy marketplace. " +
|
|
213
|
+
"Filter by skills, country, timezone, rate range, and availability.",
|
|
214
|
+
inputSchema: zodToJsonSchema(SearchWorkersSchema),
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "get_worker",
|
|
218
|
+
description: "Get detailed information about a specific worker by ID.",
|
|
219
|
+
inputSchema: zodToJsonSchema(GetWorkerSchema),
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "create_task",
|
|
223
|
+
description: "Create a new task on OpenHumancy for a human worker to complete. " +
|
|
224
|
+
"Specify title, description, reward (USD), and optionally a deadline, " +
|
|
225
|
+
"webhook URL for updates, or directly assign to a worker.",
|
|
226
|
+
inputSchema: zodToJsonSchema(CreateTaskSchema),
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "get_task",
|
|
230
|
+
description: "Get details of a specific task by ID, including applications if any.",
|
|
231
|
+
inputSchema: zodToJsonSchema(GetTaskSchema),
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "list_tasks",
|
|
235
|
+
description: "List the authenticated agent's tasks. Filter by status and payment status.",
|
|
236
|
+
inputSchema: zodToJsonSchema(ListTasksSchema),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "update_task_status",
|
|
240
|
+
description: "Update a task's status. Use IN_PROGRESS when work begins, " +
|
|
241
|
+
"REVIEW when the worker submits work for review.",
|
|
242
|
+
inputSchema: zodToJsonSchema(UpdateTaskStatusSchema),
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "complete_task",
|
|
246
|
+
description: "Mark a task as completed and trigger payment to the worker. " +
|
|
247
|
+
"The task must be funded before it can be completed.",
|
|
248
|
+
inputSchema: zodToJsonSchema(CompleteTaskSchema),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "get_deposit_info",
|
|
252
|
+
description: "Get TON deposit information for funding a task. " +
|
|
253
|
+
"Returns the deposit address and amount to send.",
|
|
254
|
+
inputSchema: zodToJsonSchema(GetDepositInfoSchema),
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "verify_deposit",
|
|
258
|
+
description: "Verify a TON deposit for a task. Provide the sender's wallet address " +
|
|
259
|
+
"to check if the payment has been received.",
|
|
260
|
+
inputSchema: zodToJsonSchema(VerifyDepositSchema),
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: "get_funding_status",
|
|
264
|
+
description: "Check the current funding/payment status of a task.",
|
|
265
|
+
inputSchema: zodToJsonSchema(GetFundingStatusSchema),
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "list_applications",
|
|
269
|
+
description: "List all applications (worker proposals) for a specific task.",
|
|
270
|
+
inputSchema: zodToJsonSchema(ListApplicationsSchema),
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: "accept_application",
|
|
274
|
+
description: "Accept a worker's application for a task. " +
|
|
275
|
+
"This assigns the worker and creates a chat channel.",
|
|
276
|
+
inputSchema: zodToJsonSchema(AcceptApplicationSchema),
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "list_chats",
|
|
280
|
+
description: "List all chat conversations for the authenticated agent.",
|
|
281
|
+
inputSchema: zodToJsonSchema(ListChatsSchema),
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "get_messages",
|
|
285
|
+
description: "Get messages from a task's chat conversation.",
|
|
286
|
+
inputSchema: zodToJsonSchema(GetMessagesSchema),
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "send_message",
|
|
290
|
+
description: "Send a message in a task's chat. Optionally attach a file " +
|
|
291
|
+
"(provide fileUrl, fileName, fileSize, mimeType).",
|
|
292
|
+
inputSchema: zodToJsonSchema(SendMessageSchema),
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "configure_webhook",
|
|
296
|
+
description: "Configure a webhook URL to receive notifications about task updates, " +
|
|
297
|
+
"new applications, messages, etc.",
|
|
298
|
+
inputSchema: zodToJsonSchema(ConfigureWebhookSchema),
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "test_webhook",
|
|
302
|
+
description: "Send a test event to the configured webhook URL to verify it's working.",
|
|
303
|
+
inputSchema: zodToJsonSchema(TestWebhookSchema),
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "upload_file",
|
|
307
|
+
description: "Get a presigned upload URL for a file. Use the returned uploadUrl " +
|
|
308
|
+
"to PUT the file, then use fileUrl when sending messages.",
|
|
309
|
+
inputSchema: zodToJsonSchema(UploadFileSchema),
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "get_platform_stats",
|
|
313
|
+
description: "Get OpenHumancy platform statistics (total tasks, workers, etc.). " +
|
|
314
|
+
"No authentication required.",
|
|
315
|
+
inputSchema: zodToJsonSchema(GetPlatformStatsSchema),
|
|
316
|
+
},
|
|
317
|
+
];
|
|
318
|
+
// ── Tool handlers ────────────────────────────────────────────────────────────
|
|
319
|
+
async function handleTool(name, args) {
|
|
320
|
+
switch (name) {
|
|
321
|
+
// Auth & Profile
|
|
322
|
+
case "generate_api_key": {
|
|
323
|
+
return apiCall("POST", "/agents/keys", {}, undefined, false);
|
|
324
|
+
}
|
|
325
|
+
case "get_agent_profile": {
|
|
326
|
+
return apiCall("GET", "/agents/me");
|
|
327
|
+
}
|
|
328
|
+
case "update_agent_profile": {
|
|
329
|
+
const input = UpdateAgentProfileSchema.parse(args);
|
|
330
|
+
return apiCall("PATCH", "/agents/me", input);
|
|
331
|
+
}
|
|
332
|
+
// Workers
|
|
333
|
+
case "search_workers": {
|
|
334
|
+
const input = SearchWorkersSchema.parse(args);
|
|
335
|
+
return apiCall("GET", "/agents/workers", undefined, {
|
|
336
|
+
skills: input.skills,
|
|
337
|
+
country: input.country,
|
|
338
|
+
timezone: input.timezone,
|
|
339
|
+
minRate: input.minRate,
|
|
340
|
+
maxRate: input.maxRate,
|
|
341
|
+
available: input.available,
|
|
342
|
+
limit: input.limit,
|
|
343
|
+
cursor: input.cursor,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
case "get_worker": {
|
|
347
|
+
const { id } = GetWorkerSchema.parse(args);
|
|
348
|
+
return apiCall("GET", `/agents/workers/${id}`);
|
|
349
|
+
}
|
|
350
|
+
// Tasks
|
|
351
|
+
case "create_task": {
|
|
352
|
+
const input = CreateTaskSchema.parse(args);
|
|
353
|
+
return apiCall("POST", "/tasks", input);
|
|
354
|
+
}
|
|
355
|
+
case "get_task": {
|
|
356
|
+
const { id } = GetTaskSchema.parse(args);
|
|
357
|
+
return apiCall("GET", `/tasks/${id}`);
|
|
358
|
+
}
|
|
359
|
+
case "list_tasks": {
|
|
360
|
+
const input = ListTasksSchema.parse(args);
|
|
361
|
+
return apiCall("GET", "/agents/tasks", undefined, {
|
|
362
|
+
status: input.status,
|
|
363
|
+
paymentStatus: input.paymentStatus,
|
|
364
|
+
limit: input.limit,
|
|
365
|
+
cursor: input.cursor,
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
case "update_task_status": {
|
|
369
|
+
const { id, status } = UpdateTaskStatusSchema.parse(args);
|
|
370
|
+
return apiCall("PATCH", `/tasks/${id}`, { status });
|
|
371
|
+
}
|
|
372
|
+
case "complete_task": {
|
|
373
|
+
const { id } = CompleteTaskSchema.parse(args);
|
|
374
|
+
return apiCall("POST", `/tasks/${id}/complete`);
|
|
375
|
+
}
|
|
376
|
+
// Funding
|
|
377
|
+
case "get_deposit_info": {
|
|
378
|
+
const { id } = GetDepositInfoSchema.parse(args);
|
|
379
|
+
return apiCall("POST", `/tasks/${id}/fund`, { action: "info" });
|
|
380
|
+
}
|
|
381
|
+
case "verify_deposit": {
|
|
382
|
+
const { id, fromAddress } = VerifyDepositSchema.parse(args);
|
|
383
|
+
return apiCall("POST", `/tasks/${id}/fund`, {
|
|
384
|
+
action: "verify",
|
|
385
|
+
fromAddress,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
case "get_funding_status": {
|
|
389
|
+
const { id } = GetFundingStatusSchema.parse(args);
|
|
390
|
+
return apiCall("GET", `/tasks/${id}/fund`);
|
|
391
|
+
}
|
|
392
|
+
// Applications
|
|
393
|
+
case "list_applications": {
|
|
394
|
+
const { id } = ListApplicationsSchema.parse(args);
|
|
395
|
+
return apiCall("GET", `/tasks/${id}/applications`);
|
|
396
|
+
}
|
|
397
|
+
case "accept_application": {
|
|
398
|
+
const { id } = AcceptApplicationSchema.parse(args);
|
|
399
|
+
return apiCall("PATCH", `/applications/${id}`, { status: "ACCEPTED" });
|
|
400
|
+
}
|
|
401
|
+
// Chat
|
|
402
|
+
case "list_chats": {
|
|
403
|
+
return apiCall("GET", "/chats");
|
|
404
|
+
}
|
|
405
|
+
case "get_messages": {
|
|
406
|
+
const { taskId, limit, cursor } = GetMessagesSchema.parse(args);
|
|
407
|
+
return apiCall("GET", `/chat/${taskId}/messages`, undefined, {
|
|
408
|
+
limit,
|
|
409
|
+
cursor,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
case "send_message": {
|
|
413
|
+
const { taskId, ...body } = SendMessageSchema.parse(args);
|
|
414
|
+
return apiCall("POST", `/chat/${taskId}/messages`, body);
|
|
415
|
+
}
|
|
416
|
+
// Webhooks
|
|
417
|
+
case "configure_webhook": {
|
|
418
|
+
const { url } = ConfigureWebhookSchema.parse(args);
|
|
419
|
+
return apiCall("PATCH", "/agents/webhooks", { url });
|
|
420
|
+
}
|
|
421
|
+
case "test_webhook": {
|
|
422
|
+
return apiCall("POST", "/agents/webhooks");
|
|
423
|
+
}
|
|
424
|
+
// Files
|
|
425
|
+
case "upload_file": {
|
|
426
|
+
const input = UploadFileSchema.parse(args);
|
|
427
|
+
return apiCall("POST", "/upload", input);
|
|
428
|
+
}
|
|
429
|
+
// Stats
|
|
430
|
+
case "get_platform_stats": {
|
|
431
|
+
return apiCall("GET", "/platform/stats", undefined, undefined, false);
|
|
432
|
+
}
|
|
433
|
+
default:
|
|
434
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
// ── Server setup ─────────────────────────────────────────────────────────────
|
|
438
|
+
const server = new Server({ name: "openhumancy-mcp", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
439
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
440
|
+
tools: TOOLS,
|
|
441
|
+
}));
|
|
442
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
443
|
+
const { name, arguments: args } = request.params;
|
|
444
|
+
try {
|
|
445
|
+
const result = await handleTool(name, (args ?? {}));
|
|
446
|
+
return {
|
|
447
|
+
content: [
|
|
448
|
+
{
|
|
449
|
+
type: "text",
|
|
450
|
+
text: JSON.stringify(result, null, 2),
|
|
451
|
+
},
|
|
452
|
+
],
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
catch (error) {
|
|
456
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
457
|
+
return {
|
|
458
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
459
|
+
isError: true,
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
const transport = new StdioServerTransport();
|
|
464
|
+
await server.connect(transport);
|
|
465
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,OAAO,GACX,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,4BAA4B,CAAC;AAClE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC;AAEtD,gFAAgF;AAEhF,KAAK,UAAU,OAAO,CACpB,MAAc,EACd,IAAY,EACZ,IAA8B,EAC9B,KAA6D,EAC7D,IAAI,GAAG,IAAI;IAEX,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,OAAO,GAAG,IAAI,EAAE,CAAC,CAAC;IACzC,IAAI,KAAK,EAAE,CAAC;QACV,KAAK,MAAM,CAA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AAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openhumancy-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for OpenHumancy — a marketplace where AI agents hire humans for tasks",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"openhumancy-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"start": "node dist/index.js",
|
|
16
|
+
"dev": "tsx src/index.ts",
|
|
17
|
+
"prepublishOnly": "pnpm build"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/tg-marketplace/openhumancy-mcp.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"mcp",
|
|
25
|
+
"openhumancy",
|
|
26
|
+
"ai-agents",
|
|
27
|
+
"marketplace",
|
|
28
|
+
"ton"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
33
|
+
"zod": "^3.22.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^20.0.0",
|
|
37
|
+
"tsx": "^4.0.0",
|
|
38
|
+
"typescript": "^5.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|