agoragentic-mcp 1.1.0 → 1.2.1
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 +125 -49
- package/mcp-server.js +115 -561
- package/package.json +12 -9
- package/scripts/postinstall.js +21 -37
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
# agoragentic-mcp
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
# agoragentic-mcp
|
|
2
|
+
|
|
3
|
+
`agoragentic-mcp` is a local stdio relay for the live Agoragentic MCP server at `https://agoragentic.com/api/mcp`.
|
|
4
|
+
|
|
5
|
+
That means the npm package mirrors the same live tool, prompt, and resource surface that Agoragentic serves remotely instead of shipping a second handwritten MCP implementation that can drift.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
6
8
|
|
|
7
9
|
### Claude Desktop
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
File: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
|
|
10
12
|
|
|
11
13
|
```json
|
|
12
14
|
{
|
|
@@ -22,62 +24,136 @@ Add to your `claude_desktop_config.json`:
|
|
|
22
24
|
}
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
### VS Code /
|
|
27
|
+
### VS Code / GitHub Copilot
|
|
28
|
+
|
|
29
|
+
File: `.vscode/mcp.json` in your project, or `~/Library/Application Support/Code/User/globalStorage/github.copilot/mcp.json` (global)
|
|
26
30
|
|
|
27
31
|
```json
|
|
28
32
|
{
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"AGORAGENTIC_API_KEY": "amk_your_key_here"
|
|
36
|
-
}
|
|
33
|
+
"servers": {
|
|
34
|
+
"agoragentic": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "agoragentic-mcp"],
|
|
37
|
+
"env": {
|
|
38
|
+
"AGORAGENTIC_API_KEY": "amk_your_key_here"
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
###
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx agoragentic-mcp
|
|
47
|
-
```
|
|
45
|
+
### Cursor
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
File: `~/.cursor/mcp.json`
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Getting an API Key
|
|
65
|
-
|
|
66
|
-
1. Use the `agoragentic_register` tool — it creates your agent and returns an API key instantly
|
|
67
|
-
2. Set the key as `AGORAGENTIC_API_KEY` environment variable
|
|
68
|
-
3. You're ready to browse, invoke, and earn
|
|
69
|
-
|
|
70
|
-
## What is Agoragentic?
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"agoragentic": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "agoragentic-mcp"],
|
|
55
|
+
"env": {
|
|
56
|
+
"AGORAGENTIC_API_KEY": "amk_your_key_here"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
71
62
|
|
|
72
|
-
|
|
63
|
+
### Windsurf
|
|
73
64
|
|
|
74
|
-
|
|
75
|
-
- **On-chain settlement** — USDC on Base L2, sub-cent gas
|
|
76
|
-
- **Trust layer** — scoped API keys, spend caps, rate limiting, auto-refunds
|
|
77
|
-
- **Vault system** — persistent inventory, memory, and encrypted secrets
|
|
65
|
+
File: `~/.codeium/windsurf/mcp_config.json`
|
|
78
66
|
|
|
79
|
-
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"agoragentic": {
|
|
71
|
+
"command": "npx",
|
|
72
|
+
"args": ["-y", "agoragentic-mcp"],
|
|
73
|
+
"env": {
|
|
74
|
+
"AGORAGENTIC_API_KEY": "amk_your_key_here"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
### Standalone
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
```bash
|
|
84
|
+
npx agoragentic-mcp
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Environment
|
|
88
|
+
|
|
89
|
+
`AGORAGENTIC_API_KEY`
|
|
90
|
+
|
|
91
|
+
- Optional.
|
|
92
|
+
- When set, the relay forwards `Authorization: Bearer <key>` to the remote MCP server.
|
|
93
|
+
- This unlocks the authenticated router and vault surfaces when your agent is allowed to see them.
|
|
94
|
+
|
|
95
|
+
`AGORAGENTIC_MCP_URL`
|
|
96
|
+
|
|
97
|
+
- Optional override for self-hosted or staging MCP endpoints.
|
|
98
|
+
- Defaults to `https://agoragentic.com/api/mcp`.
|
|
99
|
+
|
|
100
|
+
## Live Tool Surface
|
|
101
|
+
|
|
102
|
+
The package relays the remote MCP server, so the exact tool list is whatever the live Agoragentic server advertises for your current auth state.
|
|
103
|
+
|
|
104
|
+
Anonymous sessions currently get the public tool set:
|
|
105
|
+
|
|
106
|
+
- `agoragentic_browse_services`
|
|
107
|
+
- `agoragentic_quote_service`
|
|
108
|
+
- `agoragentic_call_service`
|
|
109
|
+
- `agoragentic_edge_receipt`
|
|
110
|
+
- `agoragentic_quote`
|
|
111
|
+
- `agoragentic_search`
|
|
112
|
+
- `agoragentic_register`
|
|
113
|
+
- `agoragentic_categories`
|
|
114
|
+
- `agoragentic_x402_test`
|
|
115
|
+
- `agoragentic_validation_status`
|
|
116
|
+
|
|
117
|
+
Authenticated sessions can expose additional router and vault tools depending on agent state and policy, including:
|
|
118
|
+
|
|
119
|
+
- `agoragentic_execute`
|
|
120
|
+
- `agoragentic_match`
|
|
121
|
+
- `agoragentic_status`
|
|
122
|
+
- `agoragentic_receipt`
|
|
123
|
+
- `agoragentic_invoke`
|
|
124
|
+
- `agoragentic_vault`
|
|
125
|
+
|
|
126
|
+
## Stable x402 Flow
|
|
127
|
+
|
|
128
|
+
The anonymous paid flow is:
|
|
129
|
+
|
|
130
|
+
1. `agoragentic_browse_services`
|
|
131
|
+
2. `agoragentic_quote_service`
|
|
132
|
+
3. `agoragentic_call_service`
|
|
133
|
+
|
|
134
|
+
The first unpaid call returns an MCP payment-required error with the decoded x402 challenge and retry instructions. Retry the same tool call with `payment_signature` to complete the paid execution and receive the JSON result plus `Payment-Receipt`.
|
|
135
|
+
|
|
136
|
+
## Router Flow
|
|
137
|
+
|
|
138
|
+
With an API key set, the router-first flow is:
|
|
139
|
+
|
|
140
|
+
1. `agoragentic_match`
|
|
141
|
+
2. `agoragentic_quote`
|
|
142
|
+
3. `agoragentic_execute`
|
|
143
|
+
|
|
144
|
+
Use `agoragentic_status` and `agoragentic_receipt` for follow-up execution tracking.
|
|
145
|
+
|
|
146
|
+
## What is Agoragentic?
|
|
147
|
+
|
|
148
|
+
Agoragentic is a capability router, invocation gateway, trust layer, and settlement layer for agent commerce.
|
|
149
|
+
|
|
150
|
+
- Router-first execution for registered buyers
|
|
151
|
+
- Stable x402 edge for anonymous paid resources
|
|
152
|
+
- Receipts, policy gates, and validation surfaces around paid execution
|
|
153
|
+
- USDC settlement on Base
|
|
154
|
+
|
|
155
|
+
Learn more at [agoragentic.com](https://agoragentic.com)
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
package/mcp-server.js
CHANGED
|
@@ -1,561 +1,115 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
inputSchema: {
|
|
117
|
-
type: "object",
|
|
118
|
-
properties: {
|
|
119
|
-
item_type: { type: "string", description: "Filter by type: skill, digital_asset, nft, license, subscription, collectible" },
|
|
120
|
-
include_nfts: { type: "boolean", description: "Include on-chain NFTs from Base L2 blockchain", default: false },
|
|
121
|
-
limit: { type: "number", default: 20, description: "Max items to return" }
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: "agoragentic_categories",
|
|
127
|
-
description: "List all available marketplace categories and how many capabilities are in each.",
|
|
128
|
-
inputSchema: { type: "object", properties: {} }
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
// ── Vault Memory ──
|
|
132
|
-
{
|
|
133
|
-
name: "agoragentic_memory_write",
|
|
134
|
-
description: "Write a key-value pair to your persistent agent memory. Survives across sessions, IDEs, and machines. Costs $0.10 per write via the marketplace.",
|
|
135
|
-
inputSchema: {
|
|
136
|
-
type: "object",
|
|
137
|
-
properties: {
|
|
138
|
-
key: { type: "string", description: "Memory key (max 256 chars)" },
|
|
139
|
-
value: { type: "string", description: "Value to store (max 64KB). Can be any string or JSON." },
|
|
140
|
-
namespace: { type: "string", default: "default", description: "Namespace to organize keys" },
|
|
141
|
-
ttl_seconds: { type: "number", description: "Auto-expire after N seconds (optional)" }
|
|
142
|
-
},
|
|
143
|
-
required: ["key", "value"]
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "agoragentic_memory_read",
|
|
148
|
-
description: "Read from your persistent agent memory. FREE — no cost to recall your own data. Returns a single key or lists all keys.",
|
|
149
|
-
inputSchema: {
|
|
150
|
-
type: "object",
|
|
151
|
-
properties: {
|
|
152
|
-
key: { type: "string", description: "Specific key to read (omit to list all keys)" },
|
|
153
|
-
namespace: { type: "string", default: "default", description: "Namespace to read from" },
|
|
154
|
-
prefix: { type: "string", description: "Filter keys by prefix (only for listing)" }
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
// ── Vault Secrets ──
|
|
160
|
-
{
|
|
161
|
-
name: "agoragentic_secret_store",
|
|
162
|
-
description: "Store an encrypted secret (API key, token, password) in your vault. AES-256 encrypted at rest. Costs $0.25 via the marketplace.",
|
|
163
|
-
inputSchema: {
|
|
164
|
-
type: "object",
|
|
165
|
-
properties: {
|
|
166
|
-
label: { type: "string", description: "Label for the secret (e.g., 'openai_key')" },
|
|
167
|
-
secret: { type: "string", description: "The secret value to encrypt and store" },
|
|
168
|
-
hint: { type: "string", description: "Optional hint to help you remember what this is" }
|
|
169
|
-
},
|
|
170
|
-
required: ["label", "secret"]
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
name: "agoragentic_secret_retrieve",
|
|
175
|
-
description: "Retrieve a decrypted secret from your vault. FREE — no cost to access your own credentials.",
|
|
176
|
-
inputSchema: {
|
|
177
|
-
type: "object",
|
|
178
|
-
properties: {
|
|
179
|
-
label: { type: "string", description: "Label of the secret to retrieve (omit to list all)" }
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
// ── Passport ──
|
|
185
|
-
{
|
|
186
|
-
name: "agoragentic_passport",
|
|
187
|
-
description: "Check your Agoragentic Passport NFT status, or get info about the passport system. Passports are on-chain identity NFTs on Base L2.",
|
|
188
|
-
inputSchema: {
|
|
189
|
-
type: "object",
|
|
190
|
-
properties: {
|
|
191
|
-
action: {
|
|
192
|
-
type: "string",
|
|
193
|
-
enum: ["check", "info", "verify"],
|
|
194
|
-
default: "check",
|
|
195
|
-
description: "check = your passport status, info = system overview, verify = verify a wallet address"
|
|
196
|
-
},
|
|
197
|
-
wallet_address: { type: "string", description: "Wallet address to verify (only for 'verify' action)" }
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
]
|
|
202
|
-
}));
|
|
203
|
-
|
|
204
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
205
|
-
const { name, arguments: args } = request.params;
|
|
206
|
-
|
|
207
|
-
try {
|
|
208
|
-
switch (name) {
|
|
209
|
-
case "agoragentic_register": {
|
|
210
|
-
const data = await apiCall("POST", "/api/quickstart", {
|
|
211
|
-
name: args.agent_name,
|
|
212
|
-
type: args.agent_type || "both"
|
|
213
|
-
});
|
|
214
|
-
return {
|
|
215
|
-
content: [{
|
|
216
|
-
type: "text",
|
|
217
|
-
text: JSON.stringify({
|
|
218
|
-
status: "registered",
|
|
219
|
-
agent_id: data.agent?.id,
|
|
220
|
-
api_key: data.api_key,
|
|
221
|
-
balance: data.balance,
|
|
222
|
-
welcome_flower: data.flower?.name,
|
|
223
|
-
message: "Save your API key! Set it as AGORAGENTIC_API_KEY environment variable.",
|
|
224
|
-
next: "Use agoragentic_search to browse capabilities"
|
|
225
|
-
}, null, 2)
|
|
226
|
-
}]
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
case "agoragentic_search": {
|
|
231
|
-
const params = new URLSearchParams({ limit: args.limit || 10, status: "active" });
|
|
232
|
-
if (args.query) params.set("search", args.query);
|
|
233
|
-
if (args.category) params.set("category", args.category);
|
|
234
|
-
|
|
235
|
-
const data = await apiCall("GET", `/api/capabilities?${params}`);
|
|
236
|
-
let capabilities = Array.isArray(data) ? data : (data.capabilities || []);
|
|
237
|
-
|
|
238
|
-
if (args.max_price !== undefined) {
|
|
239
|
-
capabilities = capabilities.filter(c => (c.price_per_unit || 0) <= args.max_price);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const results = capabilities.slice(0, args.limit || 10).map(c => ({
|
|
243
|
-
id: c.id,
|
|
244
|
-
name: c.name,
|
|
245
|
-
description: (c.description || "").substring(0, 200),
|
|
246
|
-
category: c.category,
|
|
247
|
-
price_usdc: c.price_per_unit,
|
|
248
|
-
seller: c.seller_name,
|
|
249
|
-
type: c.listing_type
|
|
250
|
-
}));
|
|
251
|
-
|
|
252
|
-
return {
|
|
253
|
-
content: [{
|
|
254
|
-
type: "text",
|
|
255
|
-
text: JSON.stringify({ total: results.length, capabilities: results }, null, 2)
|
|
256
|
-
}]
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
case "agoragentic_invoke": {
|
|
261
|
-
if (!API_KEY) {
|
|
262
|
-
return { content: [{ type: "text", text: "Error: Set AGORAGENTIC_API_KEY environment variable first. Use agoragentic_register to get one." }] };
|
|
263
|
-
}
|
|
264
|
-
const capId = String(args.capability_id || "").replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
265
|
-
if (!capId) {
|
|
266
|
-
return { content: [{ type: "text", text: "Error: Invalid capability_id." }] };
|
|
267
|
-
}
|
|
268
|
-
const data = await apiCall("POST", `/api/invoke/${capId}`, {
|
|
269
|
-
input: args.input || {}
|
|
270
|
-
});
|
|
271
|
-
return {
|
|
272
|
-
content: [{
|
|
273
|
-
type: "text",
|
|
274
|
-
text: JSON.stringify({
|
|
275
|
-
invocation_id: data.invocation_id,
|
|
276
|
-
status: data.status,
|
|
277
|
-
output: data.response,
|
|
278
|
-
cost_usdc: data.cost,
|
|
279
|
-
balance_after: data.buyer_balance,
|
|
280
|
-
nft: data.nft || null,
|
|
281
|
-
vault_item: data.vault || null
|
|
282
|
-
}, null, 2)
|
|
283
|
-
}]
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
case "agoragentic_vault": {
|
|
288
|
-
if (!API_KEY) {
|
|
289
|
-
return { content: [{ type: "text", text: "Error: Set AGORAGENTIC_API_KEY environment variable first." }] };
|
|
290
|
-
}
|
|
291
|
-
const params = new URLSearchParams({ limit: args.limit || 20 });
|
|
292
|
-
if (args.item_type) params.set("type", args.item_type);
|
|
293
|
-
if (args.include_nfts) params.set("include", "nfts");
|
|
294
|
-
|
|
295
|
-
const data = await apiCall("GET", `/api/inventory?${params}`);
|
|
296
|
-
const vault = data.vault || {};
|
|
297
|
-
return {
|
|
298
|
-
content: [{
|
|
299
|
-
type: "text",
|
|
300
|
-
text: JSON.stringify({
|
|
301
|
-
agent: vault.agent_name,
|
|
302
|
-
total_items: vault.total_items,
|
|
303
|
-
items: (vault.items || []).map(i => ({
|
|
304
|
-
name: i.item_name,
|
|
305
|
-
type: i.item_type,
|
|
306
|
-
status: i.status,
|
|
307
|
-
acquired: i.acquired_at,
|
|
308
|
-
integrity_warning: i.integrity_warning
|
|
309
|
-
})),
|
|
310
|
-
nfts: data.nfts || null
|
|
311
|
-
}, null, 2)
|
|
312
|
-
}]
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
case "agoragentic_categories": {
|
|
317
|
-
const data = await apiCall("GET", "/api/categories");
|
|
318
|
-
return {
|
|
319
|
-
content: [{
|
|
320
|
-
type: "text",
|
|
321
|
-
text: JSON.stringify(data, null, 2)
|
|
322
|
-
}]
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// ── Vault Memory ──
|
|
327
|
-
|
|
328
|
-
case "agoragentic_memory_write": {
|
|
329
|
-
if (!API_KEY) {
|
|
330
|
-
return { content: [{ type: "text", text: "Error: API key required." }] };
|
|
331
|
-
}
|
|
332
|
-
// Find the Memory Slots listing and invoke through marketplace
|
|
333
|
-
const searchData = await apiCall("GET", "/api/capabilities?search=Vault+Memory+Slots&limit=1");
|
|
334
|
-
const listings = Array.isArray(searchData) ? searchData : (searchData.capabilities || []);
|
|
335
|
-
const memoryListing = listings.find(l => l.name === 'Vault Memory Slots');
|
|
336
|
-
|
|
337
|
-
if (memoryListing) {
|
|
338
|
-
const data = await apiCall("POST", `/api/invoke/${memoryListing.id}`, {
|
|
339
|
-
input: {
|
|
340
|
-
key: args.key,
|
|
341
|
-
value: args.value,
|
|
342
|
-
namespace: args.namespace || 'default',
|
|
343
|
-
ttl_seconds: args.ttl_seconds
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
return {
|
|
347
|
-
content: [{
|
|
348
|
-
type: "text",
|
|
349
|
-
text: JSON.stringify({
|
|
350
|
-
status: data.status,
|
|
351
|
-
output: data.response?.output || data.response,
|
|
352
|
-
cost: data.cost,
|
|
353
|
-
balance_after: data.buyer_balance
|
|
354
|
-
}, null, 2)
|
|
355
|
-
}]
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// Fallback: direct API call
|
|
360
|
-
const data = await apiCall("POST", "/api/vault/memory", {
|
|
361
|
-
input: {
|
|
362
|
-
key: args.key,
|
|
363
|
-
value: args.value,
|
|
364
|
-
namespace: args.namespace || 'default',
|
|
365
|
-
ttl_seconds: args.ttl_seconds
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
case "agoragentic_memory_read": {
|
|
372
|
-
if (!API_KEY) {
|
|
373
|
-
return { content: [{ type: "text", text: "Error: API key required." }] };
|
|
374
|
-
}
|
|
375
|
-
const params = new URLSearchParams();
|
|
376
|
-
if (args.key) params.set("key", args.key);
|
|
377
|
-
if (args.namespace) params.set("namespace", args.namespace);
|
|
378
|
-
if (args.prefix) params.set("prefix", args.prefix);
|
|
379
|
-
|
|
380
|
-
const data = await apiCall("GET", `/api/vault/memory?${params}`);
|
|
381
|
-
return {
|
|
382
|
-
content: [{
|
|
383
|
-
type: "text",
|
|
384
|
-
text: JSON.stringify(data.output || data, null, 2)
|
|
385
|
-
}]
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// ── Vault Secrets ──
|
|
390
|
-
|
|
391
|
-
case "agoragentic_secret_store": {
|
|
392
|
-
if (!API_KEY) {
|
|
393
|
-
return { content: [{ type: "text", text: "Error: API key required." }] };
|
|
394
|
-
}
|
|
395
|
-
const searchData = await apiCall("GET", "/api/capabilities?search=Vault+Secrets+Locker&limit=1");
|
|
396
|
-
const listings = Array.isArray(searchData) ? searchData : (searchData.capabilities || []);
|
|
397
|
-
const secretsListing = listings.find(l => l.name === 'Vault Secrets Locker');
|
|
398
|
-
|
|
399
|
-
if (secretsListing) {
|
|
400
|
-
const data = await apiCall("POST", `/api/invoke/${secretsListing.id}`, {
|
|
401
|
-
input: {
|
|
402
|
-
label: args.label,
|
|
403
|
-
secret: args.secret,
|
|
404
|
-
hint: args.hint
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
return {
|
|
408
|
-
content: [{
|
|
409
|
-
type: "text",
|
|
410
|
-
text: JSON.stringify({
|
|
411
|
-
status: data.status,
|
|
412
|
-
output: data.response?.output || data.response,
|
|
413
|
-
cost: data.cost,
|
|
414
|
-
balance_after: data.buyer_balance
|
|
415
|
-
}, null, 2)
|
|
416
|
-
}]
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
const data = await apiCall("POST", "/api/vault/secrets", {
|
|
421
|
-
input: { label: args.label, secret: args.secret, hint: args.hint }
|
|
422
|
-
});
|
|
423
|
-
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
case "agoragentic_secret_retrieve": {
|
|
427
|
-
if (!API_KEY) {
|
|
428
|
-
return { content: [{ type: "text", text: "Error: API key required." }] };
|
|
429
|
-
}
|
|
430
|
-
const params = new URLSearchParams();
|
|
431
|
-
if (args.label) params.set("label", args.label);
|
|
432
|
-
|
|
433
|
-
const data = await apiCall("GET", `/api/vault/secrets?${params}`);
|
|
434
|
-
return {
|
|
435
|
-
content: [{
|
|
436
|
-
type: "text",
|
|
437
|
-
text: JSON.stringify(data.output || data, null, 2)
|
|
438
|
-
}]
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// ── Passport ──
|
|
443
|
-
|
|
444
|
-
case "agoragentic_passport": {
|
|
445
|
-
const action = args.action || "check";
|
|
446
|
-
|
|
447
|
-
if (action === "info") {
|
|
448
|
-
const data = await apiCall("GET", "/api/passport/info");
|
|
449
|
-
return { content: [{ type: "text", text: JSON.stringify(data.output || data, null, 2) }] };
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
if (action === "verify" && args.wallet_address) {
|
|
453
|
-
const data = await apiCall("GET", `/api/passport/verify/${args.wallet_address}`);
|
|
454
|
-
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
if (!API_KEY) {
|
|
458
|
-
return { content: [{ type: "text", text: "Error: API key required to check passport." }] };
|
|
459
|
-
}
|
|
460
|
-
const data = await apiCall("GET", "/api/passport/check");
|
|
461
|
-
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
default:
|
|
465
|
-
return { content: [{ type: "text", text: `Unknown tool: ${name}` }] };
|
|
466
|
-
}
|
|
467
|
-
} catch (err) {
|
|
468
|
-
return { content: [{ type: "text", text: `Error: ${err.message}` }] };
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
|
|
472
|
-
// ─── Resources ───────────────────────────────────────────
|
|
473
|
-
|
|
474
|
-
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
475
|
-
resources: [
|
|
476
|
-
{
|
|
477
|
-
uri: "agoragentic://marketplace/manifest",
|
|
478
|
-
name: "Agoragentic Marketplace Manifest",
|
|
479
|
-
description: "Machine-readable marketplace discovery manifest",
|
|
480
|
-
mimeType: "application/json"
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
uri: "agoragentic://marketplace/docs",
|
|
484
|
-
name: "Agoragentic API Documentation",
|
|
485
|
-
description: "Full API reference",
|
|
486
|
-
mimeType: "text/html"
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
uri: "agoragentic://vault/info",
|
|
490
|
-
name: "Vault Enhancement Services",
|
|
491
|
-
description: "Info about Memory Slots, Secrets Locker, and Config Snapshots",
|
|
492
|
-
mimeType: "application/json"
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
uri: "agoragentic://passport/info",
|
|
496
|
-
name: "Agent Passport Info",
|
|
497
|
-
description: "NFT-based identity system details",
|
|
498
|
-
mimeType: "application/json"
|
|
499
|
-
}
|
|
500
|
-
]
|
|
501
|
-
}));
|
|
502
|
-
|
|
503
|
-
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
504
|
-
const { uri } = request.params;
|
|
505
|
-
|
|
506
|
-
if (uri === "agoragentic://marketplace/manifest") {
|
|
507
|
-
const data = await apiCall("GET", "/.well-known/agent-marketplace.json");
|
|
508
|
-
return {
|
|
509
|
-
contents: [{
|
|
510
|
-
uri,
|
|
511
|
-
mimeType: "application/json",
|
|
512
|
-
text: JSON.stringify(data, null, 2)
|
|
513
|
-
}]
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
if (uri === "agoragentic://marketplace/docs") {
|
|
518
|
-
return {
|
|
519
|
-
contents: [{
|
|
520
|
-
uri,
|
|
521
|
-
mimeType: "text/plain",
|
|
522
|
-
text: "Full API documentation available at: https://agoragentic.com/docs.html"
|
|
523
|
-
}]
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
if (uri === "agoragentic://vault/info") {
|
|
528
|
-
const data = await apiCall("GET", "/api/vault/info");
|
|
529
|
-
return {
|
|
530
|
-
contents: [{
|
|
531
|
-
uri,
|
|
532
|
-
mimeType: "application/json",
|
|
533
|
-
text: JSON.stringify(data, null, 2)
|
|
534
|
-
}]
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
if (uri === "agoragentic://passport/info") {
|
|
539
|
-
const data = await apiCall("GET", "/api/passport/info");
|
|
540
|
-
return {
|
|
541
|
-
contents: [{
|
|
542
|
-
uri,
|
|
543
|
-
mimeType: "application/json",
|
|
544
|
-
text: JSON.stringify(data, null, 2)
|
|
545
|
-
}]
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
throw new Error(`Unknown resource: ${uri}`);
|
|
550
|
-
});
|
|
551
|
-
|
|
552
|
-
// ─── Start ───────────────────────────────────────────────
|
|
553
|
-
|
|
554
|
-
async function main() {
|
|
555
|
-
const transport = new StdioServerTransport();
|
|
556
|
-
await server.connect(transport);
|
|
557
|
-
console.error("Agoragentic MCP Server v2.0 running on stdio");
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
main().catch(console.error);
|
|
561
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
5
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
6
|
+
const { Client } = require('@modelcontextprotocol/sdk/client/index.js');
|
|
7
|
+
const { StreamableHTTPClientTransport } = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
|
|
8
|
+
const {
|
|
9
|
+
CallToolRequestSchema,
|
|
10
|
+
ListToolsRequestSchema,
|
|
11
|
+
ListResourcesRequestSchema,
|
|
12
|
+
ReadResourceRequestSchema,
|
|
13
|
+
ListPromptsRequestSchema,
|
|
14
|
+
GetPromptRequestSchema,
|
|
15
|
+
} = require('@modelcontextprotocol/sdk/types.js');
|
|
16
|
+
const { version: PACKAGE_VERSION } = require('./package.json');
|
|
17
|
+
|
|
18
|
+
const REMOTE_MCP_URL = process.env.AGORAGENTIC_MCP_URL || 'https://agoragentic.com/api/mcp';
|
|
19
|
+
const API_KEY = process.env.AGORAGENTIC_API_KEY || '';
|
|
20
|
+
|
|
21
|
+
function buildRemoteTransport() {
|
|
22
|
+
const headers = {};
|
|
23
|
+
if (API_KEY) {
|
|
24
|
+
headers.Authorization = `Bearer ${API_KEY}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return new StreamableHTTPClientTransport(new URL(REMOTE_MCP_URL), {
|
|
28
|
+
requestInit: {
|
|
29
|
+
headers,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function connectRemoteClient() {
|
|
35
|
+
const transport = buildRemoteTransport();
|
|
36
|
+
const client = new Client(
|
|
37
|
+
{ name: 'agoragentic-mcp', version: PACKAGE_VERSION },
|
|
38
|
+
{ capabilities: { tools: {}, resources: {}, prompts: {} } }
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
client.onerror = (error) => {
|
|
42
|
+
if (!error) return;
|
|
43
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
44
|
+
console.error(`[agoragentic-mcp] remote client error: ${message}`);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
await client.connect(transport);
|
|
48
|
+
return { client, transport };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function main() {
|
|
52
|
+
const { client, transport } = await connectRemoteClient();
|
|
53
|
+
|
|
54
|
+
const server = new Server(
|
|
55
|
+
{ name: 'agoragentic', version: PACKAGE_VERSION },
|
|
56
|
+
{ capabilities: { tools: {}, resources: {}, prompts: {} } }
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
server.setRequestHandler(ListToolsRequestSchema, async (request) => {
|
|
60
|
+
return client.listTools(request.params);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
64
|
+
return client.callTool(request.params);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
server.setRequestHandler(ListResourcesRequestSchema, async (request) => {
|
|
68
|
+
return client.listResources(request.params);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
72
|
+
return client.readResource(request.params);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
server.setRequestHandler(ListPromptsRequestSchema, async (request) => {
|
|
76
|
+
return client.listPrompts(request.params);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
80
|
+
return client.getPrompt(request.params);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const stdio = new StdioServerTransport();
|
|
84
|
+
await server.connect(stdio);
|
|
85
|
+
|
|
86
|
+
const shutdown = async (signal) => {
|
|
87
|
+
console.error(`[agoragentic-mcp] shutting down on ${signal}`);
|
|
88
|
+
try {
|
|
89
|
+
await transport.terminateSession();
|
|
90
|
+
} catch {
|
|
91
|
+
// Ignore session teardown failures during local shutdown.
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
await transport.close();
|
|
95
|
+
} catch {
|
|
96
|
+
// Ignore transport close failures during local shutdown.
|
|
97
|
+
}
|
|
98
|
+
process.exit(0);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
process.on('SIGINT', () => {
|
|
102
|
+
void shutdown('SIGINT');
|
|
103
|
+
});
|
|
104
|
+
process.on('SIGTERM', () => {
|
|
105
|
+
void shutdown('SIGTERM');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
console.error(`[agoragentic-mcp] stdio relay ${PACKAGE_VERSION} connected to ${REMOTE_MCP_URL}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
main().catch((error) => {
|
|
112
|
+
const message = error instanceof Error ? error.stack || error.message : String(error);
|
|
113
|
+
console.error(`[agoragentic-mcp] fatal: ${message}`);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agoragentic-mcp",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"mcpName": "io.github.rhein1/agoragentic",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Stdio relay for the live Agoragentic MCP server. Mirrors router and x402 edge tools from agoragentic.com/api/mcp.",
|
|
6
6
|
"main": "mcp-server.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"agoragentic-mcp": "
|
|
8
|
+
"agoragentic-mcp": "mcp-server.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node mcp-server.js",
|
|
@@ -21,9 +21,13 @@
|
|
|
21
21
|
"claude",
|
|
22
22
|
"cursor",
|
|
23
23
|
"usdc",
|
|
24
|
-
"base-l2",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
24
|
+
"base-l2",
|
|
25
|
+
"x402",
|
|
26
|
+
"agentic-payments",
|
|
27
|
+
"relay",
|
|
28
|
+
"stdio",
|
|
29
|
+
"langchain",
|
|
30
|
+
"crewai"
|
|
27
31
|
],
|
|
28
32
|
"author": "Agoragentic <support@agoragentic.com>",
|
|
29
33
|
"license": "MIT",
|
|
@@ -36,8 +40,7 @@
|
|
|
36
40
|
"url": "https://github.com/rhein1/agoragentic-integrations/issues"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@modelcontextprotocol/sdk": "^1.27.1"
|
|
40
|
-
"esbuild": "^0.27.3"
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.27.1"
|
|
41
44
|
},
|
|
42
45
|
"engines": {
|
|
43
46
|
"node": ">=18.0.0"
|
|
@@ -48,4 +51,4 @@
|
|
|
48
51
|
"README.md",
|
|
49
52
|
"LICENSE"
|
|
50
53
|
]
|
|
51
|
-
}
|
|
54
|
+
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
${
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
${
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
4. Start earning → ${DIM}POST /api/capabilities${RESET}
|
|
24
|
-
|
|
25
|
-
${BOLD}💰 Sell your AI capabilities:${RESET}
|
|
26
|
-
List any service for USDC. You keep 97%. Other agents pay instantly.
|
|
27
|
-
|
|
28
|
-
${BOLD}📣 Refer other agents:${RESET}
|
|
29
|
-
Earn 1.5% commission on every purchase made by agents you refer.
|
|
30
|
-
|
|
31
|
-
${ORANGE}Homepage:${RESET} https://agoragentic.com
|
|
32
|
-
${ORANGE}Demo:${RESET} https://agoragentic.com/demo.html
|
|
33
|
-
${ORANGE}Docs:${RESET} https://agoragentic.com/docs.html
|
|
34
|
-
${ORANGE}npm:${RESET} https://npmjs.com/package/agoragentic-mcp
|
|
35
|
-
|
|
36
|
-
${DIM}Set a callback_url during registration to get push notifications.${RESET}
|
|
37
|
-
${DIM}Questions? support@agoragentic.com${RESET}
|
|
38
|
-
`);
|
|
2
|
+
const BOLD = '\x1b[1m';
|
|
3
|
+
const CYAN = '\x1b[36m';
|
|
4
|
+
const DIM = '\x1b[2m';
|
|
5
|
+
const RESET = '\x1b[0m';
|
|
6
|
+
|
|
7
|
+
console.log(`
|
|
8
|
+
${BOLD}Agoragentic MCP Relay${RESET}
|
|
9
|
+
|
|
10
|
+
${CYAN}npx agoragentic-mcp${RESET}
|
|
11
|
+
|
|
12
|
+
This package starts a local stdio relay to the live Agoragentic MCP server:
|
|
13
|
+
${DIM}https://agoragentic.com/api/mcp${RESET}
|
|
14
|
+
|
|
15
|
+
Optional environment:
|
|
16
|
+
${BOLD}AGORAGENTIC_API_KEY${RESET} Forward a bearer token to unlock authenticated tools
|
|
17
|
+
${BOLD}AGORAGENTIC_MCP_URL${RESET} Override the remote MCP endpoint
|
|
18
|
+
|
|
19
|
+
Docs: ${DIM}https://agoragentic.com/docs.html${RESET}
|
|
20
|
+
MCP: ${DIM}https://agoragentic.com/.well-known/mcp/server.json${RESET}
|
|
21
|
+
x402: ${DIM}https://x402.agoragentic.com/services/index.json${RESET}
|
|
22
|
+
`);
|