@prismnetwork/mcp 0.1.2 → 0.2.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/package.json +26 -8
- package/server.mjs +26 -4
package/package.json
CHANGED
|
@@ -1,25 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismnetwork/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for leasing and running on Prism Network GPUs.",
|
|
5
5
|
"mcpName": "io.github.prismnetwork-tech/mcp",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
"bin": {
|
|
8
|
+
"prism-mcp": "server.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"server.mjs",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
10
17
|
"dependencies": {
|
|
11
18
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
12
|
-
"@prismnetwork/agent-sdk": "^0.
|
|
19
|
+
"@prismnetwork/agent-sdk": "^0.2.0",
|
|
13
20
|
"viem": "^2"
|
|
14
21
|
},
|
|
15
|
-
"keywords": [
|
|
22
|
+
"keywords": [
|
|
23
|
+
"prism",
|
|
24
|
+
"mcp",
|
|
25
|
+
"gpu",
|
|
26
|
+
"agent",
|
|
27
|
+
"claude",
|
|
28
|
+
"compute"
|
|
29
|
+
],
|
|
16
30
|
"homepage": "https://prismnetwork.tech",
|
|
17
31
|
"repository": {
|
|
18
32
|
"type": "git",
|
|
19
33
|
"url": "git+https://github.com/prismnetwork-tech/prism.git",
|
|
20
34
|
"directory": "mcp"
|
|
21
35
|
},
|
|
22
|
-
"bugs": {
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/prismnetwork-tech/prism/issues"
|
|
38
|
+
},
|
|
23
39
|
"license": "Apache-2.0",
|
|
24
|
-
"publishConfig": {
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
}
|
|
25
43
|
}
|
package/server.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
6
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
-
import { DEFAULT_IMAGE, PrismAgent } from "@prismnetwork/agent-sdk";
|
|
7
|
+
import { DEFAULT_IMAGE, PrismAgent, TRUST_CLASSES } from "@prismnetwork/agent-sdk";
|
|
8
8
|
|
|
9
9
|
const IMAGE = process.env.PRISM_DEFAULT_IMAGE ?? DEFAULT_IMAGE;
|
|
10
10
|
|
|
@@ -55,8 +55,17 @@ const TOOLS = [
|
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
name: "prism_list_gpus",
|
|
58
|
-
description: "List GPUs currently available to lease on Prism Network, with model, VRAM,
|
|
59
|
-
inputSchema: {
|
|
58
|
+
description: "List GPUs currently available to lease on Prism Network, with model, VRAM, price per second in USDG, and trust class. Trust class runs open < isolated < attested < confidential; on an 'open' supplier the host operator can read anything the workload touches, so never send secrets, credentials or private model weights to one.",
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: "object",
|
|
61
|
+
properties: {
|
|
62
|
+
min_trust: {
|
|
63
|
+
type: "string",
|
|
64
|
+
enum: TRUST_CLASSES,
|
|
65
|
+
description: "Only list suppliers at or above this trust class (default 'open').",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
60
69
|
},
|
|
61
70
|
{
|
|
62
71
|
name: "prism_lease_and_run",
|
|
@@ -67,6 +76,11 @@ const TOOLS = [
|
|
|
67
76
|
command: { type: "string", description: "Shell command to run on the GPU (e.g. 'nvidia-smi')." },
|
|
68
77
|
duration_seconds: { type: "integer", description: "Lease length in seconds (default 900, max 21600)." },
|
|
69
78
|
min_vram_mib: { type: "integer", description: "Minimum GPU memory in MiB (default 16000)." },
|
|
79
|
+
min_trust_class: {
|
|
80
|
+
type: "string",
|
|
81
|
+
enum: TRUST_CLASSES,
|
|
82
|
+
description: "Refuse suppliers below this trust class (default 'open'). Raise it for anything the host operator must not read.",
|
|
83
|
+
},
|
|
70
84
|
},
|
|
71
85
|
required: ["command"],
|
|
72
86
|
},
|
|
@@ -79,6 +93,11 @@ const TOOLS = [
|
|
|
79
93
|
properties: {
|
|
80
94
|
duration_seconds: { type: "integer", description: "Lease length in seconds (default 900, max 21600)." },
|
|
81
95
|
min_vram_mib: { type: "integer", description: "Minimum GPU memory in MiB (default 16000)." },
|
|
96
|
+
min_trust_class: {
|
|
97
|
+
type: "string",
|
|
98
|
+
enum: TRUST_CLASSES,
|
|
99
|
+
description: "Refuse suppliers below this trust class (default 'open'). Raise it for anything the host operator must not read.",
|
|
100
|
+
},
|
|
82
101
|
},
|
|
83
102
|
},
|
|
84
103
|
},
|
|
@@ -113,7 +132,7 @@ async function handle(name, args) {
|
|
|
113
132
|
}
|
|
114
133
|
if (name === "prism_list_gpus") {
|
|
115
134
|
await ensureAuth();
|
|
116
|
-
const offers = await agent.offers();
|
|
135
|
+
const offers = await agent.offers({ minTrust: args.min_trust ?? "open" });
|
|
117
136
|
return {
|
|
118
137
|
available: offers.length,
|
|
119
138
|
gpus: offers.map((o) => ({
|
|
@@ -121,6 +140,7 @@ async function handle(name, args) {
|
|
|
121
140
|
vram_mib: o.gpu.vram_mib,
|
|
122
141
|
price_per_second: usdg(o.rate_per_second),
|
|
123
142
|
price_per_hour: usdg(o.rate_per_second * 3600),
|
|
143
|
+
trust: o.trust_class,
|
|
124
144
|
})),
|
|
125
145
|
};
|
|
126
146
|
}
|
|
@@ -132,11 +152,13 @@ async function handle(name, args) {
|
|
|
132
152
|
image: IMAGE,
|
|
133
153
|
durationSeconds: args.duration_seconds ?? 900,
|
|
134
154
|
minVramMib: args.min_vram_mib ?? 16000,
|
|
155
|
+
minTrustClass: args.min_trust_class ?? "open",
|
|
135
156
|
});
|
|
136
157
|
leases.set(lease.leaseId, lease);
|
|
137
158
|
const summary = {
|
|
138
159
|
lease_id: lease.leaseId,
|
|
139
160
|
ssh: { host: lease.access.ssh_host, port: lease.access.ssh_port, user: lease.access.ssh_user },
|
|
161
|
+
trust: lease.quote?.trust_class ?? "open",
|
|
140
162
|
expires_at: lease.access.expires_at,
|
|
141
163
|
};
|
|
142
164
|
if (name === "prism_lease") return summary;
|